Code templates

Production-shaped starting points

Small, complete projects you can copy into real work. Each one runs locally against the real libraries, has offline tests that pass without an API key, and comes with a file-by-file map and a production checklist.

10 of 10 templates

  • PythonCoreFree sample

    Tool-using Claude agent

    An order-support agent with a bounded tool loop, pydantic tool schemas, an approval-gated idempotent refund, and cost accounting.

    • agent
    • tool use
    • pydantic
    • approval gate
    • idempotency
    Applied AI EngineerForward Deployed EngineerApplied AI Architect18 files
  • PythonIntermediate Full access

    FDE integration backend (FastAPI)

    A ticket-intake service with scoped API keys, Idempotency-Key writes, a resilient outbound client, signed webhooks, a swappable job queue and Claude triage via structured output.

    • fastapi
    • idempotency
    • webhooks
    • retries
    • structured output
    • background jobs
    Forward Deployed EngineerApplied AI Engineer21 files
  • PythonIntermediate Full access

    RAG service with permissions and citations

    Ingest docs, retrieve with hybrid BM25 plus embeddings behind a per-user permission filter, and have Claude answer only from cited chunks or refuse.

    • rag
    • retrieval
    • bm25
    • hybrid search
    • citations
    • structured outputs
    • fastapi
    • evals
    Applied AI EngineerForward Deployed EngineerApplied AI Architect31 files
  • PythonCore Full access

    Structured extraction to validated Pydantic objects

    Extract invoices from text or PDF with structured outputs, then validate, check business rules and grounding, retry once with feedback, and run it all as a Message Batch.

    • structured outputs
    • pydantic
    • extraction
    • validation
    • message batches
    • pdf
    Applied AI EngineerForward Deployed EngineerApplied AI Architect21 files
  • PythonIntermediate Full access

    LLM eval harness with judge calibration and a CI gate

    Evaluate a triage prompt with code graders and a calibrated LLM judge, report pass rates with Wilson intervals, cost and latency per slice, and block regressions in CI.

    • evals
    • llm-as-judge
    • cohen's kappa
    • wilson interval
    • regression gate
    • ci
    • asyncio
    Applied AI EngineerForward Deployed EngineerApplied AI Architect22 files
  • PythonIntermediate Full access

    MCP server (Python)

    A helpdesk MCP server on the official mcp SDK: read and idempotent write tools with Pydantic validation, a resource, stderr logging and errors returned as tool results.

    • mcp
    • tools
    • pydantic
    • idempotency
    • sqlite
    Applied AI EngineerForward Deployed EngineerApplied AI Architect13 files
  • PythonAdvanced Full access

    Multi-agent orchestrator

    A lead agent that plans with structured output, runs isolated subagents in parallel with AsyncAnthropic, and synthesises, under enforced token, dollar and step budgets with JSONL tracing.

    • multi-agent
    • orchestration
    • asyncio
    • budgets
    • tracing
    • structured outputs
    Applied AI EngineerForward Deployed EngineerApplied AI Architect19 files
  • TypeScriptCore Full access

    Tool-using agent (TypeScript)

    The tool-using agent in TypeScript with @anthropic-ai/sdk: zod-validated config and tools, a bounded streaming loop with is_error results, an SSE route and a CLI.

    • agent
    • tool use
    • typescript
    • zod
    • streaming
    • sse
    Applied AI EngineerForward Deployed EngineerApplied AI Architect12 files
  • PythonAdvanced Full access

    Wren: a complete coding-agent harness

    The C11 harness on the real Anthropic SDK: the full loop with every stop reason, a tool registry, sandboxed file and shell tools, permission modes and hooks, layered context with memory files, compaction, subagents, checkpoints and resume, traces with cost and replay, and injection defence, behind a `wren` CLI.

    • agent harness
    • coding agent
    • tool use
    • permissions
    • hooks
    • compaction
    • subagents
    • checkpoints
    • tracing
    • prompt injection
    Applied AI EngineerForward Deployed EngineerApplied AI Architect28 files
  • PythonAdvanced Full access

    Halden procurement agent: an enterprise agent pilot

    The C12 pilot end to end on real libraries: a headless ERP (FastAPI + SQLite) that owns authorization, idempotency and receipts; cited RAG and an LLM wiki with lint; an MCP server with per-tool scopes; a LangGraph state graph with typed routing, confidence-based escalation and an interrupt for version-bound human approval; Langfuse tracing; evals with a regression gate; a Temporal workflow with receipt-checked retries; a FastAPI front door and Docker.

    • enterprise agent
    • LangGraph
    • MCP
    • OAuth
    • human approval
    • idempotency
    • RAG
    • LLM wiki
    • Langfuse
    • evals
    • Temporal
    • FastAPI
    • Docker
    Applied AI EngineerForward Deployed EngineerApplied AI Architect68 files