Install
$ agentstack add skill-shadowx4fox-solutions-architect-skills-architecture-explorer-headers ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
About
Architecture Explorer Headers — Backfill Skill
When This Skill Is Invoked
Manually activated when users want to add or refresh `` blocks across architecture docs. This is a maintenance workflow, not part of the normal authoring loop. Use it:
- After upgrading to v3.14.0+ on a project whose docs were authored under earlier versions.
- When the
architecture-exploreragent is routing files toirrelevant_files[]despite the file being clearly relevant — usually a missing or stale header. - After a major refactor that renamed components or added technologies, where existing headers have drifted.
NOT activated for:
- Routine architecture authoring (use
architecture-docs). - Component file creation or update —
architecture-component-guardianis the first-class writer of EXPLORER_HEADER blocks fordocs/components/**/*.md(L1 descriptors and L2 containers) at create/update/migrate time. This backfill skill must NOT be used to fill gaps left by the guardian; reach for it only on legacydocs/NN-*.mdfiles or to repair drift caused by external edits. - ADR creation (use
architecture-definition-record).
ARCHITECTURE.md at the project root is never touched by this skill — it is a navigation index and the explorer reads it in full.
Activation Forms
/skill architecture-explorer-headers— interactive: scan, present plan, ask before writing./regenerate-explorer-headers— slash-command alias./regenerate-explorer-headers --force— overwrite existing headers (default behaviour skips files that already have one)./regenerate-explorer-headers --dry-run— list what would change, write nothing./regenerate-explorer-headers— restrict to a subset (e.g.docs/components/payment-service/**).
Workflow
Phase 0 — Resolve Plugin and Project Roots
- Resolve
plugin_dir:Globfor**/skills/architecture-explorer-headers/SKILL.mdand strip the suffix; or read.claude/settings.jsonforextraKnownMarketplaces. Same approach asarchitecture-compliance. - Confirm
project_root: the current working directory. VerifyARCHITECTURE.mdexists at the root — if not, abort withARCHITECTURE.md not found at project root. This skill operates on architecture documentation.
Phase 1 — Inventory
bun [plugin_dir]/skills/architecture-explorer-headers/utils/header-cli.ts list
The CLI emits a JSON array, one entry per candidate file:
[
{ "path": "docs/01-system-overview.md", "has_header": false, "h1": "System Overview", "byte_size": 14820 },
{ "path": "docs/08-scalability-and-performance.md", "has_header": true, "h1": "Scalability & Performance", "byte_size": 18234 },
{ "path": "docs/components/payment-service.md", "has_header": false, "h1": "Payment Service", "byte_size": 9120 }
]
Parse it. Bucket files into:
- needs_header —
has_header === falseand the path is in scope (matches the `` argument if provided). - alreadyhasheader —
has_header === true. With--force, treat these as needs_header too. Without--force, skip. - skipped — outside scope, or
ARCHITECTURE.md(excluded by the CLI).
If the inventory is empty, report No docs need explorer headers. and exit.
Phase 2 — Present Plan
Show the user a one-screen plan:
Architecture Explorer Headers — Backfill Plan
Project:
Scope:
Mode:
Files to update (N):
- docs/01-system-overview.md (no header)
- docs/03-architecture-layers.md (no header)
- docs/components/payment-service.md (no header)
...
Files skipped (M):
- docs/08-scalability-and-performance.md (already has header — pass --force to overwrite)
- ARCHITECTURE.md (project root index — exempt by design)
Proceed? (yes / no / edit-scope)
Wait for confirmation. On --dry-run skip the prompt and end after this report.
Phase 3 — Generate and Insert Headers
For each file in needs_header:
Step 3.1 — Read the full file. You need the body to extract accurate metadata; do NOT cap reads here. (This skill is the inverse of the explorer — you are creating the metadata the explorer will later sample.)
Step 3.2 — Extract metadata. Build the EXPLORER_HEADER content from the file's actual content:
key_concepts— 5–15 domain terms that recur in the doc. Pull from H2/H3 headings, bold terms, table headers, and frequently-occurring capitalized phrases. Avoid generic words ("system", "approach", "data"); favor specific ones ("SLO", "MTTR", "idempotency", "circuit breaker"). Downstream skills (compliance, analysis, dev-handoff) filter the explorer's manifest by these terms when deciding which files to read — concrete, domain-specific vocabulary surfaces relevant docs; generic vocabulary surfaces nothing.technologies— concrete tools/products named in the doc (Prometheus, AWS, PostgreSQL 16, Spring Boot 3.3, etc.). Skip generic terms ("database", "API"). Preserve version numbers.components— kebab-case component names referenced in the doc. Matchdocs/components/-.mdfilenames. For component files themselves, usecomponent_self:instead.scope— one short sentence (≤120 chars) describing what the doc covers and what it does NOT. Read the doc's intro paragraph to source this.related_adrs— ADR identifiers (ADR-NNN) referenced in the doc body or footer.component_self(component files only) — the component's kebab-case slug, derived from filename.component_type(component files only) — extract from**Type:**field in the file. If absent, omit the field.
Step 3.3 — Compose the 30-second summary blockquote. One paragraph (≤300 chars) that complements the machine-readable header. Read for a reader who has 30 seconds to decide whether to read the full doc.
Step 3.4 — Insert via Edit.
Find the H1 line (^# ) in the file. The insertion goes immediately after the H1 and the blank line that should follow it.
#
>
Use the Edit tool (not Write) so you preserve the rest of the file byte-for-byte.
Step 3.5 — Validate.
bun [plugin_dir]/skills/architecture-explorer-headers/utils/header-cli.ts validate
Exit code 0 = header parses cleanly and includes all required fields. Exit code 1 = malformed; revert the Edit, log the error, continue with the next file.
Phase 4 — Report
Print a summary table:
Architecture Explorer Headers — Backfill Complete
Updated: N files
Skipped: M files (already had headers; pass --force to overwrite)
Failed: K files (malformed header — Edit reverted)
Updated files:
✅ docs/01-system-overview.md
✅ docs/03-architecture-layers.md
✅ docs/components/payment-service.md
...
Failed files:
❌ docs/components/legacy-thing.md — header validation: missing 'scope' field
Suggest a follow-up: Want me to /schedule an agent to re-run this monthly? Stale headers degrade explorer accuracy over time.
Anti-Patterns
- Don't generate headers from imagination. Every field MUST come from the file's actual content. If a technology isn't named in the doc, don't list it. The explorer's classification is only as accurate as the header's truthfulness.
- Don't touch
ARCHITECTURE.md. It's a navigation index, exempt by design. The CLI'slistsubcommand excludes it. - Don't run with
--forceon a freshly-tuned project. Operators may have hand-curated headers;--forcewipes that work. Default mode (skip-existing) is safe. - Don't skip the validation step. A malformed header (missing field, broken comment fence) is worse than no header — it actively misleads the parser. Always run
header-cli.ts validateand revert on failure. - Don't widen the scope past
docs/anddocs/components/. Headers are not for ADRs (ADRs have their own structure that the explorer reads natively) or forarchive/v*/snapshots (those are immutable).
Permissions
This skill needs the same Read, Edit, and Bash([plugin_dir]/skills/architecture-explorer-headers/utils/header-cli.ts list/validate) permissions as architecture-docs. The pre-configured .claude/settings.json.example already covers them.
Skill Version: 1.2.0 (v3.19.1 — drops --session mode + session editlog integration; the underlying PostToolUse hook had been silently broken since v3.14.1) Specialization: Backfill EXPLORER_HEADER blocks into legacy architecture docs
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: shadowX4fox
- Source: shadowX4fox/solutions-architect-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.