A fully-local AI coding agent kernel for C#/.NET β it plans, writes, builds, fixes compile errors, and verifies your project, powered by a 30B model on your own GPU. No cloud. No code leaves your machine.
Most coding agents are prompt-based: they try to behave correctly because a giant system prompt tells them to. LocalCodeForge is data-injected: the model receives the actual engineering facts it needs β type inventories with signatures, access modifiers, symbol indexes β so it has no room to hallucinate. When it does fail, the kernel fixes and rolls back deterministically, not by hoping the model "behaves better."
Three things make it different:
- Engineering awareness as data, not prompts β type inventory with member signatures + access modifiers is injected before generation; a compile error is located to the exact file before the fix round begins (
LocateErrorFile). - A closed fix loop with a safety net β write β
dotnet build/runβ on failure: locate, fix, retry; on repeated failure: automatic rollback to the pre-task state (task-id isolated backups). - Verifiable, not vibes β deterministic routing (rule-based intent classifier), advisory
expected_outputsemantics for real computation, and an E2E suite (7/7 green) that distinguishes completed, safely blocked, and broken.
Demo GIF: add a screen recording of a ShippingService-style incremental task (new class reusing existing services β compile β run β output).
# 1. Serve the local model (Ollama; 30B Qwen3-Coder-A3B, single tag "law-unified")
ollama pull law-unified
# 2. Build (solution file is LocalCodeForge.slnx β internal name pending rename)
dotnet build LocalCodeForge.slnx --no-incremental
# 3. Run, point at your project in write mode, then just describe the task
dotnet run --project src\Agent.Cli\Agent.Cli.csproj
> use --write X:\path\to\your\project
> add a ShippingService class that reuses TaxService and DiscountService, wire it into Program.csThe web dashboard is the primary interaction surface: the CLI auto-launches it on startup (loopback + token) and opens your browser, with live task streams, stats, history, backup diff, rollback and one-click rerun. The CLI itself stays as a fallback (pipeline/headless safe) β every command keeps working.
| Mode | Example | Behavior |
|---|---|---|
| Read / query | "read Order.cs and summarize" | AgentLoop, converges with a summary |
| Single file | "write hello.py printing Hello E2E" | Generates + verifies |
| Multi-file project | "C# student system: Student model, StudentService, Program" | Planner orchestrates files + run |
| Incremental task | "add ShippingService reusing TaxService/DiscountService, wire into Program.cs" | Planner β write β build β fix β run β done (3 consecutive green runs: 68s / 69s / 121s) |
| Modify existing code | "add CalculateFinalTotal to OrderService, switch Program.cs to call it" | Safely blocked by pre-write type-conflict guard if the model rewrites existing types (P-D) |
User input
β TaskClassifier (deterministic intent) β SimpleQA / AgentLoop
β Orchestrator
β Planner (multi-file plan + run/verify spec)
β Executor (type inventory + signature injection β write)
β Verify (dotnet build/run; compile-error β LocateErrorFile β fix loop)
β Done | Rollback (task-id isolated backups, dry-run preview)
Event stream β SQLite β web dashboard (SSE live updates, task replay, rollback).
| Component | Choice |
|---|---|
| Runtime | .NET 10 (do not downgrade) |
| Model | Qwen3-Coder-A3B 30B via Ollama (OpenAI-compatible, single tag, request-level temperature) |
| Orchestration | Semantic Kernel 1.80.1 |
| Storage | SQLite (sessions, symbols, memory, metrics, events) |
| UI | Local web dashboard (loopback + token auth, SSE) |
docs/DEVELOPER.mdβ how to maintain & extend (deterministic rules, data schemas, E2E cases)docs/DEVELOPER_DETAILED.mdβ deep walkthroughdocs/HANDOVER.mdβ change history & pitfalls (incl. the failure-point migration chain: hallucination β signature injection β advisory semantics β 3 consecutive completions)
MIT β the LICENSE file is pending; feel free to use under MIT terms meanwhile.
Star if you believe local-first engineering is the way. Issues and PRs welcome.
