Agent skill
architecture-docs
Use this skill when creating, updating, or maintaining ARCHITECTURE.md files, when users ask about "my architecture documentation" or "architecture", when generating diagrams from architecture documentation, when validating/checking/auditing architecture (including BIAN alignment, META layers, standards compliance), or when answering questions about documented components, data structures, integrations, security, performance, deployment, technology stack, or architectural decisions
Install this agent skill to your Project
npx add-skill https://github.com/shadowX4fox/solutions-architect-skills/tree/main/skills/architecture-docs
SKILL.md
Architecture Documentation Skill
This skill provides comprehensive guidelines for creating and maintaining ARCHITECTURE.md files using the standardized template from ARCHITECTURE_DOCUMENTATION_GUIDE.md. It enforces consistency across all documentation sections through the Foundational Context Anchor Protocol β a dependency-aware editing workflow that loads required upstream context before any downstream section edit, requires source attribution for derived claims, and detects downstream impact when any section changes.
CRITICAL: Section Number vs File Prefix Disambiguation
Internal section numbers (S1-S12) and file prefix numbers (01-10) are independent and do NOT align.
| Internal Section | Name | File |
|---|---|---|
| S1+S2 | Executive Summary + System Overview | docs/01-system-overview.md |
| S3 | Architecture Principles | docs/02-architecture-principles.md |
| S4 | Architecture Layers | docs/03-architecture-layers.md |
| S5 | Component Details | docs/components/ |
| S6 | Data Flow Patterns | docs/04-data-flow-patterns.md |
| S7 | Integration Points | docs/05-integration-points.md |
| S8 | Technology Stack | docs/06-technology-stack.md |
| S9 | Security Architecture | docs/07-security-architecture.md |
| S10 | Scalability & Performance | docs/08-scalability-and-performance.md |
| S11 | Operational Considerations | docs/09-operational-considerations.md |
| S12 | ADRs | adr/ directory |
Rules:
- When a user says "update Section 9" β resolve to S9 =
docs/07-security-architecture.md, NOTdocs/09-* docs/09-operational-considerations.md= S11, not Section 9- Always use S-prefix (S1-S12) to identify sections, file paths to identify files
- NEVER assume file prefix
NNequals section numberN
When This Skill is Invoked
Automatically activate when:
- User asks to create architecture documentation
- User asks to update or edit ARCHITECTURE.md
- User mentions documenting system architecture
- User requests architecture review, audit, or analysis (triggers Design Drivers calculation prompt)
- User explicitly asks to "calculate design drivers" or "update design drivers"
- User asks about architecture documentation structure or best practices
- User edits Section 1 Executive Summary Key Metrics (triggers metric consistency check)
- User edits any downstream section (S4βS11) β triggers Context Anchor load
- User requests metric consistency check, verify metrics, or audit metrics
- User asks informational questions about the documented architecture (if ARCHITECTURE.md exists)
- "What is our [authentication/scaling/data flow/etc.] approach?"
- "How does [component/system/integration] work?"
- "What technologies do we use for [purpose]?"
- "Tell me about the architecture of [system]"
- User asks to generate, create, add, or update diagrams in architecture documentation (triggers Workflow 8)
- "Generate my architecture diagrams"
- "Create Mermaid diagrams from ARCHITECTURE.md"
- "Add diagrams to my architecture"
- "Update my architecture diagrams"
- "Refresh / regenerate diagrams to reflect recent changes"
Query Pattern Triggers
This skill automatically activates when users ask questions about documented architecture, including:
Reference Patterns:
- "According to my architecture documentation..."
- "Based on the architecture..."
- "What does the architecture use/require/implement for..."
- "My architecture documentation shows/says..."
- "The architecture specifies/defines..."
- "Check/Validate/Verify the architecture [aspect]..."
- "Audit the [architecture component/pattern]..."
Technical Query Keywords:
- Components: "components", "services", "modules", "microservices", "systems"
- Data: "data structures", "data flow", "database", "schema", "models", "entities"
- Integration: "APIs", "integrations", "external systems", "endpoints", "interfaces"
- Security: "authentication", "authorization", "encryption", "security", "compliance"
- Performance: "scaling", "performance", "SLA", "capacity", "throughput", "latency"
- Deployment: "deployment", "cloud provider", "infrastructure", "environments", "regions"
- Technology: "tech stack", "languages", "frameworks", "tools", "libraries", "versions"
- Decisions: "why choose", "decision", "trade-offs", "alternatives", "ADR", "rationale"
- Validation: "check", "validate", "verify", "audit", "alignment", "BIAN", "META", "service domain", "layer", "standards", "compliance check"
Multi-section Queries:
- Questions requiring synthesis across multiple sections
- Cross-cutting concerns (e.g., "How does authentication work with external systems?")
- Implementation details spanning components, data, and deployment
π― AUTOMATIC WORKFLOW DETECTION
IMPORTANT: Immediately upon skill invocation, analyze the user's request to detect their intent.
Detection Logic
Check the user's original message (before /architecture-docs was invoked) for these patterns:
Workflow 8: Diagram Generation
Triggers:
- Keywords: "generate", "create", "add", "update", "make" + "diagram", "diagrams", "Mermaid diagram", "architecture diagram"
- Examples: "generate my architecture diagrams", "create diagrams from ARCHITECTURE.md", "add diagrams to my architecture"
- Section-specific: "generate diagrams for Section 4", "create data flow diagrams"
- Format mentions: "Mermaid diagrams", "visual diagrams", "architecture diagrams"
- Reconciliation: "reconcile diagrams", "move diagrams", "consolidate diagrams"
- Audit/coverage: "check diagram coverage", "audit diagrams", "diagram completeness", "diagram audit"
- Placement: "diagrams in wrong location", "fix diagram placement", "diagram location"
- External intake: user provides external file path and mentions diagrams
Action when detected:
- Confirm: "I'll help you generate architecture diagrams."
- Jump directly to Workflow 8, Step 1 (Diagram Type Selection)
- Do NOT ask which workflow - proceed automatically
Workflow 9: Migrate to docs/ Structure
Triggers:
- Keywords: "migrate", "restructure", "split", "reorganize", "convert" + "architecture", "ARCHITECTURE.md"
- Size complaints: "too large", "too long", "hard to navigate", "split into files"
- Explicit: "migrate my architecture to the new structure", "convert to docs/ layout"
Action when detected:
- Confirm: "I'll help you migrate ARCHITECTURE.md to the multi-file docs/ structure."
- Jump directly to Workflow 9, Step 1
- Do NOT ask which workflow - proceed automatically
Other Workflows
If the user's request matches other documented workflows (1-9), follow their respective trigger patterns.
Note: Workflow 1 (new ARCHITECTURE.md creation) starts at Step 0 (PO Spec prerequisite check) before Step 1 (type selection).
If No Pattern Matches
If the user's request doesn't match any workflow triggers:
- Acknowledge the skill invocation
- Ask which workflow they want to use
- Provide brief description of available workflows
File Naming Convention
IMPORTANT: All architecture documentation uses the multi-file docs/ structure.
ARCHITECTURE.mdat the project root is the navigation index only (~130 lines)- All section content lives under
docs/as numbered Markdown files - Component details (Section 5) live under
docs/components/β one file per component
File naming pattern: NN-kebab-case-name.md β lowercase, hyphens only, no spaces, no uppercase, no underscores.
- Section files:
docs/01-system-overview.md,docs/06-technology-stack.md - Component files:
docs/components/01-api-gateway.md,docs/components/02-payment-service.md
See RESTRUCTURING_GUIDE.md for the full directory structure and naming conventions.
Location
ARCHITECTURE.mdβ always at the project rootdocs/β always at the project root (sibling toARCHITECTURE.md)docs/components/β insidedocs/- For multi-project repositories, each project subdirectory gets its own
ARCHITECTURE.md+docs/
Working with Architecture Documentation β Context Optimization
IMPORTANT: The multi-file structure makes context loading simple β individual docs/ files are 50β400 lines each (full file fits in context). No line-offset tricks needed.
Context-Efficient Workflow
-
Find the target section
- Read
ARCHITECTURE.mdnavigation table to identify whichdocs/NN-name.mdfile contains the target section - Example: "Edit security architecture" β navigate to
docs/07-security-architecture.md
- Read
-
Load Context Anchor (REQUIRED for downstream sections)
- SKIP this step when editing
docs/01-system-overview.md,docs/02-architecture-principles.md, or for typo/formatting-only fixes - REQUIRED when editing any file from
docs/03-architecture-layers.mdthroughdocs/09-operational-considerations.md, or anydocs/components/*.mdfile - Universal Foundation: Always load
docs/01-system-overview.md+docs/02-architecture-principles.md - Relevant ADRs: Match ADR titles from
ARCHITECTURE.mdnavigation table against target section keywords; load matched ADRs - Section-Specific Parents: Load parent sections per the Foundational Context Anchor Protocol dependency table (see below)
- Example for S9 (Security): load S1+2 (foundation) + S5/README (components) + S7 (integrations) + S8 (tech stack) + relevant ADRs
- Context budget: 250β850 lines depending on section tier
- SKIP this step when editing
-
Read the entire target file
- Individual
docs/files are small enough to read in full Read(file_path="docs/07-security-architecture.md")β no offset/limit needed
- Individual
-
Edit the target file directly
- Use the Edit tool on the specific
docs/NN-name.mdfile - Do NOT edit ARCHITECTURE.md unless you are adding a new section/file to the navigation table
- Source Attribution (during editing): When writing derived content in downstream sections, insert cross-reference links to the source:
- Metrics: When repeating a metric from S1 Key Metrics β
(see [Key Metrics](01-system-overview.md#key-metrics)) - ADR decisions: When content implements an ADR β
per [ADR-NNN](../adr/ADR-NNN-title.md) - Principles: When invoking an S3 principle β
per [Principle Name](02-architecture-principles.md#anchor) - Parent section references: When referencing components, layers, integrations, or tech β link to the specific file
- Unverifiable claims: If a specific claim (metric, decision, constraint) cannot be traced to an existing section, user input, or ADR β insert
<!-- TODO: Add source reference -->marker
- Metrics: When repeating a metric from S1 Key Metrics β
- Use the Edit tool on the specific
-
Post-Write Alignment & Traceability Audit
- Check A β Principle traceability: Written content does not contradict Section 3 principles
- Check B β Metric consistency: Numeric values match Section 1 Key Metrics
- Check C β ADR alignment: Content does not contradict loaded ADR decisions
- Check D β Parent section alignment: Content references valid components (S5), integrations (S7), tech (S8) as loaded
- Check E β Source citation audit: Scan the written content for:
- Numeric values (TPS, latency, SLO, %) β must link to S1 Key Metrics or be marked as section-local
- Technology names matching S8 β should link to tech stack or governing ADR
- Architecture pattern references β should link to S3 or S4
<!-- TODO: Add source reference -->markers β count and report
- Silent pass if no issues found; display alignment report only when misalignment or missing citations are detected
5.5. Downstream Documentation Propagation
Runs immediately after the Post-Write Alignment Audit passes. Detects downstream files whose content may be stale due to the edit and offers to update them.
Trigger Gate
Run when: The edit changed substantive content β metrics, technology names, component names, architectural patterns, constraints, requirements, or interface definitions.
Skip silently when: The edit was cosmetic β typo fixes, formatting, grammar, markdown structure, comment updates, <!-- TODO --> markers, source attribution links, or Document Index line numbers. Heuristic: if the diff contains only whitespace/punctuation/link/formatting changes with no word-level changes to technical terms, skip entirely.
Anti-recursion rule: Propagation updates (Phase 3 edits) do NOT re-trigger Step 5.5.
Reverse Dependency Table
| Edited Section | File | Downstream Section Files |
|---|---|---|
| S1+S2 (System Overview) | docs/01-system-overview.md |
ALL sections (S4βS11) + docs/components/* |
| S3 (Principles) | docs/02-architecture-principles.md |
ALL sections (S4βS11) + docs/components/* |
| S4 (Layers) | docs/03-architecture-layers.md |
S5 (docs/components/*), S8 (docs/06-technology-stack.md) |
| S5 (Components) | docs/components/*.md |
S6 (docs/04-data-flow-patterns.md), S7 (docs/05-integration-points.md), S8 (docs/06-technology-stack.md), S9 (docs/07-security-architecture.md), S10 (docs/08-scalability-and-performance.md), S11 (docs/09-operational-considerations.md) |
| S6 (Data Flow) | docs/04-data-flow-patterns.md |
(leaf β no downstream sections) |
| S7 (Integration) | docs/05-integration-points.md |
S9 (docs/07-security-architecture.md) |
| S8 (Tech Stack) | docs/06-technology-stack.md |
S9 (docs/07-security-architecture.md), S10 (docs/08-scalability-and-performance.md), S11 (docs/09-operational-considerations.md) |
| S9 (Security) | docs/07-security-architecture.md |
(leaf) |
| S10 (Scalability) | docs/08-scalability-and-performance.md |
S11 (docs/09-operational-considerations.md) |
| S11 (Operations) | docs/09-operational-considerations.md |
(leaf) |
Cross-cutting (always scanned regardless of table): docs/components/, docs/handoffs/
Phase 1: Impact Discovery
1a. Fact-delta extraction β Compare the file content before and after the edit. Produce a concrete bullet list of what changed (e.g., "Database: PostgreSQL β CockroachDB", "Added: Redis caching layer", "Removed: legacy SOAP endpoint"). If zero substantive deltas β skip propagation entirely.
1b. Structural dependency scan β Look up the edited section in the reverse dependency table above. Collect all downstream section files.
1c. Cross-reference scan β Grep across docs/, docs/components/, docs/handoffs/ for explicit references to the edited filename (links, section anchors, (see [...](...))).
grep -rl "{edited_filename}" docs/ docs/components/ docs/handoffs/ 2>/dev/null
1d. Handoff scan β For each fact-delta keyword (component names, technology names, pattern names), grep docs/handoffs/ for matching terms.
1e. Merge and deduplicate β Combine results from 1b+1c+1d. Remove duplicates and remove the edited file itself.
Phase 2: Generate Checklist
Present a structured checklist grouped by file type:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
DOWNSTREAM UPDATES REQUIRED β {edited_file} ({section_name})
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Changes detected:
- {bullet list from Phase 1a}
βββ Downstream Sections ββββββββββββββββββββββββββββββββββ
[ ] 1. docs/07-security-architecture.md β references {changed_tech}; security controls may need updating
[ ] 2. docs/09-operational-considerations.md β mentions {old_value}; align with new value
βββ Component Files ββββββββββββββββββββββββββββββββββββββ
[ ] 3. docs/components/03-payment-service.md β uses {changed_component}; integration details may be stale
βββ Handoff Docs βββββββββββββββββββββββββββββββββββββββββ
[ ] 4. docs/handoffs/03-payment-service-handoff.md β Section 4 references {old_tech}
βββ No Updates Required ββββββββββββββββββββββββββββββββββ
βΉοΈ docs/04-data-flow-patterns.md β no references to changed content
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Approve all? ('all', comma-separated numbers to deselect, or 'skip')
Wait for user response before proceeding.
Phase 3: Execute Updates
Process approved files in tier order (lower tiers first β higher tiers last) so each updated file is available as context for files that depend on it.
For each approved docs/*.md or docs/components/*.md file:
- Load Context Anchor (universal foundation + section-specific parents per the dependency table)
- Read the target file in full
- Identify passages affected by the fact-deltas
- Apply updates, maintaining Source Attribution links (
per [Section X](../...)) - Run the 5-check Post-Write Alignment Audit on the updated file
- Mark as
[x]
For approved docs/handoffs/*.md files: Read, locate affected passages, update following the dev-handoff Documentation Fidelity Policy. Mark as [x].
If user selected skip: Add <!-- PROPAGATION PENDING: upstream {edited_file} changed ({date}) β downstream not yet updated --> comment at the top of the edited file.
Component File Edit Handling
When the edited file is docs/components/*.md (not a section file):
- Cascade through S5's row in the table (S6, S7, S8, S9, S10, S11)
- Additionally grep for the component name (not just filename) across all
docs/files - Always include the matching
docs/handoffs/{component}-handoff.mdif it exists - If
docs/components/README.mdneeds updating, delegate to thearchitecture-component-guardianskill
Phase 4: Propagation Report
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
DOWNSTREAM PROPAGATION β COMPLETION REPORT
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Source: {edited_file} ({section_name})
Changes: {summary from Phase 1a}
Completed:
[x] docs/07-security-architecture.md β {what was updated}
[x] docs/components/03-payment-service.md β {what was updated}
Verified (no change needed):
β docs/08-scalability-and-performance.md β content still accurate
Deselected (manual update required):
[ ] docs/09-operational-considerations.md β user chose manual update
Failed (require manual review):
β οΈ {any files where edit could not be applied cleanly}
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Phase 5: Asset Regeneration Advisory
Runs after: Phase 4 report is displayed.
Also runs when: User selected skip in Phase 2 and handoff files exist in docs/handoffs/ β in this case, note that handoff text was also not updated.
Skip silently when: No docs/handoffs/*.md files appeared in the Phase 3 update list (completed, deselected, or failed) AND propagation was not skipped.
Step 5a β Detect asset-impacting changes: Scan the fact-deltas from Phase 1a for asset-impact keywords (case-insensitive):
| Keywords | Potentially Stale Asset |
|---|---|
| API, endpoint, REST, GraphQL, gRPC, route, path, method, request, response, header, status code | openapi.yaml |
| database, table, column, schema, index, constraint, migration, DDL, SQL | ddl.sql |
| Redis, cache, key, TTL, expiration, eviction | redis-key-schema.md |
| deployment, container, pod, replica, port, resource, limit, CPU, memory, image, Kubernetes, K8s | deployment.yaml |
| message, event, topic, queue, consumer, producer, Kafka, RabbitMQ, stream | asyncapi.yaml |
| Avro, schema registry | schema.avsc |
| Protobuf, proto | schema.proto |
| cron, schedule, batch, job, CronJob | cronjob.yaml |
If no keywords match β skip this phase silently.
Step 5b β Identify affected components: For each docs/handoffs/*-handoff.md file that was touched in Phase 3 (or would have been if propagation was skipped/deselected), check whether docs/handoffs/assets/NN-<component-name>/ exists and contains any of the matched asset types. Exclude components with no asset directory or no matching asset files on disk.
If zero components remain after filtering β skip silently.
Step 5c β Present advisory:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ASSET REGENERATION ADVISORY
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The propagation above updated handoff document text, but
the following scaffolded assets may now be stale:
Component: {component-name}
β openapi.yaml (changes mention: endpoint, API)
β ddl.sql (changes mention: table, column)
Component: {component-name-2}
β deployment.yaml (changes mention: container, port)
These assets were generated by the dev-handoff skill and
contain structured specs derived from architecture docs.
In-place text patches do not regenerate them.
Would you like to regenerate handoff documents and assets
for the affected components?
[Yes] β I will provide the commands to run
[No] β No action needed right now
Note: You can regenerate all handoffs at any time with:
/skill architecture-dev-handoff
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
If propagation was skipped: prepend to the advisory:
Note: Propagation was skipped β handoff document text was also not updated. Full regeneration is recommended.
Wait for user response.
- Yes β Display one line per affected component:
Run: /skill architecture-dev-handoff(for each affected component by name). Do NOT invoke the skill automatically. - No β Acknowledge and proceed with no further action.
- Verification
- After edits, re-read the modified
docs/file to verify changes - Use Grep to search for specific content without loading multiple files
- After edits, re-read the modified
Discovering Available Files
When the target section is not obvious, read ARCHITECTURE.md first:
# Step 1: Read navigation table
nav_content = Read(file_path="ARCHITECTURE.md")
# Step 2: Parse the Documentation table to find the target file
# Example row: | 8 | Security Architecture | [docs/07-security-architecture.md](docs/07-security-architecture.md) | ... |
# Step 3: Read that specific docs/ file in full
target_content = Read(file_path="docs/07-security-architecture.md")
Technology Context Enrichment (context7) β Component Documentation
When creating NEW component documentation (Workflow 1, Section 5), and the component's Technology field references specific frameworks, libraries, or tools, use the context7 MCP tool to fetch current documentation for those technologies.
Prerequisite: The context7 MCP tool must be available (resolve-library-id and get-library-docs functions). If not available, skip silently β component doc generation proceeds normally.
When to use:
- During Workflow 1 (new ARCHITECTURE.md creation) when populating Section 5 component files
- When a user explicitly asks to "enrich" or "validate" technology references in an existing component doc
- NOT during routine section edits, NOT during compliance generation, NOT during handoff generation
Procedure:
-
Extract technology names from the component's Technology field (e.g., "Java 17, Spring Boot 3.1.5, PostgreSQL 15").
-
For each distinct technology, call
resolve-library-id(e.g.,spring-boot,postgresql,nestjs). -
For each resolved library, call
get-library-docswith a topic hint scoped to configuration patterns and version features for the documented version (e.g., "Spring Boot 3.1 actuator endpoints and configuration properties"). -
Present a Technology Context Brief to the user as an advisory checklist β do NOT auto-fill any document fields:
Technology Context Brief β [Component Name] Spring Boot 3.1.5: - Key config patterns: application.yml (spring.datasource.*, management.endpoints.*) - Health check endpoints: /actuator/health (liveness), /actuator/health/readiness - Suggested fields to document: connection pool settings, JPA dialect, security filter chain PostgreSQL 15: - Notable in v15: MERGE statement, improved JSON path, pg_walinspect - Suggested fields to document: connection pool strategy (PgBouncer?), vacuum/autovacuum, extensions used -
The architect decides which items to include in the component doc. The skill does NOT auto-populate any fields from this brief.
What this is NOT:
- Not a replacement for the architect's knowledge or documentation decisions
- Not auto-filled content (the "no invention" policy still applies)
- Not blocking β generation proceeds with or without it
Updating the Navigation Index
Update ARCHITECTURE.md only when:
- A new section file is added to
docs/ - A new component file is added to
docs/components/ - A file is renamed or removed
Do NOT update ARCHITECTURE.md for content edits within existing docs/ files.
Architecture Type Selection Workflow
Full workflow for guiding users through architecture type selection (Banking/BIAN, Microservices, Monolith, etc.), the PO Spec prerequisite check, template loading, and diagram generation is in ARCHITECTURE_TYPE_SELECTION_WORKFLOW.md.
Read it when:
- User is creating a NEW architecture document
- User asks to change architecture type
- No existing ARCHITECTURE.md is detected
The workflow runs Steps 0β7 (PO Spec gate β type selection β template load β metadata β multi-file creation β ADR delegation β diagrams).
ADR operations: Any ADR creation, update, or supersede must delegate to /skill architecture-definition-record. This skill reads adr/*.md for context only.
When to Trigger
Activate this workflow when:
- β User asks to create a NEW ARCHITECTURE.md document
- β User explicitly requests to "change architecture type" or "select architecture type"
- β User is updating an existing ARCHITECTURE.md and mentions changing from one architecture type to another
Prerequisite: Step 0 (PO Spec check) runs before Step 1 for all new document creation triggers
Skip this workflow when:
- β Editing an existing ARCHITECTURE.md (type already selected)
- β User is only updating specific sections unrelated to architecture type
- β Document type is already clear from context
See ARCHITECTURE_TYPE_SELECTION_WORKFLOW.md for full workflow details.
Automatic Index Updates
CRITICAL: After ANY edit that significantly changes section line numbers (>10 lines), automatically update the Document Index.
When to Update
Update if:
- β Added/removed content shifting section boundaries (>10 lines)
- β Modified section headers or structure
- β User requests: "update the index"
Skip if:
- β Minor edits (<10 lines)
- β Only metadata changes
- β Typo fixes
Workflow Overview
Quick Steps:
- Detect: Run
grep -n "^## [0-9]" ARCHITECTURE.mdto find section boundaries - Calculate: Parse output to determine line ranges (Section_Start to Next_Section_Start - 1)
- Update: Edit Document Index (typically lines 5-21) with new ranges
- Timestamp: Update "Index Last Updated" to current date
- Report: Inform user which sections changed
Example:
# After adding content to Section 8, it grew from 906-980 to 912-996
grep -n "^## [0-9]" ARCHITECTURE.md
# Parse: Section 8 now at line 912, Section 9 at 998
# Calculate: Section 8 = 912-997, Section 9 = 998-1243
# Update index and report to user
Detailed Algorithm
For complete line range calculation algorithm, step-by-step examples, verification checklist, and edge cases: β METRIC_CALCULATIONS.md Β§ Automatic Index Updates
Best Practices
DO:
- β Update after significant edits
- β Use grep for accuracy (don't guess)
- β Update timestamp
- β Report changes to user
DON'T:
- β Update for tiny changes
- β Skip timestamp update
- β Change index format
Metric Consistency Detection & Management
Full workflow and reference details are in METRIC_CALCULATIONS.md (Read it when this workflow is needed).
Quick summary: Automatically detects and reviews metric inconsistencies when Section 1 Key Metrics are updated, scanning the entire document for stale duplicates and presenting a structured audit report before applying changes.
When to invoke: After editing Section 1 Executive Summary Key Metrics, or when user requests "check metric consistency", "verify metrics", or "audit metrics".
Foundational Context Anchor Protocol
Full workflow and reference details are in ARCHITECTURE_DOCUMENTATION_GUIDE.md (Read it when this workflow is needed).
Quick summary: Dependency-aware editing workflow that loads required upstream context (S1+S2, S3, ADRs, and section-specific parents) before any downstream section edit, requires source attribution for derived claims, and detects downstream impact when any section changes (executed via Step 5.5 Downstream Documentation Propagation).
When to invoke: Before editing any docs/ file from docs/03-architecture-layers.md through docs/09-operational-considerations.md, or any docs/components/*.md file.
Design Drivers Impact Metrics Calculation
Full workflow and reference details are in DESIGN_DRIVER_CALCULATIONS.md (Read it when this workflow is needed).
Quick summary: Automatically calculates and maintains Design Drivers impact metrics (Value Delivery, Scale, Impacts) from Sections 1, 2.3, 5, and 8, using a 6-phase workflow to extract data, present findings, and update Section 2.2.1.
When to invoke: When user requests "architecture review", "calculate design drivers", "update design drivers", or "assess design impact".
Architecture Reference Docs (C4 Model + Type-Specific Rules)
The references/ directory contains the architecture rules and C4 translation guides for each architecture type. These are loaded during Step 3 of the Architecture Type Selection Workflow.
| File | Purpose |
|---|---|
references/ICEPANEL-C4-MODEL.md |
Governing C4 reference β defines C4 abstractions, diagram levels, boundary test. Constrains component documentation behavior. |
references/MICROSERVICES-ARCHITECTURE.md |
Microservices architecture rules and patterns |
references/MICROSERVICES-TO-C4-TRANSLATION.md |
Microservices β C4 mapping (services=containers, not systems) |
references/3-TIER-ARCHITECTURE.md |
3-Tier architecture rules (Presentation, Logic, Data) |
references/3-TIER-TO-C4-TRANSLATION.md |
3-Tier β C4 mapping (tierβ container distinction) |
references/N-LAYER-ARCHITECTURE.md |
N-Layer variants (DDD, Clean, Hexagonal, 5-Layer Extended) |
references/N-LAYER-TO-C4-TRANSLATION.md |
N-Layer β C4 mapping (inner layers=C3, infra=C2) |
references/META-ARCHITECTURE.md |
META 6-layer banking architecture rules |
references/META-TO-C4-TRANSLATION.md |
META β C4 mapping (layers as visual groupings at C2) |
references/BIAN-ARCHITECTURE.md |
BIAN V12.0 5-layer architecture rules |
references/BIAN-TO-C4-TRANSLATION.md |
BIAN β C4 mapping (Service Domains as containers) |
Critical rule: Every architecture type MUST have both reference docs. Types without them are greyed out in the selection menu and cannot be used.
Documentation Structure
Full workflow and reference details are in QUERY_SECTION_MAPPING.md (Read it when this workflow is needed).
Quick summary: Covers when and how to use ARCHITECTURE_DOCUMENTATION_GUIDE.md for creating, documenting, and maintaining architecture docs, the 9 required Architecture Principles, the 12 required section names with exact format, and the Workflow 7 Informational Query workflow for answering questions from architecture documentation.
When to invoke: When creating new architecture documents, documenting existing projects, maintaining architecture docs, or answering user questions about documented architecture content.
Workflow 8: Diagram Generation (Generate Architecture Diagrams)
Full workflow and reference details are in MERMAID_DIAGRAMS_GUIDE.md (Read it when this workflow is needed).
Quick summary: 11-step diagram generation workflow covering mandatory diagrams (High-Level Architecture and Data Flow), optional on-request diagrams, external diagram intake and reconciliation, canonical location enforcement, existing diagram detection, and a flow-diagram completeness audit.
When to invoke: When user requests "generate diagrams", "create diagrams", "add diagrams", "update diagrams", or references Mermaid/architecture/visual diagrams.
Workflow 9: Migrate Existing ARCHITECTURE.md to docs/ Structure
Full workflow and reference details are in RESTRUCTURING_GUIDE.md (Read it when this workflow is needed).
Quick summary: Covers migrating a monolithic ARCHITECTURE.md to the multi-file docs/ structure (6 steps: analyze, propose target layout, extract files, rewrite ARCHITECTURE.md as navigation index, update external references, verify), plus optional enhancements and reference document inventory.
When to invoke: When user mentions "migrate", "restructure", "split", "reorganize", or "convert" with "architecture" or "ARCHITECTURE.md", or when the file is "too large" or "hard to navigate".
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
architecture-component-guardian
Use this skill to create or update docs/components/README.md β the only sanctioned way to modify the component index table. Invoke when adding, removing, or updating components, syncing the index, or migrating flat components to C4 multi-system structure.
architecture-docs-export
On-demand export of architecture documents to professional Word (.docx) files. Exports are never automatic β invoke explicitly when ready to produce deliverables. Solution Architecture mode synthesizes an Executive Summary from docs/01-system-overview.md, the component index, and the compliance manifest (if present), then exports individual ADR docs. Handoff mode exports selected component development handoffs from docs/handoffs/.
architecture-readiness
Use this skill for requirements elicitation, discovery interviews, and creating or evaluating Product Owner Specifications documenting business requirements before architecture design
architecture-peer-review
Use this skill to perform a Solution Architect peer review of ARCHITECTURE.md documents. Generates an interactive HTML playground for reviewing and triaging findings with approve/reject/comment workflow. Invoke when the user asks to review, critique, peer-review, or assess architecture documentation quality, asks for architecture feedback or a second opinion, or wants scalability/security/performance analysis of their architecture.
architecture-onboarding
Interactive concept map explorer for architecture documentation onboarding. Reads ARCHITECTURE.md, docs/, compliance-docs/, and adr/ to generate a canvas-based concept map playground with draggable nodes representing sections, components, principles, compliance contracts, and skills β connected by dependency, ownership, and workflow edges. Users cycle knowledge levels (Know/Fuzzy/Unknown) per node and generate targeted learning prompts. Use when onboarding a new team member, exploring the architecture suite, getting an architecture overview, or mapping what you know and don't know.
architecture-compliance-review
Use this skill to review compliance contract portfolio health. Validates all 10 contracts exist and are β€6 months old, triggers regeneration for missing/expired contracts, and generates an interactive playground for exploring concept gaps across all contracts to understand what needs to be addressed to reach the auto-approve threshold (β₯8.0/10).
Didn't find tool you were looking for?