plugins/axiom-system-archaeologist/skills/using-system-archaeologist/SKILL.md
Use when analyzing existing codebases to generate architecture documentation - coordinates subagent-driven exploration with mandatory workspace structure, validation gates, and pressure-resistant workflows
npx skillsauth add tachyon-beep/skillpacks using-system-archaeologistInstall 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.
Analyze existing codebases through coordinated subagent exploration to produce comprehensive architecture documentation with C4 diagrams, subsystem catalogs, and architectural assessments.
Core principle: Systematic archaeological process with quality gates prevents rushed, incomplete analysis.
You are a COORDINATOR, not an analyst. Your primary context is precious - preserve it for orchestration decisions, not detailed code reading.
| Task Type | Your Role | Subagent Role |
|-----------|-----------|---------------|
| Subsystem analysis | Spawn codebase-explorer | Read files, produce catalog entries |
| Validation | Spawn analysis-validator | Check contracts, produce reports |
| Diagram generation | Spawn diagram subagent | Generate Mermaid/PlantUML |
| Quality assessment | Spawn quality subagent | Analyze patterns, produce assessment |
| Security surface | Spawn security subagent | Map boundaries, flag concerns |
| Thought | Reality | |---------|---------| | "I'll just quickly read this file" | Spawn subagent. Your context is for coordination. | | "It's faster if I do it myself" | Subagents preserve your context for later decisions. | | "Only a few files to check" | "Few" files become many. Delegate from the start. | | "I need to understand the code" | You need to understand the STRUCTURE. Subagents report findings. | | "Spawning overhead isn't worth it" | Context exhaustion is worse. Always delegate detailed work. |
IMPORTANT: All reference sheets are located in the SAME DIRECTORY as this SKILL.md file.
When this skill is loaded from:
skills/using-system-archaeologist/SKILL.md
Reference sheets like subsystem-discovery.md are at:
skills/using-system-archaeologist/subsystem-discovery.md
NOT at:
skills/subsystem-discovery.md ← WRONG PATH
Before any analysis:
mkdir -p docs/arch-analysis-$(date +%Y-%m-%d-%H%M)/temp
Why this is mandatory:
Common rationalization: "This feels like overhead when I'm pressured"
Reality: 10 seconds to create workspace saves hours of file hunting and context loss.
After workspace creation, present deliverable options using AskUserQuestion tool.
See deliverable-options.md for the complete menu (Options A-G).
Key options:
Common rationalization: "User didn't specify, so I'll default to full analysis"
Reality: Always offer choice explicitly. Different needs require different outputs.
After documenting deliverable choice, write 00-coordination.md:
## Analysis Plan
- Scope: [directories to analyze]
- Strategy: [Sequential/Parallel with reasoning]
- Time constraint: [if any, with scoping plan]
- Complexity estimate: [Low/Medium/High]
## Execution Log
- [timestamp] Created workspace
- [timestamp] [Next action]
Common rationalization: "I'll just do the work, documentation is overhead"
Reality: Undocumented work is unreviewable and non-reproducible.
Before diving into details, perform systematic scan:
Write findings to 01-discovery-findings.md
Common rationalization: "I can see the structure, no need to document it formally"
Reality: What's obvious to you now is forgotten in 30 minutes.
Decision point: Sequential vs Parallel vs Ultralarge per-module track
Use SEQUENTIAL when:
Use PARALLEL when:
Use ULTRALARGE PER-MODULE TRACK when ANY of:
The ultralarge track abandons single-pass orchestration and switches to manual subsystem partitioning + per-module review-with-scribe. Use the /analyze-ultralarge command, not /analyze-codebase. See:
Common rationalization: "Solo work is faster than coordination overhead"
Reality: For large systems, orchestration overhead (5 min) saves hours of sequential work. For ultralarge systems, single-pass orchestration produces a thin, sample-driven catalog that misses entire subsystems — the per-module track is non-negotiable at that scale.
When spawning subagents for analysis:
Create task specification in temp/task-[subagent-name].md:
## Task: Analyze [specific scope]
## Context
- Workspace: docs/arch-analysis-YYYY-MM-DD-HHMM/
- Read: 01-discovery-findings.md
- Write to: 02-subsystem-catalog.md (append your section)
## Expected Output
Follow contract in documentation-contracts.md:
- Subsystem name, location, responsibility
- Key components (3-5 files/classes)
- Dependencies (inbound/outbound)
- Patterns observed
- Confidence level
## Validation Criteria
- [ ] All contract sections complete
- [ ] Confidence level marked
- [ ] Dependencies bidirectional (if A depends on B, B shows A as inbound)
After EVERY major document is produced, validate before proceeding.
temp/validation-[document].mdSelf-validation ONLY permitted when ALL conditions met:
If ANY condition is not met → SPAWN VALIDATION SUBAGENT. No exceptions.
| Excuse | Reality | |--------|---------| | "We have 45 minutes, no time for validation" | Validation takes 5-10 minutes. Spawn validator. | | "I already reviewed it while writing" | Self-review ≠ validation. Spawn validator. | | "I'll do systematic self-validation" | Multiple subsystems require independent validator. Spawn validator. | | "Most work is already done" | Prior work must be validated. Spawn validator. | | "Time pressure - I'll document limitations instead" | Documented limitations don't excuse skipping validation. Spawn validator. | | "It's a simple codebase" | Simple ≠ correct. Spawn validator. |
When validator returns NEEDS_REVISION with CRITICAL issues:
DO NOT:
WRONG response: Skip workspace, skip validation, rush deliverables
RIGHT response: Scope appropriately while maintaining process
Example scoping for 3-hour deadline:
## Coordination Plan
- Time constraint: 3 hours until stakeholder presentation
- Strategy: SCOPED ANALYSIS with quality gates maintained
- Timeline:
- 0:00-0:05: Create workspace, write coordination plan
- 0:05-0:35: Holistic scan, identify all subsystems
- 0:35-2:05: Focus on 3 highest-value subsystems (parallel analysis)
- 2:05-2:35: Generate minimal viable diagrams (Context + Component only)
- 2:35-2:50: Validate outputs
- 2:50-3:00: Write executive summary with EXPLICIT limitations section
## Limitations Acknowledged
- Only 3/14 subsystems analyzed in depth
- No module-level dependency diagrams
- Confidence: Medium (time-constrained analysis)
- Recommend: Full analysis post-presentation
Key principle: Scoped analysis with documented limitations > complete analysis done wrong.
Common scenario: "We started this analysis last week, finish it."
Prior work is a hypothesis, not a foundation. Validate before continuing.
Checklist:
docs/arch-analysis-*/.00-coordination.md) - Understand what was done, what remains, and why work stopped.mv docs/arch-analysis-OLD docs/arch-analysis-OLD.archived-$(date +%Y-%m-%d)), start fresh, document why.DO NOT assume prior work is correct just because it exists. DO NOT silently continue without recording a decision.
Coordination log entry:
## Resume Decision - [timestamp]
- Detected existing workspace: docs/arch-analysis-2026-05-15-1430/
- Last completed step: 02-subsystem-catalog.md (validated APPROVED)
- Assessment: Catalog contract-compliant, 11/14 subsystems analyzed
- Decision: SALVAGE - keep catalog, redo diagrams (3 missing subsystems), continue from Step 7
- Reasoning: Validator approved catalog; diagrams were skipped at original session end
If user requests something genuinely impossible (e.g., "Complete 15-plugin analysis in 1 hour"):
Provide scoped alternatives:
A) Quick overview (1 hour): Holistic scan, plugin inventory, high-level diagram B) Focused deep-dive (1 hour): Pick 2-3 critical plugins, full analysis of those C) Use existing docs (15 min): Synthesize existing README.md, CLAUDE.md D) Reschedule (recommended): Full analysis takes 4-6 hours for this scale
DO NOT refuse entirely. Provide realistic scoped alternatives.
If you catch yourself thinking ANY of these, STOP:
| Excuse | Reality | |--------|---------| | "Time pressure makes trade-offs appropriate" | Process prevents rework. Skipping process costs MORE time. | | "This feels like overhead" | 5 minutes of structure saves hours of chaos. | | "Working solo is faster" | Solo works for small tasks. Orchestration scales for large systems. | | "I'll just write outputs directly" | Uncoordinated work creates inconsistent artifacts. | | "Validation slows me down" | Validation catches errors before they cascade. | | "I already checked it" | Self-review misses what fresh eyes catch. | | "I can't do this properly in [short time]" | You can do SCOPED analysis properly. Document limitations. | | "Rather than duplicate, I'll synthesize" | Existing docs ≠ systematic analysis. Do the work. | | "Meeting-ready outputs" justify shortcuts | Stakeholders deserve accurate info, not rushed guesses. |
For complex codebases, leverage specialist subagents from other skillpacks.
See specialist-integration.md for:
1. Create workspace (docs/arch-analysis-YYYY-MM-DD-HHMM/)
1.5. Offer deliverable menu (A/B/C/D/E/F/G) - user chooses scope
2. Write coordination plan (00-coordination.md) with deliverable choice
3. Holistic assessment → 01-discovery-findings.md
4. Decide: Sequential or Parallel? (document reasoning)
5. Spawn subagents for analysis → 02-subsystem-catalog.md
6. VALIDATE subsystem catalog (mandatory gate)
6.5. (Optional) Code quality assessment → 05-quality-assessment.md
6.6. (Optional) Security surface mapping → 07-security-surface.md
6.7. (Optional) Test infrastructure analysis → 09-test-infrastructure.md
6.8. (Optional) Dependency analysis → 10-dependency-analysis.md
7. Spawn diagram generation → 03-diagrams.md
8. VALIDATE diagrams (mandatory gate)
9. Synthesize final report → 04-final-report.md
10. VALIDATE final report (mandatory gate)
11. (Optional) Generate architect handover → 06-architect-handover.md
12. Provide cleanup recommendations for temp/
Every step is mandatory except optional steps (6.5-6.8, 11). No exceptions.
You have succeeded when:
You have failed when:
❌ Skip workspace creation "I'll just write files to project root"
❌ No coordination logging "I'll just do the work without documenting strategy"
❌ Work solo despite scale "Orchestration overhead isn't worth it"
❌ Skip validation subagent "I already reviewed it myself" / "I'll do systematic self-validation"
❌ Self-validate multi-subsystem work "Time constraints mean self-validation is acceptable" (NO - spawn validator)
❌ Bypass BLOCK status "The validation is too strict, I'll proceed anyway"
❌ Complete refusal under pressure "I can't do this properly in 3 hours, so I won't do it" (Should: Provide scoped alternative)
See individual skill files for detailed contracts:
01-discovery-findings.md contract → analyzing-unknown-codebases.md02-subsystem-catalog.md contract → analyzing-unknown-codebases.md03-diagrams.md contract → generating-architecture-diagrams.md04-final-report.md contract → documenting-system-architecture.md05-quality-assessment.md contract → assessing-code-quality.md06-architect-handover.md contract → creating-architect-handover.md07-security-surface.md contract → mapping-security-surface.md08-incremental-report.md contract → incremental-analysis.md09-test-infrastructure.md contract → analyzing-test-infrastructure.md10-dependency-analysis.md contract → analyzing-dependencies.mdtools
Use when designing, implementing, or auditing an MCP (Model Context Protocol) server — tool API design, idempotency under agent retry, structured error envelopes agents can recover from, schema versioning across model drift, transport reliability (stdio / HTTP), output-shape and pagination discipline, and choosing between tools / resources / prompts / sampling. Also use when an MCP server's tools confuse agents, return unstructured errors, deadlock under concurrent calls, double-execute under retry, or lose state across reconnects. Do not use for general REST/GraphQL API design (use `/web-backend`), for client-side prompt engineering or tool-loop design (use `/llm-specialist`), for general in-process plugin architecture (use `/system-architect`), or for cryptographic-provenance audit trails (use `/audit-pipelines`).
development
Use when running **SQLite or DuckDB inside an application process** as the durable store — not as a development convenience but as the production database. Use when scaling an SQLite layer that worked at low concurrency and is now hitting SQLITE_BUSY, WAL bloat, lock contention, schema-migration ceremony, or correctness gaps under multi-process writers. Use when introducing DuckDB as an OLAP complement to an OLTP SQLite store, or when picking between the two for a new component. Pairs with `/web-backend` (the API surface above the DB) and `/audit-pipelines` (when the DB is also the audit trail). Do not load for server databases (Postgres, MySQL), key-value stores, or ORM choice in isolation.
development
Use when designing or critiquing the structure of a staged procedure — a wizard, configuration flow, troubleshooting tree, training curriculum, multi-stage approval pipeline, decision pipeline, or any decomposition of expert work into composable stages. Use for both producer work (build the decomposition) and critic work (audit a proposed decomposition). Use when reasoning about capacity, bottlenecks, or soundness of a procedural flow. Do not use for implementation-plan critique of code changes (use `/axiom-planning` instead), for execution-time dynamics (use `/simulation-foundations`), or for rendering an already-designed procedure as docs or UI (use `/technical-writer` or `/ux-designer`).
testing
Use when the user wants to draft fiction or creative nonfiction prose, get craft critique on prose they have written, or plan story structure, outline, or premise. Workshop-voiced. Three explicit modes (draft, critique, plan) and the router will refuse to begin work without a declared mode.