# automazeio/ccpm architecture

> Architecture diagram of the GitHub repository automazeio/ccpm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/automazeio/ccpm
- Repository: https://github.com/automazeio/ccpm

## Overview

##### Project type and purpose
- This is an open-source command-line tool (“Claude Code PM”) for spec-driven project management.
- It provides a Claude-powered workflow that turns PRDs into epics, epics into GitHub issues, and issues into code via parallel AI agents.

##### File structure
- Top-level directory: `.claude/` holds all the tool’s configuration and logic.
- `agents/` – definitions of AI agents (code-analyzer, file-analyzer, etc.)
- `commands/` – markdown definitions of CLI commands (pm, context, testing)
- `scripts/` – shell scripts invoked by commands
- `context/`, `prds/`, `epics/`, `rules/` – data folders that the tool reads and writes
- Supporting files: `AGENTS.md`, `COMMANDS.md`, `README.md`, `LICENSE`
- Uses Git (`.gitignore`), GitHub CLI (gh), and a gh-sub-issue extension for issue hierarchies.

##### README for additional insights
- The “System Architecture” section already outlines a logical separation:
- CLAUDE.md (always-on instructions)
- agents, commands, context, epics, prds, rules, scripts
- External integrations: GitHub Issues API, Git worktrees, Claude (Anthropic) API.
- Core patterns: command-pattern CLI, plugin-style modules (commands, agents), parallel agent orchestration.

##### Diagramming recommendations
- Use clear labels for each component (e.g., “CLI Orchestrator,” “Agent Manager,” “Commands,” “Scripts,” “Context Store,” “GitHub API,” “Claude API”)
- User → CLI
- CLI ↔ Local FS
- CLI → Agent Manager → AI API → Agent Manager → Local FS/Git
- CLI → GitHub API
- Blue for external services (GitHub, Claude)
- Orange for Git integration

##### Essential architectural elements—don't omit
- Plugin boundaries (commands vs agents vs scripts vs rules)
- Parallel worker pattern (multiple agents in isolated worktrees)
- Two-way sync with GitHub (issues/comments)
- AI service calls abstracted through Agent Manager

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Engine
    CLI["CLI Orchestrator"]:::core

    %% Plugin Modules
    subgraph "Plugin Modules"
        Commands["Commands"]:::plugin
        Agents["AI Agent Manager"]:::plugin
        Scripts["Scripts"]:::plugin
        Rules["Rules & Policies"]:::plugin
    end

    %% Local File-store
    subgraph "Local File-store" 
        Context["Context Store"]:::storage
        PRD["PRD Store"]:::storage
        Epic["Epic Store"]:::storage
    end

    %% Git Integration
    subgraph "Git Integration"
        Worktree["Worktree Operations"]:::git
        Branch["Branch & Commit"]:::git
    end

    %% GitHub Integration
    subgraph "GitHub Integration"
        GHRules["GitHub Ops Rules"]:::external
        IssueSync["Issue Sync Cmd"]:::external
        EpicSync["Epic Sync Cmd"]:::external
        ImportCmd["Import Cmd"]:::external
    end

    %% External Services
    subgraph "External Services"
        GitHub["GitHub API"]:::external
        Claude["Claude AI API"]:::external
    end

    %% User Interaction
    User["User"]:::user
    User -->|invokes| CLI

    %% Core to Plugins
    CLI -->|loads| Commands
    CLI -->|spawns| Agents
    CLI -->|runs| Scripts
    CLI -->|applies| Rules

    %% Core to File-store
    CLI <-->|reads/writes| Context
    CLI <-->|reads/writes| PRD
    CLI <-->|reads/writes| Epic

    %% Agents orchestration
    Agents -->|isolated worktrees| Worktree
    Agents -->|commits| Branch
    Agents -->|calls| Claude
    Agents -->|reads/writes| Context

    %% Core Git Integration
    CLI -->|uses| Worktree
    CLI -->|uses| Branch

    %% GitHub Integration
    CLI -->|triggers| IssueSync
    CLI -->|triggers| EpicSync
    CLI -->|triggers| ImportCmd
    IssueSync -->|rules| GHRules
    EpicSync -->|rules| GHRules
    ImportCmd -->|rules| GHRules
    IssueSync -->|API calls| GitHub
    EpicSync -->|API calls| GitHub
    ImportCmd -->|API calls| GitHub

    %% Agents write back to File-store
    Agents -->|writes| PRD
    Agents -->|writes| Epic

    %% Styles
    classDef core fill:#c3f7b2,stroke:#2e7d32,color:#2e7d32;
    classDef plugin fill:#e8f5e9,stroke:#388e3c,color:#388e3c;
    classDef storage fill:#f5f5f5,stroke:#9e9e9e,color:#616161;
    classDef git fill:#fff3e0,stroke:#ef6c00,color:#e65100;
    classDef external fill:#e3f2fd,stroke:#1565c0,color:#1565c0;
    classDef user fill:#ffebee,stroke:#c62828,color:#c62828;

    %% Click Events
    click CLI "https://github.com/automazeio/ccpm/tree/main/.claude/commands/"
    click Scripts "https://github.com/automazeio/ccpm/tree/main/.claude/scripts/pm/"
    click Agents "https://github.com/automazeio/ccpm/tree/main/.claude/agents/"
    click Context "https://github.com/automazeio/ccpm/tree/main/.claude/context/"
    click PRD "https://github.com/automazeio/ccpm/tree/main/.claude/prds/"
    click Epic "https://github.com/automazeio/ccpm/tree/main/.claude/epics/"
    click Rules "https://github.com/automazeio/ccpm/tree/main/.claude/rules/"
    click Worktree "https://github.com/automazeio/ccpm/blob/main/.claude/rules/worktree-operations.md"
    click Branch "https://github.com/automazeio/ccpm/blob/main/.claude/scripts/test-and-log.sh"
    click GHRules "https://github.com/automazeio/ccpm/blob/main/.claude/rules/github-operations.md"
    click IssueSync "https://github.com/automazeio/ccpm/blob/main/.claude/commands/pm/issue-sync.md"
    click EpicSync "https://github.com/automazeio/ccpm/blob/main/.claude/commands/pm/epic-sync.md"
    click ImportCmd "https://github.com/automazeio/ccpm/blob/main/.claude/commands/pm/import.md"
    click Claude "https://github.com/automazeio/ccpm/blob/main/.claude/CLAUDE.md"
```
