This skill should be used when the user asks to "create an architecture spec", "document the architecture", "write an architecture document", "create arch spec for this module", "document this system's architecture", "generate an ADR", "create architecture documentation for this service", "write arch spec for integration", or needs to formally document the architecture of a system, module, layer, or integration.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pragmatic-devx-plugin:pragmatic-arch-spec-createThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create a software architecture technical specification document for a system, module, layer, or integration.
Create a software architecture technical specification document for a system, module, layer, or integration.
Produce a thorough architecture tech spec that captures design decisions (ADRs), component boundaries, architecture patterns, data flows, and non-functional requirements. Specs live in docs/arch/.
system — full application or bounded contextmodule — a single feature module or domainlayer — a horizontal layer (e.g., data access, presentation)integration — an external integration or adapterDefault scope when not specified: module.
Use this skill when no arch spec exists yet for the system, module, or integration being documented.
Do not use when:
pragmatic-arch-spec-updatepragmatic-arch-spec-validateEdge case: if the user asks to "document the actual architecture" of an existing codebase (reverse-engineering decisions from code), scan the codebase thoroughly in Step 1 before the discovery interview — the code is the source of truth for what was actually built.
Before anything else, determine the <name> from the user's message and check whether docs/arch/<name>.arch.md already exists.
If the file exists:
"An architecture spec already exists at
docs/arch/<name>.arch.md. This skill will replace it. Did you mean to:
- Update decisions or component boundaries → use
pragmatic-arch-spec-update- Review its quality → use
pragmatic-arch-spec-validateI will only continue if you explicitly confirm you want to replace the existing architecture spec."
STOP. Do not proceed until the user explicitly confirms they want to replace the existing spec. If the user wants to update or validate instead, end this skill now.
Infer the document language before asking:
docs/arch/ for existing arch spec files and use their language if uniformAskUserQuestion:In which language would you like the architecture spec to be generated?
1. pt-BR — Portuguese (Brazil)
2. es-ES — Spanish (Spain)
3. en-US — English (United States)
4. Other — specify which language
Record the chosen language and use it consistently for all content in the generated document — section headings, component descriptions, ADR rationale, data flow descriptions, and TODO comments.
Determine from the user's input:
Before writing, scan the codebase for:
docs/arch/This is a mandatory step. Do not generate the architecture document until you have a complete picture of the system's context, constraints, quality requirements, and open decisions.
After identifying the name/scope and scanning the codebase, use AskUserQuestion to conduct a focused architecture discovery. The goal is to understand the "why" behind the architecture — decisions only make sense in context.
Adapt the questions to the scope and what is not already evident from the codebase.
multiSelect rules for this step — always follow these:
multiSelect: true — multiple NFRs apply simultaneouslymultiSelect: true — technology, integration, and organizational constraints can coexistmultiSelect: true — there are usually several concerns at oncemultiSelect: true — multiple goals drive the same architectureExample format:
Before I write the architecture spec, I need to understand the broader context:
**Purpose & Drivers**
- What problem does this [system/module/layer/integration] solve, and for whom?
- What are the main business or product drivers behind this architecture?
**Quality Attributes (Non-Functional Requirements)** → multiSelect: true
Which of these matter most? (select all that apply — provide targets where known)
- Performance: expected throughput, latency targets
- Scalability: peak load, growth projections
- Availability: uptime requirements, acceptable downtime
- Security: data sensitivity, compliance requirements (LGPD, SOC2, PCI-DSS, etc.)
- Maintainability: how often will this change, and by what size team?
- Cost: any budget constraints on infrastructure?
**Constraints** → multiSelect: true
Which of these apply? (select all that apply)
- Technology constraints (existing platform, team skills, vendor agreements)
- Integration constraints (systems that cannot change)
- Organizational constraints (team structure, deployment pipeline, environment restrictions)
**Current Pain Points / Risks** → multiSelect: true
What is not working well today? (select all that apply)
- Performance / scalability problems
- Reliability / availability issues
- Security gaps or compliance risk
- High operational cost
- Developer experience / maintainability concerns
**Expected Evolution**
- How is this expected to evolve over the next 6–12 months?
- Are there known future requirements that should influence today's design?
**Open Decisions**
- Are there architectural decisions still being debated? Which options are on the table?
Answer what you know — for anything undecided, I'll capture it as an open ADR item in the spec.
STOP. Do not generate the architecture document until all three conditions below are met. Architecture specs written without this foundation will have FAIL findings in pragmatic-arch-spec-validate:
Create the file at docs/arch/<name>.arch.md using the full template in references/template.md.
Fill every section with concrete content. Use [TODO: ...] only for information that genuinely cannot be inferred and requires a human decision.
Use Mermaid diagrams to make structure and behavior immediately visible. Apply the right diagram type for each context:
| Situation | Diagram type | Section |
|---|---|---|
| Component structure and dependencies | graph TD or flowchart TD | 4.1, 6.2 |
| Request/response flow between components | sequenceDiagram | 7 |
| Async flow with queues, events, or branching | flowchart LR | 7 |
| State transitions (e.g., status machine) | stateDiagram-v2 | 7 |
Rules:
graph TD — show every component and their dependency directionflowchart TD to show allowed vs. forbidden dependency arrows explicitlysequenceDiagram for synchronous flows; use flowchart LR when the flow involves async steps, queues, or conditional branching. Replace ASCII art — do not use plain text arrows.After creating the file:
[TODO: ...] items that remain openNext step: run pragmatic-arch-spec-validate immediately to verify the spec is complete and sound. Do not use this spec as a reference for pragmatic-arch-spec-check until it passes validation.
docs/arch/<name>.arch.md
references/template.md — Full architecture tech spec template with all sections, ADR format, and component table structureUse these examples as calibration targets for output structure, ADR depth, component boundary detail, diagram usage, and writing style. Each example showcases a different architecture pattern:
examples/example-payments-arch.md — Payments module with anti-corruption layer and transactional outbox. Showcases graph TD for component dependencies, flowchart TD for dependency direction, and sequenceDiagram for synchronous multi-step flowsexamples/example-notification-service-arch.md — Event-driven notification service with multiple channels (email + push). Showcases consumer/dispatcher pattern, sequenceDiagram for async flows, and flowchart LR for opt-out/skip branching logicnpx claudepluginhub rvfvazquez/pragmatic-devx-plugin --plugin pragmatic-devx-pluginProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.