skills/architect/SKILL.md
Given a PRD, produces an implementation architecture: file tree, component breakdown, data model, and a phased build plan with end conditions that Archon can execute directly. Multi-candidate evaluation for key decisions.
npx skillsauth add SethGammon/Citadel architectInstall 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.
Don't use when: you already have an architecture and want to implement it (use /marshal or /archon); you need a PRD first (use /prd before /architect).
One of:
Greenfield mode: PRD exists with Mode: greenfield, or no existing source files.
Produces a complete architecture from scratch.
Feature mode: PRD exists with Mode: feature, OR the user describes a feature
and the project has existing source files. The architecture describes changes to
existing code, not a standalone system.
In feature mode:
If PRD exists, read it. Extract:
If no PRD, read the codebase instead:
For decisions with multiple valid approaches — state management, API structure, auth pattern, DB schema, routing — generate 2-3 candidates. Assess each on complexity, risk, maintainability, and LLM-friendliness. Pick the winner and document why. Reject alternatives with reasoning.
Simple decisions (file naming, folder structure, CSS) don't need this — use the PRD's stack choices and move on.
Write to .planning/architecture-{slug}.md:
# Architecture: {App Name}
> PRD: .planning/prd-{slug}.md | Date: {ISO date}
## File Tree
{Greenfield: complete file tree for v1, every file listed.
Feature mode: ONLY new (+) and modified (~) files.}
## Component Breakdown
### Feature: {name}
- Files: | Dependencies: | Complexity: {low/medium/high}
## Data Model
### {Entity name}
- Fields: {name: type} | Relationships: {connections}
{Omit section if no database.}
## Key Decisions
### {Decision}: {chosen approach}
- **Chosen**: {approach} — {reasoning}
- **Rejected**: {alternative} — {why not}
## Build Phases
### Phase N: {name}
- **Goal**: {one sentence}
- **Files**: | **Dependencies**: {or "none"}
- **End Conditions**: [ ] {machine-verifiable}
## Phase Dependency Graph
{Text format: Phase 1 → Phase 2 → Phase 3 / Phase 3 + 4 → Phase 5}
## Risk Register
1. {risk}: {mitigation}
2. {risk}: {mitigation}
3. {risk}: {mitigation}
## Deployment Strategy
{Skip if "deploy later" or static-only.}
- **Platform**: | **Method**: | **Environment variables**: | **Pre-deploy checks**:
{Final phase is "Deploy" when a platform is specified. A failed deploy does NOT fail the campaign.}
Each build phase becomes a campaign phase; end conditions carry over; the dependency graph determines ordering; parallel-safe phases flagged for Fleet.
Present summary to user (file count, phase count, key decisions, estimated complexity) and ask: "Ready to build? This will create an Archon campaign." If approved, write the campaign file.
---HANDOFF---
- Architecture: {app name}
- Document: .planning/architecture-{slug}.md
- Phases: {count}
- Estimated complexity: {low/medium/high}
- Next: Archon campaign ready to execute
- Reversibility: green — delete .planning/architecture-{slug}.md to undo
---
Disclosure: "Generating architecture plan for [description]. No files modified until you approve."
Reversibility: green — creates .planning/architecture-{slug}.md only; undo with rm .planning/architecture-{slug}.md.
Trust gates:
No PRD: Treat user description + existing codebase as the spec; read file tree and package.json; proceed without requiring a PRD.
Project already has code: Use feature mode; read existing architecture first; file tree shows only new/modified files; Phase 0 records baseline typecheck/test state.
Vague description: Ask at most 2 clarifying questions; don't block on perfect clarity.
.planning/ missing: Create it; if not possible, output the architecture inline and instruct the user to save it.
---HANDOFF---
- Architecture: {app name}
- Document: .planning/architecture-{slug}.md
- Phases: {count}
- Estimated complexity: {low/medium/high}
- Next: Archon campaign ready to execute
- Reversibility: green — delete .planning/architecture-{slug}.md to undo
---
tools
Bounded foreground repetition for the current session. Creates a loop contract, runs or coordinates an action plus verifier up to a declared attempt limit, and records evidence under .planning/loops/. Use for repeat-until-pass work that is too small for daemon and not time-based scheduling.
testing
Remove Citadel from a project. Exports valuable state (campaigns, postmortems, research, backlog, discoveries) to docs/citadel/ as human-readable markdown, then removes all harness files and hooks. The archive is detected by /do setup on re-install and offered for restore.
development
Research-driven multi-cycle improvement director. Forms causal hypotheses about why scores are low, validates them with scout agents before attacking, dispatches axis-parallel fleet attacks, extracts transferable patterns, and runs indefinitely within a budget envelope. Accumulates a persistent belief model and pattern library across sessions.
data-ai
Multi-repo campaign coordinator. Same lifecycle as fleet -- scope claims, discovery relay, wave-based execution -- but the unit of work is a repo, not a file. Coordinates campaigns across repositories with shared context.