πŸ“¦ fastapi Γ— library

Ship library / sdk on FastAPI with sensible defaults.

FastAPI is a Python workable choice for library / sdk. GreatCTO auto-detects both β€” adds the library archetype overlay, wires library-specific gates, and runs 83 specialist agents around your existing FastAPI workflow.

What changes when GreatCTO joins your FastAPI project

Detection β†’ overlay β†’ gates β†’ reviewers.

1 Β· DETECT

Stack + archetype

GreatCTO reads your pyproject.toml / requirements.txt and detects fastapi + library archetype from signals: imports, file structure, env vars, README hints.

2 Β· OVERLAY

Archetype pack

Attaches the library archetype overlay: archetype-specific reviewer + compliance gates. Override if your specifics differ; the defaults are sensible for FastAPI-style projects.

3 Β· GATES

FastAPI-aware reviewers

qa-engineer runs mypy / ruff / pytest --cov; security-officer scans for SQL injection patterns common in ORMs (SQLAlchemy, Django ORM); performance-engineer profiles async patterns for I/O contention.

4 Β· MEMORY

Cross-project lessons

Bugs you've hit before in other FastAPI projects (connection-pool exhaustion, ORM N+1 queries, retry storms) β€” the agent's Step 0 includes the prior detection order. MTTR drops 94 % on second occurrence (methodology).

First 10 minutes

Concrete walkthrough.

$ cd my-fastapi-app && npx great-cto init
βœ“ scanning manifests… found pyproject.toml
βœ“ stack: fastapi (Python)
βœ“ archetype: library
⚠ archetype + stack combo is unusual β€” review overlay manually
βœ“ 83 agents ready

$ /start "add library feature"
β–Έ architect drafting ARCH-library.md…
β–Έ pm decomposing into beads tasks…
⚐ gate:plan β€” your approval needed

Approve β†’ 3 senior-devs run in parallel worktrees β†’ 5 reviewers fan out in parallel β†’ gate:ship β†’ deploy. One real run walked stage-by-stage: /proof.

What ships

The first feature, FastAPI-idiomatic.

This is the shape of what senior-dev drafts for "library feature" β€” auth first, schema validation, and the audit line the library reviewer requires before gate:ship opens.

# app/routers/library.py β€” drafted by senior-dev, reviewed by 5 agents
from fastapi import APIRouter, Depends
from app.auth import require_user            # security-officer: auth before handler
from app.audit import audit_log              # gate:library: every decision logged

router = APIRouter(prefix="/library")

@router.post("/")
async def create(payload: LibraryIn, user=Depends(require_user)):
    result = await handle(payload, user)      # qa-engineer: pydantic schema enforced
    await audit_log(who=user.id, what="library feature", confidence=result.confidence)
    return result
Where this combo lands

What teams build with FastAPI + the library overlay.

1

Open-source SDKs with semver discipline and API diffing.

2

Internal shared libraries with backward-compat matrices.

3

Client libraries with supply-chain hardening (Sigstore).

⚠ Honest caveat

FastAPI (Python) is not a typical fit for library / sdk. The archetype overlay still attaches, but you may want to override defaults more aggressively. Check the library archetype page for the typical stack list and decide if your case is the right tool / right archetype.

Architecture

Every step of the pipeline, transparent.

No black-box "AI does it all" loop. GreatCTO is a deterministic state machine β€” 8 stages, 22 nodes, 2 human gates. Every node maps to a real agent on GitHub. Inspect the state machine β†’

Install

FastAPI + GreatCTO in one command.

$ npx great-cto init

Free, MIT, runs locally. Built as a Claude Code plugin β€” install with one command.

Related deep-dives

More from the blog

AI

How I designed the SDLC state machine for agentic coding

Eight stages, two human gates, four memory layers. Why this exact shape, and what I tried that didn't work.

AI

First real shipped feature with this stack β€” receipts

One run, one feature, from prompt to merged PR. Time, cost, and gate-by-gate breakdown β€” no marketing math.

AI

How GreatCTO chooses which compliance pack to attach

Regex vs LLM-based archetype detection, the false-positive count, and why I keep rejecting the obvious fix.

AI

Why your agent system fails: missing gates, not missing intelligence

The bottleneck in agentic SDLC isn't model quality β€” it's process governance. Here's the state machine that closes the gap.