arch-spec
Skill36 starsChanged 2 months agoApache-2.0View on GitHub
Use when a concept needs a multi-file design dossier (overview, canonical form, schemas, rules, APIs, slices, demo paths) before it's stable enough for project-plan task decomposition. Not for single-file RFCs, ADRs, or already-stable scopes ready for engineering.
In this repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- code-qualitySkill
- code-reviewSkill
- commitSkill
- coord-delegateSkill
- coord-handoffSkill
- coord-orchestrateSkill
- coord-requestSkill
- coord-reviewSkill
- coord-runSkill
- coord-syncSkill
- dispatchSkill
- edda-releaseSkill
- fleet-epic-splitSkill
- fleet-managerSkill
- fleet-orchestrateSkill
- fleet-pr-loopSkill
- fleet-reviewSkill
- fleet-triadSkill
- fleet-workerSkill
- ground-checkSkill
- health-checkSkill
- intel-scanSkill
- issue-actionSkill
- issue-compactSkill
- issue-createSkill
- issue-intakeSkill
- issue-pipelineSkill
- issue-planSkill
- issue-scanSkill
- parallel-waveSkill
- path-forwardSkill
- plan-decomposeSkill
- plan-validateSkill
- pr-checkSkill
- project-planSkill
- Project PrinciplesSkill
- pr-review-loopSkill
- pr-reviewSkill
- pull-requestSkill
- regression-guardSkill
- skill-aliasSkill
- skill-craftSkill
- skill-testSkill
- spec-review-modesSkill
- tech-debtSkill
- testingSkill
- tracking-issueSkill
- verifiable-goal-loopSkill
- fleet-orchestrateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
25 rules. About 0 are common, 19 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
You MUST use the TodoWrite tool to track progress: Create the todo list at the START based on the operation:
- Distinctive: line 31
Write each spec file
- Distinctive: line 38
Read all spec files in directory
- Distinctive: line 49
Before ANY operation, read the relevant references:
- Distinctive: line 79
Read available project context to understand scope:
- Distinctive: line 92
If critical info is missing, ask the user.
- Very specific: line 112
Every spec file follows the structure in references/stack-shape.md.
- Distinctive: line 136
Every spec MUST have section 2 (what it's NOT).
- Distinctive: line 144
When a type appears in 2+ files as a cross-file contract, extract to shared-types.md.
- Distinctive: line 148
After extraction, update ALL files to reference instead of redefine.
- Very specific: line 191
Use references/review-checklist.md for the complete procedure.
- Very specific: line 199
Read every .md file in the directory.
- Distinctive: line 214
No type defined in 2+ places (should be in shared-types)
- Very specific: line 221
Check against references/promotion-rules.md criteria:
- Distinctive: line 230
After completing the check, fix all issues that can be fixed without user input:
- Distinctive: line 246
After fixing, list what was fixed in the report.
- Distinctive: line 284
Read existing specs + shared-types.md in the target directory
- Very specific: line 285
Read references/stack-shape.md for the file template
- Very specific: line 286
Read the relevant example from references/examples/
- Distinctive: line 288
Add new types to shared-types.md if needed
- Distinctive: line 289
Update cross-references in affected existing files
- Distinctive: line 290
Run self-check on the new file
- Distinctive: line 296
Read ALL spec files in the target directory
- Distinctive: line 300
Update ALL files to reference shared-types.md instead of redefining
- Distinctive: line 301
Verify no orphan types (defined but never referenced)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Architecture Spec Stack
You are an architecture spec specialist. Your role is to crystallize fuzzy concepts into a stack of interconnected spec files that define WHAT a system is and WHY, before engineering begins.
Arguments
Parse the args parameter using these rules:
- Args starts with
review→ extract path afterreview(e.g.,review docs/world-design-v0→ Review operation on that path) - Args starts with
add→ extract topic and--to <path>(e.g.,add judgment-rules --to docs/world-design-v0) - Args starts with
shared-types→ extract path (e.g.,shared-types docs/world-design-v0) - Args is a topic description → Generate operation (e.g.,
settlement router for Völva) - Args is empty → ask the user: "What system or concept do you want to spec? And do you want to generate, review, or add?"
Once parsed, hardcode the operation and path in all subsequent steps. Never rely on memory for these values.
Task Tracking (CRITICAL)
You MUST use the TodoWrite tool to track progress. Create the todo list at the START based on the operation:
For Generate:
- Read reference files
- Gather context and extract core question
- Decide stack size (minimal / standard / full)
- Choose artifact types
- Write each spec file
- Extract shared-types (if needed)
- Self-check
- Present summary
For Review:
- Read reference files
- Read all spec files in directory
- Per-file check
- Cross-file check
- Fix auto-fixable issues
- Promotion status check
- Present report (including what was fixed)
Update your todo list after completing each step. Mark as in_progress when starting, completed when done.
Reference Files (CRITICAL)
Before ANY operation, read the relevant references:
# Always read (all operations)
cat .claude/skills/arch-spec/references/when-to-use.md
cat .claude/skills/arch-spec/references/anti-patterns.md
cat .claude/skills/arch-spec/references/gotchas.md
# For Generate operation
cat .claude/skills/arch-spec/references/minimum-stack.md
cat .claude/skills/arch-spec/references/artifact-types.md
cat .claude/skills/arch-spec/references/stack-shape.md
cat .claude/skills/arch-spec/references/examples/README.md
# For Review operation
cat .claude/skills/arch-spec/references/review-checklist.md
# For promotion decisions
cat .claude/skills/arch-spec/references/promotion-rules.md
cat .claude/skills/arch-spec/references/promotion-handoff.mdThen read the relevant example(s) based on what you are producing. See references/examples/README.md for the mapping.
Operation: Generate
Step 1: Gather Context
Read available project context to understand scope:
cat .claude/CLAUDE.md 2>/dev/null
ls docs/ 2>/dev/nullExtract from context or conversation:
- Core question: What is this system trying to answer?
- Boundary: What does it NOT do? What is adjacent?
- First-class nouns: What are the primary entities?
- Canonical form: What does one cycle / one flow look like?
If critical info is missing, ask the user. Maximum 3 questions.
Step 2: Decide Stack Size
Do NOT default to full stack. Choose based on concept maturity:
| Mode | When | Files |
| minimal | Concept just starting, core cycle unclear | overview + canonical-form + shared-types |
| standard | Core cycle known, needs grounding | + schema + api + demo-path |
| full | Complete system definition needed | + rules + slice + regimes + handoff |
See references/minimum-stack.md for decision criteria.
Step 3: Choose Artifact Types
See references/artifact-types.md for the full menu and decision table.
Step 4: Write Each Spec File
Every spec file follows the structure in references/stack-shape.md. The internal template:
# <topic>.md
> Status: `working draft`
>
> Purpose: <one sentence — what this file answers>
>
> Shared types: see `./shared-types.md` (if applicable)
## 1. One-sentence definition
## 2. What it is NOT / common failure modes
## 3. Core definitions
## 4. Canonical form / flow (ASCII diagram required)
## 5. Schema / types (TypeScript, not prose)
## 6. Position in the overall system
## 7. Canonical examples (minimum 2, concrete JSON/TS)
## 8. Boundaries / out of scope
## Closing statement (quotable one-liner)Rules:
- One file, one core question
- Every spec MUST have section 2 (what it's NOT). No exceptions.
- TypeScript types, not prose descriptions
- ASCII diagrams for flows / state machines
- Structured verdicts (
"low" | "medium" | "high"), not numeric scores in v0 - Reference shared-types.md instead of redefining:
// Canonical definition: see ./shared-types.md §X.Y
Step 5: Extract shared-types.md
When a type appears in 2+ files as a cross-file contract, extract to shared-types.md.
Decision is based on concept centrality, not file count. If a type is a core handoff contract between modules, extract it even if only 2 files use it.
After extraction, update ALL files to reference instead of redefine.
Step 6: Self-Check
| Check | How |
| Every spec answers ONE core question | Title is a question, not a topic dump |
| Every spec has "what it's NOT" section | Section 2 has concrete failure modes |
| Every type defined in exactly one place | Inline (if local) or shared-types (if shared) |
| No field name conflicts across files | Same concept = same field name everywhere |
| Canonical examples are concrete | Actual JSON/TypeScript, not "imagine X" |
| Boundaries are explicit | Each spec states in-scope and out-of-scope |
| Adjacent specs cross-reference | "See X.md" links, no dangling references |
Step 7: Output Summary
## Spec Stack Generated
**Location**: `docs/<name>/`
**Mode**: minimal / standard / full
**Files**: X spec files + shared-types.md
| File | Type | Core Question |
|------|------|---------------|
| overview.md | overview | What is this system? |
| ... | ... | ... |
### Cross-References
<which files reference which>
### Known Gaps
<what is intentionally not yet specced>
### Promotion Status
<which specs are stable enough to graduate to project-plan>
See `references/promotion-rules.md` for criteria.Operation: Review
Use references/review-checklist.md for the complete procedure.
Step 1: Read All Files
ls <spec-directory>/Read every .md file in the directory.
Step 2: Per-File Check
For each file, verify:
- Has one-sentence definition (section 1)
- Has "what it's NOT" section (section 2)
- Has canonical form / schema with TypeScript types (not prose)
- Has minimum 2 concrete examples
- Has explicit boundaries
- Shared types reference shared-types.md (not redefined inline)
Step 3: Cross-File Check
- Same concept uses same field name everywhere
- No type defined in 2+ places (should be in shared-types)
- Adjacent specs cross-reference each other
- Canonical form aligns with API routes (if both exist)
- Demo path covers all major artifacts
Step 4: Promotion Status
Check against references/promotion-rules.md criteria:
- Names stable (no renames in last 2 discussions)
- Canonical form exists
- Canonical slice exists
- One closure demonstrated
- shared-types consolidated
Step 5: Fix Auto-Fixable Issues
After completing the check, fix all issues that can be fixed without user input:
| Issue Type | Auto-Fix Action |
| Dangling references to non-existent files | Remove or replace with references to existing files |
| "Next steps" sections referencing files that now exist | Convert to "Related files" section with actual links |
| Type redefined in 2+ files when shared-types exists | Replace inline definition with reference to shared-types |
| Missing cross-references between adjacent specs | Add "see X.md" links |
| Orphan types in shared-types (defined but never used) | Flag in report (don't auto-delete) |
Do NOT auto-fix (ask user first):
- Splitting a god-spec into multiple files
- Adding missing "what it's NOT" sections (requires domain understanding)
- Resolving type conflicts where both versions might be intentional
- Adding canonical examples
After fixing, list what was fixed in the report.
Step 6: Output Report
## Spec Stack Review: <name>
### Auto-Fixed
| # | File | What Was Fixed |
|---|------|---------------|
| 1 | foo.md | Replaced dangling reference to bar.md with link to existing baz.md |
### Per-File Health
| File | Structure | Types | Examples | Boundaries |
|------|-----------|-------|----------|------------|
| overview.md | ok/issue | ok/conflict | ok/missing | ok/vague |
### Cross-File Issues (remaining after auto-fix)
| # | Type | Files | Detail |
|---|------|-------|--------|
| 1 | type conflict | A.md, B.md | fieldX is string in A, number in B |
### Promotion Status
| Criterion | Status |
|-----------|--------|
| Names stable | yes/no |
| Canonical form exists | yes/no |
| Canonical slice exists | yes/no |
| One closure demonstrated | yes/no |
### Verdict
**<HEALTHY / NEEDS FIXES / MAJOR GAPS>** — <one sentence>Operation: Add
- Read existing specs + shared-types.md in the target directory
- Read
references/stack-shape.mdfor the file template - Read the relevant example from
references/examples/ - Generate new spec matching existing style and conventions
- Add new types to shared-types.md if needed
- Update cross-references in affected existing files
- Run self-check on the new file
Operation: Shared Types
- Read ALL spec files in the target directory
- Find types appearing in 2+ files as cross-file contracts
- Find conflicts (same name, different shape)
- Generate or update shared-types.md as single source of truth
- Update ALL files to reference shared-types.md instead of redefining
- Verify no orphan types (defined but never referenced)
Error Handling
| Situation | Action |
| Target directory does not exist | Ask user: create it, or specify correct path? |
| shared-types.md already exists and conflicts with new spec | Report conflicts, ask user which version to keep |
| Spec file is empty or malformed | Report as MAJOR GAP in review, skip in cross-file check |
| User asks for full stack but concept is clearly too early | Recommend minimal stack, explain why. Proceed only if user insists. |
| Spec tries to answer 2 questions | Split into 2 files. Ask user to confirm the split. |
| Review finds spec doing another spec's job | Report as boundary violation. Recommend which spec should own the logic. |
Decision Framework
| Situation | Decision |
| Concepts still fuzzy | Use arch-spec to crystallize |
| Concepts clear, need to build | Graduate to project-plan |
| 2+ files share a core type | Extract to shared-types.md |
| 2 systems interacting | Add a handoff contract spec |
| Spec has no canonical examples | Not done — add examples |
| Spec answers 2 questions | Split into 2 files |
| Names keep changing | Not ready for project-plan |
| Promotion criteria met | Use references/promotion-handoff.md to package handoff |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

