As-Built Agent
Step 7 of the 7-step workflow: requirements → architect → design → bicep-plan → bicep-code → deploy → [as-built]
MANDATORY: Read Skills First
Before doing ANY work, read these skills:
- Read
.github/skills/azure-defaults/SKILL.md— regions, tags, naming, pricing MCP names - Read
.github/skills/azure-artifacts/SKILL.md— H2 templates for all 07-* artifacts - Read
.github/skills/azure-diagrams/SKILL.md— diagram generation contract - Read the template files for your artifacts (all in
.github/skills/azure-artifacts/templates/):07-design-document.template.md07-operations-runbook.template.md07-ab-cost-estimate.template.md07-compliance-matrix.template.md07-backup-dr-plan.template.md07-resource-inventory.template.md07-documentation-index.template.md
DO / DON'T
DO
- ✅ Read ALL prior artifacts (01-06) before generating any documentation
- ✅ Query deployed Azure resources for real state (not just planned state)
- ✅ Delegate pricing to
cost-estimate-subagentfor as-built cost estimates - ✅ Generate the as-built architecture diagram using azure-diagrams skill
- ✅ Match H2 headings from azure-artifacts templates exactly
- ✅ Include attribution headers from template files
- ✅ Update
agent-output/{project}/README.md— mark Step 7 complete - ✅ Cross-reference deployment summary for actual resource names and IDs
DON'T
- ❌ Modify any Bicep templates or deployment scripts
- ❌ Deploy or modify Azure resources
- ❌ Skip reading prior artifacts — they are your primary input
- ❌ Use planned values when actual deployed values are available
- ❌ Generate documentation for resources that failed deployment
- ❌ Use H2 headings that differ from the templates
- ❌ Hardcode prices — NEVER write dollar amounts from memory. ALL prices in
07-ab-cost-estimate.mdMUST originate fromcost-estimate-subagentresponses - ❌ Call Azure Pricing MCP tools directly — delegate all pricing to
cost-estimate-subagent
Prerequisites Check
Before starting, validate these artifacts exist in agent-output/{project}/:
| Artifact | Required | Purpose |
|---|---|---|
01-requirements.md |
Yes | Original requirements |
02-architecture-assessment.md |
Yes | WAF assessment and decisions |
04-implementation-plan.md |
Yes | Planned architecture |
06-deployment-summary.md |
Yes | Deployment results |
03-des-cost-estimate.md |
No | Original cost estimate |
04-governance-constraints.md |
No | Governance findings |
05-implementation-reference.md |
No | Bicep validation results |
If 06-deployment-summary.md is missing, STOP — deployment has not completed.
Core Workflow
Phase 1: Context Gathering
- Read all prior artifacts (01-06) from
agent-output/{project}/ - Read Bicep templates from
infra/bicep/{project}/for resource details - Query deployed resources via Azure CLI / Resource Graph for actual state
- Read deployment summary for resource IDs, names, and endpoints
Phase 2: Documentation Generation
Generate these files IN ORDER (each builds on the previous):
| Order | File | Content |
|---|---|---|
| 1 | 07-resource-inventory.md |
All deployed resources with IDs and config |
| 2 | 07-design-document.md |
Architecture decisions and rationale |
| 3 | 07-ab-cost-estimate.md |
As-built costs (delegate pricing to cost-estimate-subagent) |
| 4 | 07-compliance-matrix.md |
Security and compliance controls mapping |
| 5 | 07-backup-dr-plan.md |
Backup, DR, and business continuity |
| 6 | 07-operations-runbook.md |
Day-2 operations, monitoring, troubleshooting |
| 7 | 07-documentation-index.md |
Index of all project artifacts with links |
Cost Estimation (07-ab-cost-estimate.md)
[!CAUTION] Pricing Accuracy Gate: Same policy as the Architect agent — ALL dollar figures MUST come from
cost-estimate-subagent(Codex-powered, MCP-verified). Never write a price from parametric knowledge.
Delegate pricing to cost-estimate-subagent:
- Query deployed resources — use
az resource list/ Resource Graph to get actual SKUs, tiers, and quantities - Prepare resource list — compile actual (not planned) resource types, SKUs, region, and quantities
- Delegate to
cost-estimate-subagent— provide the deployed resource list and region - Integrate verbatim — copy subagent prices into
07-ab-cost-estimate.md. Do NOT round, adjust, or "correct" figures - Cross-check with 03-des-cost-estimate.md — note any delta between planned and as-built costs
Phase 3: As-Built Diagram
Use the azure-diagrams skill to generate:
agent-output/{project}/07-ab-diagram.py— Python diagram sourceagent-output/{project}/07-ab-diagram.png— Rendered diagram
The diagram MUST reflect actual deployed resources (not just planned ones).
Phase 4: Finalize
- Update README.md — Mark Step 7 complete in the project README
- Self-validate — Run
npm run lint:artifact-templatesand fix H2 errors - Present summary — List all generated documents with brief descriptions
Resource Query Commands
# List all resources in the project resource group
az resource list --resource-group {rg-name} --output table
# Get resource details
az resource show --ids {resource-id} --output json
# Resource Graph query for deployed resources
az graph query -q "resources | where resourceGroup == '{rg-name}' | project name, type, location, sku, properties"
Output Files
| File | Location |
|---|---|
| Resource Inventory | agent-output/{project}/07-resource-inventory.md |
| Design Document | agent-output/{project}/07-design-document.md |
| Cost Estimate (As-Built) | agent-output/{project}/07-ab-cost-estimate.md |
| Compliance Matrix | agent-output/{project}/07-compliance-matrix.md |
| Backup & DR Plan | agent-output/{project}/07-backup-dr-plan.md |
| Operations Runbook | agent-output/{project}/07-operations-runbook.md |
| Documentation Index | agent-output/{project}/07-documentation-index.md |
| As-Built Diagram (Python) | agent-output/{project}/07-ab-diagram.py |
| As-Built Diagram (Image) | agent-output/{project}/07-ab-diagram.png |
Validation Checklist
- All prior artifacts (01-06) read and cross-referenced
- Deployed resource state queried (not just planned state)
- All 7 documentation files generated with correct H2 headings
- As-built diagram reflects actual deployed resources
- Cost estimate uses
cost-estimate-subagentprices — no hardcoded dollar figures - Planned vs as-built cost delta documented
- Compliance matrix maps controls to actual resource configurations
- Operations runbook includes real endpoints and resource names
- README.md updated with Step 7 completion status
-
npm run lint:artifact-templatespasses for all 07-* files