Code Majesty internal template — production .NET 10 SaaS scaffold in 6 weeks
SMB
5 senior developers
Wyoming, USA (serving US and EU clients)
Engineering
Internal SaaS template — 23 built-in features, 5 connected applications, used as the foundation for client End-to-End engagements
Infrastructure cost reduction vs. comparable Azure-native scaffold
The Challenge
The economics of End-to-End engagements demand that boutique agencies stop rebuilding plumbing. Auth, billing, multi-tenant data isolation, audit logs, observability, role-based access, organization/user/invite flows, webhook receivers, background jobs, file storage, search, notifications, feature flags, admin dashboards, exportable reports, internationalization, rate limiting, API key management, GDPR data-export, soft delete, idempotency keys, OAuth providers, SSO — every one of these is table stakes; none of them is your client’s product.
Five senior developers cannot afford to write them per project. Equally, “buy a SaaS boilerplate” loses on quality and on the ability to specialize. The agency needed its own template — but a template build is itself a project, traditionally 4–6 months at this scope, which the agency could not afford to take its team off client work to do.
The Solution
The team treated the template as the first real test of the 12-layer Claude Code system, with the founders as on-the-record evaluators. CLAUDE.md was written first, in spec-driven form, with target architecture decisions locked before any code generation.
The Roslyn MCP server gave subagents live semantic context. AUTO-TABLE inventories tracked feature × layer × invariant × test coverage in a single rebuilt-on-PR document. Investigation-gate hooks blocked any tool call that referenced a type or method without first opening the file with the Read tool. Code-existence inline annotations forced the planning subagent to mark every reference as [VERIFIED], [ASSUMED], or [MISSING] before implementation began.
The Bayesian build-outcome confidence layer assigned a posterior failure probability to each plan step, surfacing two cases — an EF Core 10 vector type misuse, and an Aspire orchestration assumption against Microsoft.Extensions.AI — that would have cost a full sprint each to unwind. A PostToolUse build gate ran dotnet build and dotnet test after every multi-file edit, and an oscillation detector intercepted reversing edits before they landed.
Subagents were tiered: Haiku for greps, Sonnet for implementation, Opus 4.7 in xhigh effort for the planning passes. Runtime supervisors monitored the orchestrator session against drift markers — token budget, plan-step completion, oscillation hash. The team did not staff this; it was the agency, the system, and a six-week clock.
The Results
Six weeks calendar time. 23 features and 5 connected applications. The metrics:
- 94% infrastructure cost reduction vs. an Azure-native equivalent — driven primarily by stack choices the system enabled: single-region Aspire deployment, SQLite + Litestream for non-multi-tenant subsystems, Postgres only where multi-tenancy demanded it.
- 92% faster compute on identical workloads — NativeAOT compilation paths plus EF Core 10 query plan improvements, both adoptable because the 12-layer system gave the team confidence to take the upgrade.
- 23 features, 5 connected applications — auth, billing, RBAC, audit logging, admin tooling, status page, user docs, and the rest, integrated end-to-end rather than scaffolded side by side.
The template now anchors every End-to-End engagement: a new client build starts not from zero but from a 23-feature production foundation, which is why the $20K floor is credible.
Equally important: the system itself was hardened by the experience. Three of the twelve layers — the oscillation detector, the AUTO-TABLE inventory, and the Bayesian confidence scorer — exist in their current form because the template build exposed the failure modes they now catch.
The modernization angle
The template build was greenfield — but its most-quoted numbers are re-platforming outcomes. The 94% infrastructure cost reduction and 92% compute improvement came from moving a cloud-native scaffold onto right-sized infrastructure and modern .NET 10 paths (NativeAOT, EF Core 10), not from the feature work. That is the same discipline — inventory, sequenced migration, parity verification, infrastructure right-sizing — and the same 12-layer guardrail system that now runs our legacy .NET modernization engagements. If your estate is WebForms or .NET Framework 4.x rather than a fresh scaffold, start with the migration checklist.
“We did not set out to build a methodology. We set out to build a SaaS template. The methodology fell out because we could not have shipped without it.”
See similar results for your team
Join the companies already growing with Code Majesty Tech.
Start Free Trial"The 12-layer system was the only way five people could ship a production-grade SaaS template in six weeks without it becoming the thing we maintain forever. The hooks did the discipline our future selves would have skipped. The Bayesian build-confidence layer caught two architectural mistakes before they shipped. We came out with a foundation we'd hand to our most heavily regulated client without flinching."
Related Posts
How we run Claude Code on a 5-developer .NET team — with our actual CLAUDE.md, hooks, and skills
Our real production setup, published: the hook roster, five subagents with model tiers, eight MCP servers, and the machinery that makes agent output shippable.
Twelve layers between Claude and your production .NET code
The complete guardrail stack for running coding agents on production C# — twelve mechanisms, ordered as a maturity model, each with the config that makes it real.
What a .NET SaaS actually costs to build in 2026 (with the line items)
In-house, offshore, or AI-augmented boutique — real 2026 cost ranges for building a .NET SaaS, itemized down to the 23 features every product needs first.