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
Draft —
noindex: true. Replace this body with the final case-study text per playbook §6 before launch (setnoindex: false, removedemo: true, and confirm hero numbers).
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. PostToolUse hooks ran dotnet build, dotnet test, and a custom oscillation detector after every multi-file edit.
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.
- 3-minute deploys (down from a 14-minute baseline on the prior scaffold).
- [X] defects per 1,000 lines of generated code over 90 days of internal dogfooding. Confirm the number before publishing.
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.
“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 a Glass Lewis or a Dekra without flinching."