Skip to content

Architecture Overview

Claude Commands Library is built on a modular, extensible architecture that combines several intelligent systems.

Core Components

┌─────────────────────────────────────────────────────────────────┐
│                     Claude Commands Library                      │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │   Commands   │  │   Library    │  │    Config    │          │
│  │  /prompt     │  │  Core + Adapt│  │   JSON files │          │
│  │  /prompt-*   │  │              │  │              │          │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘          │
│         │                 │                 │                   │
│         └────────────┬────┴─────────────────┘                   │
│                      ▼                                          │
│  ┌────────────────────────────────────────────────────┐        │
│  │              Phase 0: Prompt Perfection             │        │
│  │  Detection → Check → Clarify → Structure → Approve  │        │
│  └────────────────────────┬───────────────────────────┘        │
│                           │                                     │
│         ┌─────────────────┼─────────────────┐                  │
│         ▼                 ▼                 ▼                  │
│  ┌─────────────┐  ┌──────────────┐  ┌─────────────┐           │
│  │   Hybrid    │  │  Predictive  │  │   Multi-    │           │
│  │Intelligence │  │ Intelligence │  │   Agent     │           │
│  │  (agents)   │  │  (Phase 0.15)│  │  Research   │           │
│  └─────────────┘  └──────────────┘  └─────────────┘           │
│                                                                  │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐          │
│  │   Caching    │  │   Learning   │  │   Memory     │          │
│  │  Agent results│ │  Patterns    │  │  Sessions    │          │
│  └──────────────┘  └──────────────┘  └──────────────┘          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Directory Structure

.claude/
├── commands/           # Slash command definitions
│   ├── prompt.md
│   ├── prompt-hybrid.md
│   ├── prompt-technical.md
│   ├── prompt-research.md
│   └── ...

├── library/            # Reusable components
│   ├── prompt-perfection-core.md    # Phase 0 canonical
│   ├── adapters/                    # Domain extensions
│   │   ├── technical-adapter.md
│   │   ├── article-adapter.md
│   │   └── hybrid-adapter.md
│   └── intelligence/                # AI systems
│       ├── predictive-intelligence-core.md
│       ├── relationship-mapper.md
│       └── warning-system.md

├── config/             # Configuration files
│   ├── complexity-rules.json
│   ├── agent-templates.json
│   ├── cache-config.json
│   ├── learning-config.json
│   └── ai-fluency.json       # NEW v4.1

├── memory/             # Persistent data
│   ├── project-profile.md     # Structured fact store (v4.2)
│   ├── sessions.md
│   ├── prompt-patterns.md
│   └── observations.md

├── rules/              # Path-specific rules
│   ├── technical-patterns.md
│   └── command-conventions.md

└── cache/              # Cached results
    └── agent-results/

Key Concepts

1. AI Fluency Framework (NEW v4.1)

Aligned with Anthropic's 4Ds model for effective human-AI collaboration:

  • Delegation: Explicit human vs AI task distribution
  • Description: 9 criteria (Product, Process, Performance)
  • Discernment: Evaluation hints for AI outputs
  • Diligence: Track AI content requiring verification

Learn about AI Fluency →

2. Phase 0: The Foundation

Every command starts with Phase 0 - the prompt perfection process. This ensures clarity before execution.

Learn about Phase 0 →

3. Library System

Commands don't duplicate logic. They reference a shared library:

  • Core: Universal Phase 0 implementation
  • Adapters: Domain-specific extensions
  • Intelligence: AI enhancement systems

Explore the Library System →

4. Hybrid Intelligence

Automatic complexity detection determines when to use agents:

  • Simple tasks: Fast inline validation
  • Complex tasks: Spawn specialized agents
  • Research tasks: Multi-agent orchestration

Understand Hybrid Intelligence →

5. Predictive Intelligence

Phase 0.15 provides proactive guidance:

  • Journey stage detection
  • Domain risk analysis
  • Pattern recognition
  • Proactive warnings

Discover Predictive Intelligence →

6. Multi-Agent Research

Deep analysis using 2-5 specialized agents:

  • Parallel exploration
  • Iterative refinement
  • Gap-driven research

Learn about Multi-Agent Research →

Data Flow

User Input: "/prompt-technical Add authentication"


┌─────────────────────────────────────────┐
│         Command: prompt-technical        │
│                                          │
│  Import: library/prompt-perfection-core  │
│  Adapt:  library/adapters/technical      │
│  Config: config/complexity-rules.json    │
└──────────────────┬──────────────────────┘

┌─────────────────────────────────────────┐
│         Phase 0: Prompt Perfection       │
│                                          │
│  1. Detect language, type, intent       │
│  2. Recall facts from project profile   │
│  3. Check completeness (6 criteria)     │
│  4. Ask only unknown information        │
│  5. Structure perfected prompt          │
│  6. Wait for approval                   │
└──────────────────┬──────────────────────┘

┌─────────────────────────────────────────┐
│       Complexity-Based Routing           │
│                                          │
│  Score 0-4:  → Manual scan              │
│  Score 5-9:  → Ask user about agent     │
│  Score 10+:  → Spawn Explore Agent      │
│  Score 15+:  → Multi-agent verification │
└──────────────────┬──────────────────────┘

┌─────────────────────────────────────────┐
│         Agent Exploration (if needed)    │
│                                          │
│  - Scan project structure               │
│  - Detect patterns and conventions      │
│  - Find related implementations         │
│  - Cache results for 24 hours           │
└──────────────────┬──────────────────────┘

┌─────────────────────────────────────────┐
│         Implementation Analysis          │
│                                          │
│  - 2-3 implementation options           │
│  - Pros/cons comparison                 │
│  - Best practices checklist             │
│  - Code scaffolding                     │
└──────────────────┬──────────────────────┘

┌─────────────────────────────────────────┐
│         Learning System Update           │
│                                          │
│  - Record transformation                │
│  - Track user modifications             │
│  - Update pattern database              │
└─────────────────────────────────────────┘

Configuration System

All behavior is configuration-driven:

FilePurpose
complexity-rules.jsonTriggers and thresholds
agent-templates.jsonAgent prompts
cache-config.jsonCaching settings
learning-config.jsonPattern tracking
predictive-intelligence.jsonProactive guidance
ai-fluency.json4Ds framework settings (NEW v4.1)

See Configuration Reference →

Next Steps

Dive deeper into specific systems:

Released under the MIT License.