Chapter 05 · Azure App Onboard Prereq
Subchapter 5.13
references/subagent-starter-scaffold.mdMarkdown4 KBView on GitHub
Generate a minimal, Azure-compatible starter project from scratch based on user requirements.
{"skill": "..."} calls. You are a code generation sub-agent only.azure.yaml). This creates application source code only — infrastructure is the prepare/scaffold phase’s job.npm install, pip install, or any package manager commands. The main agent handles the build-validation gate after you return.| Field | Source | Required |
|---|---|---|
| App description | User’s answer to “What kind of app?” or context.json.intent.userPrompt | YES |
| Chosen stack | Stack the user accepted or overrode (e.g., “Node.js/Express”, “Python/FastAPI”) | YES |
| Workspace root | Absolute path to write files | YES |
| Data needs | true if user described database/storage needs (“with a database”, “stores tasks”) | YES |
| Multi-page | true if user described multiple views/pages (“three tabs”, “dashboard + settings”) | YES |
Generate health endpoints, follow stack conventions, and avoid common mistakes:
Health endpoints (MANDATORY):
/healthz — liveness: 200 { status: "ok" }. Must return 2xx directly (no redirects), allow anonymous access./readyz — readiness: check DB/cache/deps. 200 when ready, 503 when not.httpGet.port must match targetPort in ingress config.Stack conventions:
process.env.PORT || 3000. "start" script required. "engines": { "node": ">=20" }. Production deps in dependencies.gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app. Include gunicorn in requirements.txt. Bind 0.0.0.0, not 127.0.0.1.output: 'export'. Hybrid SSR works on SWA.Project structure: src/ for app code (routes, entry, server). .env.sample, .gitignore, package.json/requirements.txt, README.md.
Common mistakes to avoid: hardcoded port, dev server in production, no health endpoint, missing start script, secrets in source, no CORS middleware, missing engines.node, Python missing gunicorn, Python using passlib (unmaintained, breaks on Python 3.12+ with bcrypt 5.x — use bcrypt>=4.0 directly).
Scaffold a minimal starter project. Include:
/healthz (liveness), and /readyz (readiness) endpointspackage.json, requirements.txt, *.csproj, go.mod) with minimal production dependencies.env.sample listing required environment variables (at minimum: PORT).gitignore appropriate for the stacktrue: add a placeholder data model/schema file and an in-memory or file-based data layer (NOT a cloud database client — that’s scaffold phase’s job)true: scaffold route stubs or page componentsReturn the list of files written to the workspace so the main agent can verify and pass to build validation.
| Artifact | Location |
|---|---|
| Application source files | Workspace root (conventional layout per Step 1 patterns) |
| File list | Return to caller — array of relative paths written |
npm init patterns for Node, dotnet new webapi patterns for .NET).node src/server.js serves HTTP on a port) so the 3-axis evaluation has something real to assess.