npx skills add ...
npx skills add microsoft/foundry-ai-solution-templates-creation --skill azure-scaffold-wizard
npx skills add microsoft/foundry-ai-solution-templates-creation --skill azure-scaffold-wizard
Scaffold a complete, production-ready Azure project from scratch for ANY use case: RAG chatbots, multi-agent systems, API backends, data pipelines, Azure Functions, full-stack web apps, ML training/inference, or event-driven microservices. USE FOR: gathering requirements through adaptive questioning, generating complete project folder structures with all source files, Azure Bicep infrastructure, azure.yaml for azd-up deployment, Docker configuration, CI/CD workflows, README with architecture diagrams, and Responsible AI documentation. Produces fully deployable Azure projects targeting Azure Container Apps, Azure AI Foundry, Azure Functions, or Azure ML. DO NOT USE FOR: modifying existing projects, deploying to Azure (use azure-deploy skill), managing Azure resources (use azure-prepare skill).
This skill generates a complete, production-ready Azure project deployable with azd up. It is fully domain-agnostic and applies to any use case. It produces every file needed: requirements documentation, project structure with all source files, README, Azure Bicep infrastructure, azure.yaml, Docker configuration, CI/CD workflows, architecture diagrams, observability setup, and Responsible AI documentation.
Follow these steps in order. Do not skip or reorder steps. Each step's output feeds the next.
This is the most critical step. Do not generate any files until this step is complete.
Ask the user: "What type of Azure project do you want to build?"
Present these options:
| # | Project Type | Description | When to Choose |
|---|---|---|---|
| 1 | RAG Chatbot | Retrieval-Augmented Generation chatbot with vector search | Conversational AI grounded in your own data |
| 2 | Multi-Agent System | Multiple AI agents coordinated by an orchestrator | Parallel/sequential AI reasoning pipeline (Foundry compatible) |
| 3 | API Backend | REST or GraphQL API service | Backend service with database and Azure deployment |
| 4 | Data Pipeline | ETL/ELT data processing pipeline | Batch or streaming data transformation |
| 5 | Azure Functions | Serverless event-driven functions | Lightweight event triggers and integrations |
| 6 | Full-Stack Web App | Frontend + Backend web application | Complete web application with UI |
| 7 | ML Training & Inference | Model training and serving endpoint | Custom ML model lifecycle on Azure ML |
| 8 | Event-Driven Microservices | Message-based distributed system | Async decoupled services at scale |
If the user's request does not fit these categories exactly, choose the closest match or combine patterns. For detailed descriptions, read references/project-types.md.
| # | Question | Guidance |
|---|---|---|
| U1 | What business problem does this solve? | One sentence. Drives README opening and all documentation. |
| U2 | Who are the end users? | Drives UI design, access control decisions, RBAC roles. |
| U3 | What is the project name? | kebab-case slug for folder names, azure.yaml, and resource naming. |
| U4 | Programming language? | Python (default), TypeScript, C#, or multi-language. Drives all source file templates. |
| U5 | Azure region? | Default: eastus2. Constrain by AI model availability if applicable. |
| U6 | Authentication required? | None (default scaffold), Microsoft Entra ID (production). |
| U7 | What Azure services beyond the defaults? | e.g., Cosmos DB, Service Bus, Key Vault, Storage, Redis. Drives extra Bicep modules. |
| U8 | Frontend required? | Yes/No. If yes: Next.js (default), React SPA, or other. |
| U9 | What compliance or regulatory requirements? | e.g., HIPAA, SOC2, GDPR. Drives TRANSPARENCY_FAQ.md and security docs. |
| U10 | Target deployment platform? | Azure Container Apps (default), Azure Functions, AKS, App Service. |
| U11 | Use Azure AI Foundry Agent Service? | Yes (default for AI-capable types): AI processing via Foundry Hosted Agents with structured output, managed deployment, and MAF. No: hand-rolled code using Azure OpenAI SDK directly. When to ask: Type 1 (RAG) — always ask. Types 3, 4, 5, 6, 8 — ask only after the type-specific "Include AI?" question is answered Yes. Skip for: Type 2 (Multi-Agent, always Foundry) and Type 7 (ML Training, uses Azure ML). |
Based on the project type selected in 1A, read the corresponding reference file and ask the type-specific questions defined there:
| Project Type | Reference File | What It Adds |
|---|---|---|
| RAG Chatbot | references/rag-chatbot.md | Vector store, embedding model, chunking strategy, data sources, conversation memory |
| Multi-Agent System | references/multi-agent.md | Agent names/roles, orchestration topology, MCP tools, Foundry model choice |
| API Backend | references/api-backend.md | Endpoints, database, API style (REST/GraphQL), rate limiting |
| Data Pipeline | references/data-pipeline.md | Data sources/sinks, scheduling, batch vs. stream, transformations |
| Azure Functions | references/function-app.md | Triggers, bindings, Durable Functions, runtime stack |
| Full-Stack Web App | references/full-stack-app.md | Frontend framework, SSR/SPA, state management, API integration |
| ML Training & Inference | references/ml-training.md | ML framework, compute targets, model registry, managed endpoints |
| Event-Driven Microservices | references/event-driven.md | Message broker, event schemas, KEDA scaling rules |
The selected reference file contains:
If U11 = Yes (or if the project type is Multi-Agent), also read references/foundry-agent-patterns.md. This file provides the shared Foundry agent scaffolding patterns (agent.yaml, MAF main.py, schemas.py, skills, two-mode dispatcher, registration script) used by the type-specific reference file's "Foundry Mode" section. Exception: Multi-Agent projects use their own complete patterns in references/multi-agent.md — do not load foundry-agent-patterns.md for Multi-Agent.
Create docs/requirements.md with a structured summary of ALL answers organized by section: Universal (U1–U11) and Type-Specific.
Based on the requirements from Step 1, generate the folder layout.
Every project, regardless of type, includes these common root files and directories:
Read the type-specific reference file (loaded in Step 1C) for the additional directories and files specific to the selected project type.
Follow the generation instructions in the type-specific reference file loaded in Step 1C. This step produces the core application code.
Examples of what each type generates:
Generate ALL source files with complete, functional code — not placeholders or stubs.
When U11 = Yes (Foundry mode): The Foundry agent patterns from references/foundry-agent-patterns.md produce additional files: an agents/ directory with agent.yaml, main.py, schemas.py, skills/, plus a dispatcher (hosted_agents.py) and registration script (register_agents.py). The type-specific reference file specifies exactly which parts of the existing code the Foundry agent replaces vs which parts it augments.
Read references/bicep-patterns.md for universal Bicep patterns.
Generate infra/main.bicep (subscription-scoped) and all required modules.
Base modules for ALL project types:
monitoring.bicep — App Insights + Log Analytics workspacecontainer-registry.bicep — ACR (if containerized, which is most types)container-apps-env.bicep — Managed Environment (if U10 = ACA)container-app.bicep — Reusable per-app modulerole-assignments.bicep — RBAC for all managed identitiesAdd type-specific modules as listed in the loaded reference file (e.g., ai-foundry.bicep for RAG/Multi-Agent, ai-search.bicep for RAG, function-app.bicep for Functions).
Add optional service modules based on U7 answers: cosmos.bicep, storage.bicep, keyvault.bicep, servicebus.bicep, etc.
Read references/azure-yaml-patterns.md.
Generate:
azure.yaml with preprovision and postprovision hooksscripts/preprovision.sh + scripts/preprovision.ps1 — validate region, model availability, exit non-zero on failurescripts/postprovision.sh + scripts/postprovision.ps1 — ACR login, image build with timestamp tag, registrationRead references/docker-patterns.md.
Generate:
Dockerfile for each service (multi-stage, non-root user, health checks)docker-compose.yml for local developmentdocker-compose.override.yml for local overrides.dockerignore per serviceRead references/observability-patterns.md for OpenTelemetry + Azure Monitor patterns.
Configure observability in all backend/API entry points:
Read references/readme-template.md for the section template and conventions.
Generate a complete README with all required sections populated from requirements — no placeholder text.
Read references/architecture-diagrams.md for SVG generation prompts and conventions.
Generate:
docs/images/readme/solution-architecture.svg — Azure resource topology diagramdocs/images/readme/pipeline-flow.svg — Data/agent flow diagram (if applicable)SVG requirements: viewBox + preserveAspectRatio, system-ui fonts, no external imports, under 50KB.
Read references/responsible-ai.md for the TRANSPARENCY_FAQ.md template.
Generate TRANSPARENCY_FAQ.md addressing all 6 required questions, populated with project-specific content from Step 1.
Read references/cicd-patterns.md.
Generate .github/workflows/ci.yml and .github/workflows/deploy.yml with language-appropriate steps.
Generate:
docs/architecture.md — narrative description of the architecturedocs/DeploymentGuide.md — step-by-step azd up walkthroughdocs/production-migration.md — gaps between scaffold and production (auth, storage, scaling, security)docs/troubleshooting.md — common errors and fixesCODE_OF_CONDUCT.md, CONTRIBUTING.md, SECURITY.md, SUPPORT.mdRead references/security-patterns.md for authentication, RBAC, Key Vault, and network isolation patterns.
Use these patterns to populate docs/production-migration.md with specific guidance for:
Run through this checklist before delivering. Every item must pass.
Requirements & Documentation:
docs/requirements.md exists with all U1–U11 + type-specific answersTRANSPARENCY_FAQ.md covers all 6 required questionsdocs/production-migration.md documents all production gapsInfrastructure:
main.bicep is subscription-scoped (targetScope = 'subscription')@secure() — no plain-text secret outputsmain.parameters.json binds all params to ${AZURE_*} azd env varsazure.yaml & Deployment:
IMAGE_TAG is always a timestamp (YYYYMMDDHHmmss), never latestwindows (pwsh) and posix (sh) variantsDocker:
docker-compose.yml enables full local development without Azure.env.example documents ALL required environment variablesCI/CD:
ci.yml has lint + type-check + test + Bicep validation stepsdeploy.yml builds, pushes, and deploys on main branchArchitecture Diagrams:
viewBox + preserveAspectRatio="xMidYMid meet"system-ui)Observability:
Run the quality checklist defined in the loaded type-specific reference file from Step 1C.
Run these in addition to Universal and Type-Specific checks:
agent.yaml has meaningful description: (2-3 sentences, not a placeholder)main.py uses default_options={"response_format": Schema} for structured outputschemas.py has confidence_score, confidence_level, summary, and errors fieldsskill.md defines role, input contract, step-by-step instructions, and output requirementsregister_agents.py passes description=agent_def["description"] to create_version()hosted_agents.py correctly switches between Foundry mode and direct HTTP modedocker-compose.yml does NOT set AZURE_AI_PROJECT_ENDPOINT on the backend (enables local mode)ai-foundry.bicep module is included in infra/main.bicepCognitive Services OpenAI User and Azure AI User rolesregister_agents.py