Skip to content

Architecture Overview

Claude Commands Library is built on a shared Phase 0 foundation with two domain adapters and a multi-agent research system.

Structure

.claude/
├── skills/
│   ├── prompt/SKILL.md
│   ├── prompt-article-readme/SKILL.md
│   └── prompt-research/SKILL.md

├── library/
│   ├── prompt-perfection-core.md    # Phase 0 canonical
│   ├── readme-adapter.md            # /prompt-article-readme
│   ├── research-adapter.md          # /prompt-research (Phase 0 only)
│   ├── caching-strategy.md
│   ├── model-router.md
│   └── execution-plan-template.md

├── agents/                          # Real Anthropic subagents (v5.2+)
│   ├── research-explore.md
│   ├── research-pattern.md
│   ├── research-security.md
│   ├── research-performance.md
│   └── research-citation.md

├── config/
│   ├── agent-templates.json
│   ├── orchestration-config.json
│   ├── iteration-rules.json
│   ├── citation-config.json
│   ├── external-memory-config.json
│   ├── complexity-rules.json
│   └── model-tiers.json

├── memory/
│   ├── project-profile.md
│   ├── sessions.md
│   ├── prompt-patterns.md
│   └── project-knowledge.md

└── rules/
    ├── command-conventions.md
    ├── library-standards.md
    └── config-validation.md

Key Concepts

1. Phase 0: The Foundation

Every command begins with Phase 0 — a shared validation layer imported from prompt-perfection-core.md. It detects intent, recalls known facts from project memory, checks completeness, asks only genuinely unknown questions, structures the result, and waits for approval.

Learn about Phase 0 →

2. Domain Adapters

/prompt-article-readme and /prompt-research extend Phase 0 with domain-specific logic via adapters:

  • readme-adapter.md — project scan, stack detection, README style levels
  • research-adapter.md — iteration strategy, gap detection, report format

3. Multi-Agent Research

/prompt-research runs 2-4 iteration cycles using up to 5 real Anthropic subagents (defined in .claude/agents/research-*.md) invoked in parallel via the Task tool: Explore, Pattern, Security, Performance, Citation. Each iteration resolves gaps from the previous one. Orchestration runs in the main thread because subagents cannot spawn other subagents (Anthropic limit).

Learn about Multi-Agent Research →

4. Library System

Commands reference shared library files instead of duplicating logic. Changes to prompt-perfection-core.md affect all three commands.

Explore the Library System →

5. Skills Format

All three commands use native Claude Code Skills format with YAML frontmatter. Claude auto-suggests the right skill based on the description field.

Skills Format →

6. AI Fluency Framework

Phase 0 is aligned with Anthropic's 4Ds model: Delegation, Description, Discernment, Diligence.

AI Fluency Framework →

Data Flow

User: /prompt-research Understand the auth system


┌─────────────────────────────────┐
│  research-adapter.md            │
│  Load: prompt-perfection-core   │
│  Extend: research strategy      │
└──────────────┬──────────────────┘

┌─────────────────────────────────┐
│  Phase 0: Prompt Perfection     │
│  Recall → Check → Ask → Approve │
└──────────────┬──────────────────┘

┌─────────────────────────────────┐
│  Orchestrator (in SKILL.md)     │
│  Spawn 2-5 agents in parallel   │
└──────────────┬──────────────────┘

┌─────────────────────────────────┐
│  Iteration 1-4                  │
│  Aggregate → Detect gaps        │
│  → Next iteration or converge   │
└──────────────┬──────────────────┘

       Consolidated report
       with file:line citations

Configuration

All behaviour is configuration-driven. See Configuration Reference →

Next Steps

Released under the MIT License.