CF Dotnet Service Forge
Problem
Section titled “Problem”Building and changing .NET microservices in CloudFactory’s platform monorepo involved repetitive boilerplate, inconsistent application of coding standards, and slow code review cycles. Writing Technical Requirements Documents from Product Requirements Documents was tedious, and the loop between generating code, reviewing it, and fixing issues was entirely manual. Existing services made it worse: any change had to be reasoned about across the monorepo — including the ripple into the gateways that expose a service to the frontend or partners.
Can we go from a PRD to a fully functional, reviewed backend service — for both new services and changes to existing ones — using AI?
Approach
Section titled “Approach”Built a forge that now ships as five Claude Code slash-command skills, four custom agent types, a deterministic build/review workflow, and three git-invariant hooks. It handles two scenarios from one entry point: new service (greenfield) and change to existing services (brownfield). A PRD is required for both.

The process:
-
Onboarding — Developer types “hello”, installs skills, agents, and hooks, then
/cf-forgeasks the routing question (new vs change) and four setup questions: forge workspace, platform monorepo clone, PRD path, and service/change name. After install,/cf-forgestarts the whole flow from any workspace. -
TRD Interviewer (new service) — Extracts a feature checklist from the PRD, confirms it, then asks one question at a time across the TRD sections. The output is a completed Technical Requirements Document, with service-specific requirements separated from code-generation standards.
-
PRD-TRD Validator (new service) — Checks every PRD feature is covered in the TRD, patching gaps and flagging ambiguities before code generation begins.
-
Change Planner (existing services) — Analyses the PRD against the monorepo, finds every affected service, library, and gateway, and writes a Change Plan. Brownfield work stays in the target’s existing architecture rather than forcing a rewrite.
-
Build Orchestrator — Coordinates the pipeline but does not write or review code itself. It checks the platform clone, refuses to write on
main, reuses an existing non-main branch when appropriate, or cutsfeature/<name>frommain. Then it launchesforge-review-loop.js, the deterministic workflow that owns generation, gates, review, fixes, and status updates. -
Worker agents — The old worker skills were split into spawnable agent types:
cf-backend-engineergenerates, applies Change Plans, and fixes findings;cf-gateway-engineerhandlesservices/CF.gateways;cf-backend-code-revieweris read-only against monorepo source and writes finding files outside the clone;cf-migrationscaffolds EF Core migrations after the build gate. -
Build, migration, and review workflow — The workflow runs preflight checks for sandbox access, NuGet feeds, private package auth, Docker, and the platform clone. Generation is write-only; the build gate owns compilation. SQL/EF services get migrations after the first successful build, reusing the warm compile. Then a review/fix loop runs up to 10 rounds.
-
Three-reviewer loop — Each round combines the custom CF reviewer (CloudFactory conventions, monorepo boundaries, HashiCorp Vault, architecture, EF Core, Riok.Mapperly, testing, logging), Anthropic’s built-in
code-review, andsecurity-review. Round 1 is full-scope; later rounds are diff-scoped to touched files, and any code change re-runs all three reviewers so security is never skipped. Only Critical/High findings are fixed. -
Coverage and report — Greenfield coverage runs once after the review loop converges, against the final reviewed code. If coverage is below target, the engineer adds tests and the additions go back through build and review. Coverage flags but does not block; the PR’s Codecov patch gate is authoritative. The final output is a durable
REPORT.md, transcript, status file, findings by round, and uncommitted code on the feature branch. -
Git hooks — Three installed
PreToolUsehooks enforce rules outside the prompt: no writes tomainin the platform clone, no committing forge state, and no writing.forge/or.cf-orchestrator/inside the monorepo. Forge state stays outside the platform repo.

Results
Section titled “Results”The input: a ~100-line Product Requirements Document.
A real run produced 77 files and 3,588 lines of code, broken down as:
| Category | Files | Lines added | Lines deleted |
|---|---|---|---|
| Tests | 18 | 1,269 | 14 |
| Business logic | 48 | 2,066 | 0 |
| Environment / config | 11 | 253 | 0 |
| Total | 77 | 3,588 | 14 |
Generated, built, migrated, reviewed, and fixed automatically — landing as an uncommitted diff on a feature branch, with a final report and PR steps for the developer.