skills/architecture-docs-export/SKILL.md
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 handoffs/. Compliance mode exports selected compliance contracts from compliance-docs/. Security Posture mode exports the consolidated security validation checklist (analysis/SECURITY-POSTURE-<date>.md, from architecture-analysis) as a reviewer-fillable worksheet. IMPORTANT — this skill ONLY produces Word .docx files. It does NOT handle releasing, publishing, tagging, freezing, bumping, or finalizing an architecture version. For the Draft → Released lifecycle (git tag architecture-v{version}, archive snapshot, semver bump), use the `architecture-docs` skill (Workflow 10) instead. Do NOT invoke this skill when the user says "release my architecture", "release architecture", "publish architecture", "ship architecture", "tag architecture version", "freeze architecture", "bump architecture version", or "finalize architecture" — those route to `architecture-docs`.
npx skillsauth add shadowx4fox/solutions-architect-skills architecture-docs-exportInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Exports architecture documents to professional Word files on demand.
On-demand only — this skill never runs automatically after document generation. Invoke it explicitly when you are ready to produce deliverable Word files.
As of v3.8.0, this skill is an orchestrator. The actual export work (file reads, markdown composition, bun run tools/docgen/generate-doc.js invocations) runs inside the docs-export-generator sub-agent, pinned to model: sonnet. It now covers four export modes: Solution Architecture, Component Handoff, Compliance Contract, and Security Posture.
Why: Export is a high-frequency, zero-synthesis task — pure verbatim extraction + docgen orchestration. Running it on Opus (the default for most Claude Code sessions) wastes token budget. The sub-agent pins Sonnet deterministically, so cost per run does not depend on whoever invokes it. Teams that batch-export ADRs, handoffs, and compliance contracts weekly/monthly see immediate savings.
Orchestrator responsibilities (main context):
Sub-agent responsibilities (agents/generators/docs-export-generator.md):
EXPORT_RESULT: block backRuntime: Bun only — never Node. All generator calls inside the sub-agent use
bun run $plugin_dir/tools/docgen/generate-doc.js(absolute path). Ifbun runhangs:
- Ensure the
docxpackage is installed:cd $plugin_dir/tools/docgen && bun install- Confirm
plugin_dirwas resolved correctly in Step 0 — re-run the Glob if unsure- Never fall back to
node— it is not an authorized runtime
Documentation Fidelity: All executive summary content is extracted verbatim from source files. No paraphrasing, no embellishment. If a required section exists in the source but is empty, the sub-agent writes
[NOT DOCUMENTED — add content to <source-file>]. Compliance statistics are computed strictly from manifest table values.
| Export Mode | Input Sources | Output |
|-------------|--------------|--------|
| Solution Architecture | docs/01-system-overview.md + docs/02-architecture-principles.md + docs/components/README.md + compliance-docs/COMPLIANCE_MANIFEST.md (optional) | exports/SA-<name>.docx (executive summary) + exports/ADR-NNN-<title>.docx per ADR |
| Component Handoff | Selected handoff(s) from handoffs/ | exports/HANDOFF-<component>.docx per component |
| Compliance Contract | Selected contract(s) from compliance-docs/ | exports/CC-<domain>-<project>.docx per contract; Questions & Gaps Register cells are highlighted for stakeholder editing |
| Security Posture | Selected Security Posture report(s) from analysis/ (SECURITY-POSTURE-<date>.md) | exports/SECURITY-POSTURE-<name>.docx; Status / Owner / Evidence checklist cells are highlighted for reviewer completion |
Before spawning the sub-agent, the orchestrator MUST resolve the absolute path to the plugin installation and pass it in the spawn prompt.
Step 0a — Glob (dev/local mode):
Glob for: **/{sa-skills,solutions-architect-skills}/tools/docgen/generate-doc.js
The brace expansion matches both marketplace installs (sa-skills/ in ~/.claude/plugins/cache/...) and local dev clones (historical repo folder solutions-architect-skills/). If found, strip /tools/docgen/generate-doc.js from the result to get plugin_dir.
Step 0b — Marketplace fallback:
If Glob returns nothing, run:
plugin_dir=$(bun ~/.claude/plugins/marketplaces/shadowx4fox-solution-architect-marketplace/skills/architecture-compliance/utils/resolve-plugin-dir.ts)
If both fail:
❌ Cannot locate plugin directory. Ensure the plugin is installed correctly.
plugin_dir is passed to the sub-agent in the spawn prompt — the sub-agent does NOT re-resolve it.
Trigger phrases: "export architecture", "export to Word", "export solution architecture"
Confirm docs/01-system-overview.md exists. If not:
❌ docs/01-system-overview.md not found.
Generate architecture documentation first with /skill architecture-docs.
Scan for ADR files in these locations, in order:
adr/ADR-*.mddocs/adr/ADR-*.mddocs/decisions/ADR-*.mdADR-*.md in project rootCollect absolute paths. If zero ADRs found, still proceed — the executive summary will have an empty ADR table.
Read docs/01-system-overview.md's H1; kebab-case it for the output filename. Pass as solution_name_slug.
Invoke sa-skills:docs-export-generator with a prompt providing:
job_type: solution-architectureplugin_dir: <absolute path from Step 0>project_dir: <CWD>solution_name_slug: <from Step A.3>items: <JSON array of absolute ADR file paths from Step A.2>Wait for the sub-agent's EXPORT_RESULT: block, then report to user.
Parse the sub-agent's EXPORT_RESULT: block and display:
✅ Solution Architecture Export Complete
exports/SA-<solution-name>.docx (Executive Summary)
exports/ADR-001-<title>.docx (Architecture Decision 001)
exports/ADR-002-<title>.docx (Architecture Decision 002)
...
If status: PARTIAL or FAILED, list the failures from the result block.
Trigger phrases: "export handoff", "export dev handoff", "export <component-name> to Word"
Glob handoffs/*-handoff.md. If none found:
❌ No handoff documents found in handoffs/.
Generate them first with /skill architecture-dev-handoff.
Otherwise display numbered list:
Available component handoffs:
1. 01-payment-api-handoff.md Payment API
2. 02-user-service-handoff.md User Service
3. 03-audit-db-handoff.md Audit Database
Which component(s) to export?
Enter numbers (e.g. 1, 3), ranges (e.g. 1-3), or "all"
Convert user input to the list of absolute paths.
Invoke sa-skills:docs-export-generator with:
job_type: handoffplugin_dir: <absolute path>project_dir: <CWD>items: <JSON array of absolute handoff file paths>✅ Handoff Export Complete
exports/HANDOFF-payment-api.docx (Payment API)
exports/HANDOFF-user-service.docx (User Service)
Trigger phrases: "export compliance", "export compliance contract", "export compliance to Word"
Glob compliance-docs/*.md (excluding COMPLIANCE_MANIFEST.md). If none:
❌ No compliance contracts found in compliance-docs/.
Generate them first with /skill architecture-compliance.
For each contract, read the Document Control table and extract:
[VALIDATION_SCORE] or the populated score field)| Status | row)**Generation Date**)Display:
Available compliance contracts:
1. SRE_ARCHITECTURE_Project_2026-03-25.md SRE Architecture 7.69/10 In Review
2. CLOUD_ARCHITECTURE_Project_2026-03-25.md Cloud Architecture 8.50/10 Approved
...
Which contract(s) to export?
Enter numbers (e.g. 1, 3), ranges (e.g. 1-3), or "all"
For each selected contract, derive domain_slug from the filename prefix (e.g., SRE_ARCHITECTURE → sre-architecture). Read the project name for project_slug.
Invoke sa-skills:docs-export-generator with:
job_type: complianceplugin_dir: <absolute path>project_dir: <CWD>project_slug: <kebab-case project name>items: <JSON array of {path, domain_slug, score, document_status, approval_authority} objects>✅ Compliance Export Complete
exports/CC-sre-architecture-project.docx (SRE Architecture — 7.69/10 In Review)
exports/CC-cloud-architecture-project.docx (Cloud Architecture — 8.50/10 Approved)
📝 The Questions & Gaps Register in each document has yellow-highlighted cells (Owner, Action Required, Priority)
ready for stakeholder review and editing in Microsoft Word.
Trigger phrases: "export security posture", "export security posture validation", "export security checklist to Word"
The input is a Security Posture validation report (analysis/SECURITY-POSTURE-<date>.md)
produced by /skill architecture-analysis (analysis 12 — the consolidation of STRIDE +
Data Sensitivity). This export is a pure verbatim render: docgen renders the checklist
with editable Status / Owner / Evidence cells for the validating reviewer.
Glob analysis/SECURITY-POSTURE-*.md. If none found:
❌ No Security Posture report found in analysis/.
Generate one first: /skill architecture-analysis → select 12 (Security Posture).
If multiple dates exist, display them numbered (most recent first) and let the user choose; default to the most recent if the user just says "export security posture":
Available Security Posture reports:
1. SECURITY-POSTURE-2026-06-03.md (most recent)
2. SECURITY-POSTURE-2026-05-01.md
Which to export? (number, or "latest")
If docs/01-system-overview.md exists, read its H1 and kebab-case it for
solution_name_slug. Otherwise omit it (the sub-agent falls back to SECURITY-POSTURE.docx).
Invoke sa-skills:docs-export-generator with:
job_type: security-postureplugin_dir: <absolute path from Step 0>project_dir: <CWD>solution_name_slug: <from Step D.2, if available>items: <JSON array of absolute paths to the selected SECURITY-POSTURE-<date>.md file(s)>✅ Security Posture Export Complete
exports/SECURITY-POSTURE-<solution-name>.docx
📝 The Status, Owner, and Evidence columns are yellow-highlighted, ready for the validating
reviewer to mark each control Pass / Fail / N/A in Microsoft Word.
| Document | Type Code | Color | Purpose |
|----------|-----------|-------|---------|
| Executive Summary | SA | Corporate blue #1F4E79 | Architecture overview deliverable |
| ADR-*.md | ADR | Amber/Gold #8B6914 | Architecture decisions |
| Component handoffs | HANDOFF | Teal #0D7377 | Dev team deliverables |
| Compliance contracts | CC | Purple #7B2D8E | Compliance adherence contracts with editable Questions & Gaps Register |
| Security Posture | SP | Crimson #9C1F2E | Consolidated security control checklist with editable Status / Owner / Evidence cells |
Security Posture exports' checklist tables have:
Sev / Tier column (High/Critical/S1=red, Medium/S2=amber, Low=green)Compliance exports' Questions & Gaps Register has:
All exports land in exports/ at the project root.
exports/
├── SA-payment-gateway.docx ← Executive Summary
├── ADR-001-api-gateway-choice.docx ← Individual ADR
├── ADR-002-database-selection.docx ← Individual ADR
├── HANDOFF-payment-api.docx
├── HANDOFF-user-service.docx
├── CC-sre-architecture-project.docx ← Compliance Contract (Questions & Gaps editable)
├── CC-cloud-architecture-project.docx
└── SECURITY-POSTURE-payment-gateway.docx ← Security Posture checklist (Status/Owner/Evidence editable)
If you see a Cannot find module 'docx' error from the sub-agent's report:
cd tools/docgen && bun install
Only needed once per plugin install.
docs/01-system-overview.md and docs/components/README.md created by /skill architecture-docs/skill architecture-definition-record/skill architecture-compliance (optional for Workflow A; required for Workflow C)/skill architecture-dev-handoff (required for Workflow B)/skill architecture-analysis (analysis 12) (required for Workflow D)Add to project .claude/settings.json:
"Bash(bun *)",
"Bash(mkdir *)",
"Bash(rm *)",
"Write(exports/*)",
"Read(exports/*)",
"Read(analysis/*)",
"Agent(sa-skills:docs-export-generator)"
Read(analysis/*) is used by Workflow D to read the Security Posture report before export.
Bash(rm *) is used by the sub-agent to clean up the temporary sa-executive-summary.md.
development
Run risk and design-characteristics analyses over ARCHITECTURE.md documentation. Produces date-stamped reports in analysis/ covering ten lenses across two groups: HIGH-priority runtime/security — SPOF (single points of failure), Blast Radius (downstream cascade impact), Bottleneck (throughput chokepoints), Cost Hotspots (Pareto cost concentration), STRIDE (per-trust-boundary security threats); Strategic/sustainability — Vendor Lock-in (portability risk and exit cost), Latency Budget (per-hop SLO decomposition), Tech Debt/EOL (currency and deprecated tech), Coupling (fan-in/fan-out and cycles), Data Sensitivity (PII flow and encryption gaps). Each analysis can be requested individually, as a group, or all ten run in parallel. A consolidated Security Posture option (analysis 12) merges the STRIDE and Data Sensitivity reports into a single reviewer-fillable validation checklist of every security control to validate (markdown-only; exportable to a Word worksheet via architecture-docs-export). Output: analysis/<TYPE>-<YYYY-MM-DD>.md (default) OR analysis/<TYPE>-<YYYY-MM-DD>.html (interactive d3.js report; format is selected at runtime — Step 2.4). Requires ARCHITECTURE.md to exist (created by architecture-docs skill). Do NOT invoke for compliance contracts (use architecture-compliance), peer quality review (use architecture-peer-review), or ADR management (use architecture-definition-record).
testing
Generate Compliance Contracts (Contratos de Adherencia) from ARCHITECTURE.md files
testing
Use this skill whenever the user mentions deferred work, known compromises, shortcuts taken, "we'll fix this later," temporary workarounds, missing controls, or any architectural trade-off that should be made visible and tracked. Also trigger when arc42 Section 11 (Risks and Technical Debt) is being authored or updated, when a TDR / Technical Debt Record is requested by name, or when an ADR documents a decision that intentionally accepts debt. Do NOT use for general bug reports, feature requests, or backlog items — TDRs are for architectural or systemic compromises, not ordinary defects.
development
Map a Product Owner Specification onto the organization's 8-domain BIAN v14 capability map (Enterprise Management, Resource Management, Finance & Risks, Operations, Products, Customers, Channels, Business Enabler — 47 capabilities total). Produces ENTERPRISE_ALIGNMENT.md identifying which corporate domains are impacted, which governance rules apply, and which owner counterparts to engage. Mandatory gate before architecture-docs Workflow 1 (new ARCHITECTURE.md creation). Bundled enterprise model is overridable via project-local ENTERPRISE_MODEL.md.