LLMs produce beautiful code, but without guardrails. Forge absorbs codebases, learns their architecture, enforces constraints, and rewrites AI-generated code into production-ready artifacts. Scout → Absorb → Wire → Certify. Now with surgical capability grafting, golden-path recipe replay, four monadic laws, and a tamper-evident token-savings ledger on every project.
Open source · BSL-1.1 → Apache 2.0 (2030) · v0.81 · Python 3.10+ · 1616 tests · 59 CLI verbs · 10 MCP tools / 116 actions
Four commands that turn chaos into architecture. Every step is reversible, testable, and auditable.
Crawl a codebase tree. Extract language mix, architecture patterns, test coverage, CI/CD, docs. Produces a path_analysis.json that describes the entire project in one snapshot.
Learn the codebase rules. Read every file, extract architecture constraints, naming conventions, patterns, anti-patterns. Build a manifest.json that LLMs can follow for perfect alignment.
Rebuild AI-generated code. Feed an LLM-generated file into Forge with the manifest. Forge rewrites it to fit the exact tier, imports, naming, and patterns of the codebase. One-shot alignment.
Validate rewrites. Hash-based certificate proves the code passed Forge's architecture gates. Signed, auditable, repeatable. Use for CI/CD gates, deployment checks, code review signoff.
Every line of code belongs to exactly one tier. Tiers compose upward only. Logic never repeats.
┌─────────────────────────────────────────┐ │ a4_sy_orchestration/ CLI, entry points ├─ imports from ↓ │ a3_og_features/ Feature modules ├─ imports from ↓ │ a2_mo_composites/ Stateful classes ├─ imports from ↓ │ a1_at_functions/ Pure functions ├─ imports from ↓ │ a0_qk_constants/ Types, enums, config ├─ imports from │ NOTHING └─────────────────────────────────────────┘
Each tier is a verified building block. Features are assembled from lower tiers, not rewritten. Circular imports are impossible by design.
Everything you need to absorb, graft, replay, enforce, and certify. Each verb is composable, testable in isolation, and emits a savings receipt to the project ledger.
Crawl a codebase directory. Extract languages, patterns, tests, CI/CD, docs. Return path_analysis.json.
Read a codebase and extract architecture rules. Build manifest.json for LLM alignment.
Rebuild an AI-generated file to match codebase patterns. One-shot alignment to tiers, imports, naming.
Hash and sign code as passing architecture gates. HMAC-SHA256 certificate proof.
Iterate on a generation with feedback. Loop LLM calls until code passes Forge gates.
Run pytest with coverage. Validate rewrites match expected behavior. 90+ test suite included.
Deep code metrics. Cyclomatic complexity, tier violations, import cycles, coverage gaps.
Full end-to-end: scout → absorb → wire on every file. Atomic or per-file modes.
Auto-generate architecture docs from manifests. README, API reference, tier maps.
End-to-end validation. Run all commands, verify output, cert sign, ready for deploy.
Surgical extraction. forge graft --source-file X --symbol Y --rename Z lifts one function or class, lands it in the right tier, auto-wires CLI + MCP.
Print lifetime savings + by-tool breakdown from .atomadic-forge/lifetime_savings.jsonl. Tamper-evident, auditable line by line.
Run golden-path command chains as subprocesses — zero LLM round-trips per step. 9 recipes: release_hardening, add_cli_command, fix_wire_violation, add_feature, publish_mcp, …
MCB, AIOM, AHLP, IFWC-lite scanners. Bound pure-tier compute, ban I/O imports, fingerprint modules with SHA-256, fuzz declared invariants. Advisory by default.
Three commands to absorb a codebase and see what Forge learns about your architecture.
# Install Atomadic Forge $ pip install atomadic-forge # Verify installation $ forge --help Usage: forge [OPTIONS] COMMAND [ARGS]... Atomadic Forge — absorb, enforce, emerge. # Run the full pipeline $ forge launch /path/to/codebase ✓ Scout: Found 156 files ✓ Absorb: Extracted 42 rules ✓ Wire: Ready for LLM alignment
Feed your manifest to an LLM prompt. When it generates code, pass the output through forge wire to rebuild it in your exact architecture.
All plans include every Forge command, every architectural enforcement gate, and every future update. Non-commercial use stays free forever under BSL-1.1; the source converts to Apache 2.0 on April 27, 2030.
Non-commercial use of Atomadic Forge is free forever under BSL-1.1. Subscriptions are required only for commercial deployment. Questions? atomadic69@gmail.com.
Open source. Non-commercial use free forever. MIT-style patterns. Start with scout on any repo.
View on GitHub →Forge bridges the gap between fast code generation and production-ready architecture.
Drop a manifest JSON into your LLM prompt. No special config. Works with Claude, GPT-4, Cursor, or any API.
Same code + same manifest = same output every time. Auditable, testable, git-friendly.
Path analysis shows exactly what Forge learned. Tier violations, import cycles, coverage gaps all flagged.
Every rebuild gets a cryptographic certificate. Use for CI/CD gates, deploy checks, code review signoff.
Comprehensive test suite across 120 files validates every tier, every command, every edge case. 872 Lean4 theorems back the math — 0 sorry, 0 admit. All green on Python 3.10-3.12.
Every Forge verb auto-appends to .atomadic-forge/lifetime_savings.jsonl. File-backed JSONL, line-by-line auditable. Run forge token-savings for a lifetime total + by-tool breakdown. Auditable, not claimed.
MCB (no unbounded loops in pure tier), AIOM (no I/O imports in pure tier), AHLP (SHA-256 fingerprint per pure module), IFWC-lite (property-based fuzzing on declared invariants). Deterministic guarantees backed by file-backed scanners — advisory by default.
forge replay <recipe> runs command chains as subprocesses — zero LLM round-trips per step. Nine recipes ship today: release_hardening, add_cli_command, fix_wire_violation, add_feature, publish_mcp, and more.
Works with any LLM. Ollama for local runs, Claude for quality, GPT-4 for speed. Your choice, your control.
Each command outputs structured JSON and emits a savings receipt to the project ledger. Chain them in your CI/CD, IDE, or LLM pipelines.
$ forge --help scout Crawl codebase → path_analysis.json absorb Learn rules → manifest.json wire Rebuild code → aligned output certify Sign code → HMAC-SHA256 cert graft Lift one symbol from any repo → tier-correct landing [v0.76] replay Run a golden-path recipe (zero LLM round-trips) [v0.79] token-savings Print lifetime total + by-tool breakdown [v0.78] evolve Iterate with feedback → convergence analyze Deep metrics → metrics.json rebuild Full end-to-end pipeline launch Validation + certification … and 48 more. $ forge graft --source-file solver.py --symbol Solver --rename FastSolver ✓ Lifted Solver → a3_og_features/fast_solver.py + auto-wired CLI/MCP $ forge replay release_hardening ✓ 7 steps, 0 LLM calls, 142s wall clock $ forge token-savings ✓ Lifetime: ~3.4M tokens saved across 412 verb runs source: .atomadic-forge/lifetime_savings.jsonl (tamper-evident, line-by-line)