[
  {
    "path": ".gitignore",
    "content": "skill/ccpm-workspace/\nskill/ccpm/evals/\nccpm-talk/\nCCPM_CLI_REWRITE_PRD.md\nccpm-cli-prd.md\nvideo\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# CCPM Changelog\n\n## [2025-01-24] - Major Cleanup & Issue Resolution Release\n\n### 🎯 Overview\nResolved 10 of 12 open GitHub issues, modernized command syntax, improved documentation, and enhanced system accuracy. This release focuses on stability, usability, and addressing community feedback.\n\n### ✨ Added\n- **Local Mode Support** ([#201](https://github.com/automazeio/ccpm/issues/201))\n  - Created `LOCAL_MODE.md` with comprehensive offline workflow guide\n  - All core commands (prd-new, prd-parse, epic-decompose) work without GitHub\n  - Clear distinction between local-only vs GitHub-dependent commands\n\n- **Automatic GitHub Label Creation** ([#544](https://github.com/automazeio/ccpm/issues/544))\n  - Enhanced `init.sh` to automatically create `epic` and `task` labels\n  - Proper colors: `epic` (green #0E8A16), `task` (blue #1D76DB)  \n  - Eliminates manual label setup during project initialization\n\n- **Context Creation Accuracy Safeguards** ([#48](https://github.com/automazeio/ccpm/issues/48))\n  - Added mandatory self-verification checkpoints in context commands\n  - Implemented evidence-based analysis requirements\n  - Added uncertainty flagging with `⚠️ Assumption - requires verification`\n  - Enhanced both `/context:create` and `/context:update` with accuracy validation\n\n### 🔄 Changed\n- **Modernized Command Syntax** ([#531](https://github.com/automazeio/ccpm/issues/531))\n  - Updated 14 PM command files to use concise `!bash` execution pattern\n  - Simplified `allowed-tools` frontmatter declarations\n  - Reduced token usage and improved Claude Code compatibility\n\n- **Comprehensive README Overhaul** ([#323](https://github.com/automazeio/ccpm/issues/323))\n  - Clarified PRD vs Epic terminology and definitions\n  - Streamlined workflow explanations and removed redundant sections\n  - Fixed installation instructions and troubleshooting guidance\n  - Improved overall structure and navigation\n\n### 📋 Research & Community Engagement\n- **Multi-Tracker Support Analysis** ([#200](https://github.com/automazeio/ccpm/issues/200))\n  - Researched CLI availability for Linear, Trello, Azure DevOps, Jira\n  - Identified Linear as best first alternative to GitHub Issues\n  - Provided detailed implementation roadmap for future development\n\n- **GitLab Support Research** ([#588](https://github.com/automazeio/ccpm/issues/588))  \n  - Confirmed strong `glab` CLI support for GitLab integration\n  - Invited community contributor to submit existing GitLab implementation as PR\n  - Updated project roadmap to include GitLab as priority platform\n\n### 🐛 Clarified Platform Limitations\n- **Windows Shell Compatibility** ([#609](https://github.com/automazeio/ccpm/issues/609))\n  - Documented as Claude Code platform limitation (requires POSIX shell)\n  - Provided workarounds and alternative solutions\n\n- **Codex CLI Integration** ([#585](https://github.com/automazeio/ccpm/issues/585))\n  - Explained future multi-AI provider support in new CLI architecture\n\n- **Parallel Worker Agent Behavior** ([#530](https://github.com/automazeio/ccpm/issues/530))\n  - Clarified agent role as coordinator, not direct coder\n  - Provided implementation guidance and workarounds\n\n### 🔒 Security\n- **Privacy Documentation Fix** ([#630](https://github.com/automazeio/ccpm/issues/630))\n  - Verified resolution via PR #631 (remove real repository references)\n\n### 💡 Proposed Features\n- **Bug Handling Workflow** ([#654](https://github.com/automazeio/ccpm/issues/654))\n  - Designed `/pm:attach-bug` command for automated bug tracking\n  - Proposed lightweight sub-issue integration with existing infrastructure\n  - Community feedback requested on implementation approach\n\n### 📊 Issues Resolved\n**Closed**: 10 issues  \n**Active Proposals**: 1 issue (#654)  \n**Remaining Open**: 1 issue (#653)\n\n#### Closed Issues:\n- [#630](https://github.com/automazeio/ccpm/issues/630) - Privacy: Remove real repo references ✅  \n- [#609](https://github.com/automazeio/ccpm/issues/609) - Windows shell error (platform limitation) ✅\n- [#585](https://github.com/automazeio/ccpm/issues/585) - Codex CLI compatibility (architecture update) ✅  \n- [#571](https://github.com/automazeio/ccpm/issues/571) - Figma MCP support (platform feature) ✅\n- [#531](https://github.com/automazeio/ccpm/issues/531) - Use !bash in custom slash commands ✅\n- [#323](https://github.com/automazeio/ccpm/issues/323) - Improve README.md ✅\n- [#201](https://github.com/automazeio/ccpm/issues/201) - Local-only mode support ✅\n- [#200](https://github.com/automazeio/ccpm/issues/200) - Multi-tracker support research ✅  \n- [#588](https://github.com/automazeio/ccpm/issues/588) - GitLab support research ✅\n- [#48](https://github.com/automazeio/ccpm/issues/48) - Context creation inaccuracies ✅\n- [#530](https://github.com/automazeio/ccpm/issues/530) - Parallel worker coding operations ✅\n- [#544](https://github.com/automazeio/ccpm/issues/544) - Auto-create labels during init ✅\n- [#947](https://github.com/automazeio/ccpm/issues/947) - Project roadmap update ✅\n\n### 🛠️ Technical Details\n- **Files Modified**: 16 core files + documentation\n- **New Files**: `LOCAL_MODE.md`, `CONTEXT_ACCURACY.md`  \n- **Commands Updated**: All 14 PM slash commands modernized\n- **Backward Compatibility**: Fully maintained\n- **Dependencies**: No new external dependencies added\n\n### 🏗️ Project Health\n- **Issue Resolution Rate**: 83% (10/12 issues closed)\n- **Documentation Coverage**: Significantly improved\n- **Community Engagement**: Active contributor invitation and feedback solicitation\n- **Code Quality**: Enhanced accuracy safeguards and validation\n\n### 🚀 Next Steps\n1. Community feedback on bug handling proposal (#654)\n2. GitLab integration PR review and merge\n3. Linear platform integration (pending demand)\n4. Enhanced testing and validation workflows\n\n---\n\n*This release represents a major stability and usability milestone for CCPM, addressing the majority of outstanding community issues while establishing a foundation for future multi-platform support.*"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2025 Ran Aroussi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# CCPM – The Project Manager Agent\n\n[![Agent Skills](https://img.shields.io/badge/Agent_Skills-compatible-4b3baf)](https://agentskills.io)\n&nbsp;\n[![Eval Score](https://img.shields.io/badge/eval_score-100%25-brightgreen)](#proven-results)\n&nbsp;\n[![GitHub Issues](https://img.shields.io/badge/+-GitHub%20Issues-1f2328)](https://github.com/automazeio/ccpm)\n&nbsp;\n[![MIT License](https://img.shields.io/badge/License-MIT-28a745)](LICENSE)\n&nbsp;\n[![Follow on 𝕏](https://img.shields.io/badge/𝕏-@aroussi-1c9bf0)](http://x.com/intent/follow?screen_name=aroussi)\n&nbsp;\n[![Star this repo](https://img.shields.io/github/stars/automazeio/ccpm.svg?style=social&label=Star%20this%20repo&maxAge=60)](https://github.com/automazeio/ccpm)\n\n### Spec-driven development for AI agents – ship ~~faster~~ _better_ using PRDs, GitHub issues, and multiple agents running in parallel.\n\nStop losing context. Stop blocking on tasks. Stop shipping bugs. CCPM gives your AI agent a structured PM brain: turn ideas into PRDs, PRDs into epics, epics into GitHub issues, and issues into production code — with full traceability at every step.\n\n---\n\n> [!IMPORTANT]\n> 📢 **CCPM is now an AGENT SKILL!** It works with any [Agent Skills–compatible](https://agentskills.io) harness that supports skills: **Claude Code, Codex, OpenCode, Factory, Amp, Cursor, and more.**\n\n---\n\n![CCPM](screenshot.webp)\n\n## Table of Contents\n\n- [Background](#background)\n- [The Workflow](#the-workflow)\n- [What Makes This Different](#what-makes-this-different)\n- [Why GitHub Issues](#why-github-issues)\n- [Core Principle: No Vibe Coding](#core-principle-no-vibe-coding)\n- [The Parallel Execution System](#the-parallel-execution-system)\n- [Key Features & Benefits](#key-features--benefits)\n- [Install](#install)\n- [Usage](#usage)\n- [Workflow Phases](#workflow-phases)\n- [Skill Structure](#skill-structure)\n- [Example Flow](#example-flow)\n- [Proven Results](#proven-results)\n- [Local vs Remote](#local-vs-remote)\n- [Technical Notes](#technical-notes)\n- [Who's Behind this Project](#whos-behind-this-project)\n\n---\n\n> [!NOTE]\n> Check out **[proof](https://github.com/automazeio/proof)** to get your agents capture visual proof of work of terminal output, browser interactions, and mobile simulator recordings.\n\n---\n\n## Background\n\nEvery team struggles with the same problems:\n- **Context evaporates** between sessions, forcing constant re-discovery\n- **Parallel work creates conflicts** when multiple agents touch the same code\n- **Requirements drift** as verbal decisions override written specs\n- **Progress becomes invisible** until the very end\n\nCCPM solves all of that.\n\n---\n\n## The Workflow\n\n```mermaid\ngraph LR\n    A[PRD Creation] --> B[Epic Planning]\n    B --> C[Task Decomposition]\n    C --> D[GitHub Sync]\n    D --> E[Parallel Execution]\n```\n\n### See It In Action\n\n```\n\"I want to build a notification system — where do we start?\"\n→ Guided brainstorming + PRD creation\n\n\"break down the notification-system epic\"\n→ Parallelizable task files with dependencies\n\n\"sync the notification-system epic to GitHub\"\n→ Epic issue + sub-issues + worktree\n\n\"start working on issue 42\"\n→ Parallel stream analysis + multiple agents launched\n\n\"what's our standup for today?\"\n→ Instant report from project files\n```\n\n---\n\n## What Makes This Different\n\n| Traditional AI Development | CCPM |\n|---|---|\n| Context lost between sessions | **Persistent context** across all work |\n| One agent, one task | **Parallel agents** on independent streams |\n| Vibe coding from memory | **Spec-driven** with full traceability |\n| Progress hidden in chat logs | **Transparent audit trail** in GitHub |\n| Scattered status updates | **Structured standup, blocked, next** |\n\n---\n\n## Why GitHub Issues\n\nMost AI coding workflows operate in isolation — a single session with no shared state. CCPM uses GitHub Issues as the source of truth, which unlocks something fundamentally different:\n\n**Team collaboration** — multiple agents (or humans) work on the same project simultaneously. Progress is visible in real-time through issue comments.\n\n**Seamless handoffs** — an agent can start a task, a human can finish it, or vice versa. No \"what did the AI do?\" meetings.\n\n**Single source of truth** — no separate databases or project management tools. Issue state is project state. Comments are the audit trail.\n\n**Works with what you have** — no dependency on GitHub Projects. Integrates with existing labels, milestones, and PR workflows.\n\n---\n\n## Core Principle: No Vibe Coding\n\n> **Every line of code must trace back to a specification.**\n\nCCPM enforces a strict 5-phase discipline:\n\n1. **🧠 Brainstorm** — think deeper than comfortable\n2. **📝 Document** — write specs that leave nothing to interpretation\n3. **📐 Plan** — architect with explicit technical decisions\n4. **⚡ Execute** — build exactly what was specified\n5. **📊 Track** — maintain transparent progress at every step\n\nNo shortcuts. No assumptions. No regrets.\n\n---\n\n## The Parallel Execution System\n\n### Issues Aren't Atomic\n\nTraditional thinking: **one issue = one agent = one task**\n\nReality: a single \"Implement user authentication\" issue is actually:\n\n- **Agent 1**: Database tables and migrations\n- **Agent 2**: Service layer and business logic\n- **Agent 3**: API endpoints and middleware\n- **Agent 4**: UI components and forms\n- **Agent 5**: Test suites and documentation\n\nAll running **simultaneously** in the same worktree.\n\n### The Math of Velocity\n\n| Approach | Agents working | Wall time |\n|---|---|---|\n| Traditional (serial) | 1 | 5x |\n| CCPM (parallel streams) | 5 | 1x |\n\n### Context Stays Clean\n\nEach agent handles its own context in isolation. Your main conversation becomes the conductor — it never drowns in implementation details. Agents read from `.claude/epics/` and commit progress back through Git.\n\n---\n\n## Key Features & Benefits\n\n**🧠 Context preservation** — project state lives in files, not in your head or chat history. Start a session anywhere, any time.\n\n**⚡ Parallel execution** — tasks marked `parallel: true` run concurrently across multiple agents without conflicts.\n\n**🔗 GitHub native** — works with tools your team already uses. No dependency on the Projects API.\n\n**📊 Full traceability** — every decision documented. PRD → Epic → Task → Issue → Code → Commit.\n\n**🤖 Deterministic ops run as scripts** — status, standup, search, validate all run as bash scripts: fast, consistent, no LLM token cost.\n\n**🌐 Harness-agnostic** — follows the [agentskills.io](https://agentskills.io) open standard. Works with Factory, Claude Code, Amp, OpenCode, Codex, Cursor, and more.\n\n---\n\n## Install\n\nCCPM is a standard [Agent Skill](https://agentskills.io). Point your harness at `skill/ccpm/` — that's it.\n\n### Clone the repo\n\n```bash\ngit clone https://github.com/automazeio/ccpm.git\n```\n\n### Factory / Droid\n\n```bash\n# Symlink into your skills directory\nln -s /path/to/ccpm/skill/ccpm ~/.factory/skills/ccpm\n```\n\n### Claude Code\n\nIn your project root, add a `skills/` directory and symlink or copy the skill:\n\n```bash\nln -s /path/to/ccpm/skill/ccpm .claude/skills/ccpm\n```\n\n### Any other Agent Skills–compatible harness\n\nPoint it at `skill/ccpm/`. It follows the [agentskills.io](https://agentskills.io) standard and works out of the box.\n\n### Prerequisites\n\n- `git` and `gh` CLI (authenticated: `gh auth login`)\n- A GitHub repository for your project\n\n---\n\n## Usage\n\nCCPM activates automatically when your agent detects PM intent. Just talk naturally — no special syntax needed.\n\n### Natural language triggers\n\n| What you say | What happens |\n|---|---|\n| \"I want to build X\" / \"let's plan X\" | Brainstorming + PRD creation |\n| \"parse the X PRD\" / \"create an epic for X\" | PRD → technical epic |\n| \"break down the X epic\" | Epic decomposition into tasks |\n| \"sync the X epic to GitHub\" | Issues created, worktree set up |\n| \"start working on issue N\" | Analysis + parallel agents launched |\n| \"standup\" / \"what's our status\" | Bash script runs instantly |\n| \"what's next\" / \"what's blocked\" | Priority queue from project files |\n| \"close issue N\" | Local + GitHub updated |\n| \"merge the X epic\" | Tests, merge, cleanup |\n\n---\n\n## Workflow Phases\n\n### 1. Plan — Capture requirements\n\n```\n\"I want to build a notification system — push, email, and in-app\"\n```\n\nCCPM conducts guided brainstorming before writing anything. It asks about the problem, users, success criteria, constraints, and what's out of scope — then creates a structured PRD at `.claude/prds/<name>.md`.\n\nWhen ready: \"parse the notification-system PRD\" → produces a technical epic at `.claude/epics/notification-system/epic.md` with architecture decisions, technical approach, and task preview.\n\n### 2. Structure — Break it down\n\n```\n\"break down the notification-system epic into tasks\"\n```\n\nEach task gets a file with acceptance criteria, effort estimate, `depends_on`, `parallel`, and `conflicts_with` metadata. Tasks are intelligently batched for parallel creation. ≤10 tasks per epic by default.\n\n### 3. Sync — Push to GitHub\n\n```\n\"sync the notification-system epic to GitHub\"\n```\n\nCreates an epic issue, creates sub-issues for each task, renames local files to match GitHub issue numbers, sets up a dedicated worktree (`../epic-notification-system/`), and creates a mapping file for reference.\n\n### 4. Execute — Start building\n\n```\n\"start working on issue 42\"\n```\n\nAnalyzes the issue for independent work streams, launches parallel agents scoped to their own files, and sets up progress tracking. Each agent commits with `Issue #N: description` and coordinates through Git.\n\n### 5. Track — Know where things stand\n\n```\n\"standup\" / \"what's blocked\" / \"what's next\"\n```\n\nAll tracking operations run as bash scripts — instant output, no LLM overhead. The scripts scan `.claude/epics/` and report what's in progress, what's next, and what's blocked.\n\n---\n\n## Skill Structure\n\n```\nskill/ccpm/\n├── SKILL.md                  # Entry point — detects intent, routes to reference\n└── references/\n    ├── plan.md               # PRD writing + parsing to epic\n    ├── structure.md          # Epic decomposition into tasks\n    ├── sync.md               # GitHub sync, progress comments, close, merge\n    ├── execute.md            # Issue analysis + parallel agent launch\n    ├── track.md              # Status, standup, search, next, blocked\n    ├── conventions.md        # File formats, frontmatter schemas, git rules\n    └── scripts/              # Bash scripts for deterministic operations\n        ├── status.sh\n        ├── standup.sh\n        ├── epic-list.sh\n        ├── search.sh\n        └── ...               # 14 scripts total\n```\n\nYour project files live in `.claude/` in your project root:\n\n```\n.claude/\n├── prds/                     # Product requirement documents\n├── epics/\n│   └── <feature>/\n│       ├── epic.md           # Technical epic\n│       ├── <N>.md            # Task files (named by GitHub issue number after sync)\n│       ├── <N>-analysis.md   # Parallel work stream analysis\n│       └── updates/          # Agent progress tracking\n└── (archived epics)\n```\n\nFiles are the source of truth — plain markdown that lives in your repo, no external services.\n\n---\n\n## Example Flow\n\n```\nYou: \"I want to build a payment integration with Stripe — subscriptions and one-time charges\"\n\nCCPM: Asks 5 clarifying questions about scope, users, success criteria...\n\nYou: [answers]\n\nCCPM: ✅ PRD created: .claude/prds/payment-integration.md\n      Ready to create the technical epic?\n\nYou: \"yes, parse it\"\n\nCCPM: ✅ Epic created: .claude/epics/payment-integration/epic.md\n      8 task categories identified. Ready to decompose?\n\nYou: \"break it down\"\n\nCCPM: ✅ Created 7 tasks — 5 parallel, 2 sequential\n      Ready to push to GitHub?\n\nYou: \"sync it\"\n\nCCPM: ✅ Epic #1234 created\n      ✅ 7 sub-issues created (#1235–#1241)\n      ✅ Worktree: ../epic-payment-integration/\n\nYou: \"start working on issue 1235\"\n\nCCPM: Analyzed 3 parallel streams:\n      Stream A: Stripe client setup ✓ Started\n      Stream B: Webhook handler ✓ Started\n      Stream C: Database models ⏸ Waiting on A\n\nYou: \"what's our standup?\"\n\nCCPM: [runs standup.sh instantly]\n      📅 Daily Standup — 2026-03-18\n      🔄 In Progress: Issue #1235 (payment-integration) — 60%\n      ⏭️ Next: Issue #1236 — Subscription billing logic\n      📊 Tasks: 2 in progress, 5 open, 0 closed\n```\n\n---\n\n## Proven Results\n\nTeams using this system report:\n- **89% less time** lost to context switching\n- **5–8 parallel tasks** vs 1 previously\n- **75% reduction** in bug rates — due to detailed task breakdown before coding\n- **Up to 3× faster** feature delivery\n\n### Benchmark\n\nIn structured evals comparing CCPM-equipped agents vs baseline (no skill):\n\n| Scenario | With CCPM | Without |\n|---|---|---|\n| PRD creation (brainstorm-first, correct paths) | ✅ 4/4 | ❌ 2/4 |\n| Issue execution (analysis + worktree checks) | ✅ 4/4 | ❌ 0/4 |\n| Standup (runs script, real data) | ✅ 3/3 | ❌ 1/3 |\n| **Overall** | **100%** | **27.7%** |\n\n---\n\n## Local vs Remote\n\n| Operation | Local | GitHub |\n|---|---|---|\n| PRD creation | ✅ | — |\n| Implementation planning | ✅ | — |\n| Task breakdown | ✅ | ✅ (on sync) |\n| Execution | ✅ | — |\n| Progress updates | ✅ | ✅ (on sync) |\n| Final deliverables | — | ✅ |\n\n---\n\n## Technical Notes\n\n**GitHub integration** — uses `gh-sub-issue` extension for proper parent-child relationships. Falls back to task lists if not installed. Install with: `gh extension install yahsan2/gh-sub-issue`\n\n**File naming** — tasks start as `001.md`, `002.md` during decomposition. After GitHub sync, renamed to `{issue-id}.md` (e.g. `1234.md`). Issue #1234 = file `1234.md`.\n\n**Design decisions** — intentionally avoids GitHub Projects API complexity. All operations work on local files first for speed. GitHub sync is explicit and controlled. Worktrees provide clean git isolation for parallel work.\n\n**Looking for v1?** — The original `/pm:*` Claude Code slash command system is preserved on the [`v1` branch](https://github.com/automazeio/ccpm/tree/v1).\n\n---\n\n## Who's behind this project\n\nCCPM was developed at [Automaze](https://automaze.io) **for developers who ship, by developers who ship**.\n\nIf CCPM helps your team ship better software:\n\n- ⭐ **[Star this repository](https://github.com/automazeio/ccpm)** to show your support\n- 🐦 **[Follow @aroussi on X](https://x.com/aroussi)** for updates and tips\n\n---\n\n> [!TIP]\n> **Ship faster with Automaze.** We partner with founders to bring their vision to life, scale their business, and optimize for success.\n> **[Visit Automaze to book a call ›](https://automaze.io)**\n\n---\n\n![Star History Chart](https://api.star-history.com/svg?repos=automazeio/ccpm)\n"
  },
  {
    "path": "skill/ccpm/SKILL.md",
    "content": "---\nname: ccpm\ndescription: \"CCPM - spec-driven project management: PRD → Epic → GitHub Issues → parallel agents → shipped code. Use this skill for anything in the software delivery lifecycle: writing a PRD ('write a PRD for X', 'let's plan X', 'scope this out'), parsing a PRD into an epic, decomposing an epic into tasks, syncing to GitHub ('sync the X epic', 'push tasks to github'), starting work on an issue ('start working on issue N', 'let's work on issue N'), analyzing parallel work streams, running standups ('standup', 'run the standup'), checking status ('what's next', 'what's blocked', 'what are we working on'), closing issues, or merging an epic. Use ccpm any time the user is talking about shipping a feature, managing work, or tracking progress — even if they don't say 'ccpm' or 'PRD'. Do NOT use for: debugging code, writing tests, reviewing PRs, or raw GitHub issue/PR operations with no delivery context.\"\n---\n\n# CCPM - Claude Code Project Manager\n\nA spec-driven development workflow: PRD → Epic → GitHub Issues → Parallel Agents → Shipped Code.\n\n## Core Philosophy\n\nRequirements live in files, not heads. Every feature starts as a PRD, becomes a technical epic, decomposes into GitHub issues, and gets executed by parallel agents with full traceability.\n\n## File Conventions\n\nBefore doing anything, read `references/conventions.md` for path standards, frontmatter schemas, and GitHub operation rules. These apply to all phases.\n\n## The Five Phases\n\n### 1. Plan — Capture requirements\n**When**: User wants to define a new feature, product requirement, or scope of work.\n**Read**: `references/plan.md`\n**Covers**: Writing PRDs through guided brainstorming, converting PRDs to technical epics.\n\n### 2. Structure — Break it down\n**When**: An epic exists and needs to be decomposed into concrete tasks.\n**Read**: `references/structure.md`\n**Covers**: Epic decomposition into numbered task files with dependencies and parallelization.\n\n### 3. Sync — Push to GitHub\n**When**: Local epic/tasks need to become GitHub issues, progress needs to be posted as comments, or a bug is found and needs a linked issue created.\n**Read**: `references/sync.md`\n**Covers**: Epic sync (epic + tasks → GitHub issues), issue sync (progress comments), closing issues/epics, bug reporting against completed issues.\n\n### 4. Execute — Start building\n**When**: User wants to start working on one or more GitHub issues with parallel agents.\n**Read**: `references/execute.md`\n**Covers**: Issue analysis (parallel work stream identification), launching parallel agents, coordinating worktrees.\n\n### 5. Track — Know where things stand\n**When**: User asks for status, standup report, what's blocked, what's next, or needs to validate state.\n**Read**: `references/track.md`\n**Covers**: Status, standup, search, in-progress, next priority, blocked items, validation.\n\n---\n\n## Script-First Rule\n\nFor deterministic operations — anything that reads and reports without needing reasoning — always run the bash script directly rather than doing the work manually:\n\n| What the user wants | Script to run |\n|---|---|\n| Project status | `bash references/scripts/status.sh` |\n| Standup report | `bash references/scripts/standup.sh` |\n| List all epics | `bash references/scripts/epic-list.sh` |\n| Show epic details | `bash references/scripts/epic-show.sh <name>` |\n| Epic status | `bash references/scripts/epic-status.sh <name>` |\n| List PRDs | `bash references/scripts/prd-list.sh` |\n| PRD status | `bash references/scripts/prd-status.sh` |\n| Search issues/tasks | `bash references/scripts/search.sh <query>` |\n| What's in progress | `bash references/scripts/in-progress.sh` |\n| What's next | `bash references/scripts/next.sh` |\n| What's blocked | `bash references/scripts/blocked.sh` |\n| Validate project state | `bash references/scripts/validate.sh` |\n\nUse the LLM for work that requires reasoning: writing PRDs, analyzing parallelism, launching agents, synthesizing updates.\n\n---\n\n## Quick Reference\n\n```\nPlan a feature:     \"I want to build X\" or \"create a PRD for X\"\nParse to epic:      \"turn the X PRD into an epic\"\nDecompose:          \"break down the X epic into tasks\"\nSync to GitHub:     \"push the X epic to GitHub\"\nStart an issue:     \"start working on issue 42\"\nCheck status:       \"what's our status\" / \"standup\"\nWhat's next:        \"what should I work on next\"\nMerge epic:         \"merge the X epic\"\nReport a bug:       \"found a bug in issue 42\" / \"testing issue 42 revealed X\"\n```\n"
  },
  {
    "path": "skill/ccpm/references/conventions.md",
    "content": "# Conventions — File Formats, Paths & Rules\n\nRead this before doing any file operations across all phases.\n\n---\n\n## Directory Structure\n\n```\n.claude/\n├── prds/\n│   └── <feature-name>.md          # Product requirement documents\n├── epics/\n│   ├── <feature-name>/\n│   │   ├── epic.md                # Technical epic\n│   │   ├── <N>.md                 # Task files (named by GitHub issue number after sync)\n│   │   ├── <N>-analysis.md        # Parallel work stream analysis\n│   │   ├── github-mapping.md      # Issue number → URL mapping\n│   │   ├── execution-status.md    # Active agents tracker\n│   │   └── updates/\n│   │       └── <issue_N>/\n│   │           ├── stream-A.md    # Per-agent progress\n│   │           ├── progress.md    # Overall issue progress\n│   │           └── execution.md  # Execution state\n│   └── archived/\n│       └── <feature-name>/        # Completed epics\n└── context/                       # Project context docs (separate system)\n```\n\n---\n\n## Frontmatter Schemas\n\n### PRD (.claude/prds/<name>.md)\n```yaml\n---\nname: <feature-name>        # kebab-case, matches filename\ndescription: <one-liner>    # used in lists and summaries\nstatus: backlog | active | completed\ncreated: <ISO 8601>         # date -u +\"%Y-%m-%dT%H:%M:%SZ\"\n---\n```\n\n### Epic (.claude/epics/<name>/epic.md)\n```yaml\n---\nname: <feature-name>\nstatus: backlog | in-progress | completed\ncreated: <ISO 8601>\nupdated: <ISO 8601>\nprogress: 0%                # recalculated when tasks close\nprd: .claude/prds/<name>.md\ngithub: https://github.com/<owner>/<repo>/issues/<N>  # set on sync\n---\n```\n\n### Task (.claude/epics/<name>/<N>.md)\n```yaml\n---\nname: <Task Title>\nstatus: open | in-progress | closed\ncreated: <ISO 8601>\nupdated: <ISO 8601>\ngithub: https://github.com/<owner>/<repo>/issues/<N>  # set on sync\ndepends_on: []              # issue numbers this must wait for\nparallel: true              # can run concurrently with non-conflicting tasks\nconflicts_with: []          # issue numbers that touch the same files\n---\n```\n\n### Progress (.claude/epics/<name>/updates/<N>/progress.md)\n```yaml\n---\nissue: <N>\nstarted: <ISO 8601>\nlast_sync: <ISO 8601>\ncompletion: 0%\n---\n```\n\n---\n\n## Datetime Rule\n\nAlways get real current datetime from the system — never use placeholder text:\n```bash\ndate -u +\"%Y-%m-%dT%H:%M:%SZ\"\n```\n\n---\n\n## Frontmatter Update Pattern\n\nWhen updating a single frontmatter field in an existing file:\n```bash\nsed -i.bak \"/^<field>:/c\\\\<field>: <value>\" <file>\nrm <file>.bak\n```\n\nWhen stripping frontmatter to get body content for GitHub:\n```bash\nsed '1,/^---$/d; 1,/^---$/d' <file> > /tmp/body.md\n```\n\n---\n\n## GitHub Operations\n\n### Repository Safety Check (run before any write operation)\n```bash\nremote_url=$(git remote get-url origin 2>/dev/null || echo \"\")\nif [[ \"$remote_url\" == *\"automazeio/ccpm\"* ]]; then\n  echo \"❌ Cannot write to the CCPM template repository.\"\n  echo \"Update remote: git remote set-url origin https://github.com/YOUR/REPO.git\"\n  exit 1\nfi\nREPO=$(echo \"$remote_url\" | sed 's|.*github.com[:/]||' | sed 's|\\.git$||')\n```\n\n### Authentication\nDon't pre-check authentication. Run the `gh` command and handle failure:\n```bash\ngh <command> || echo \"❌ GitHub CLI failed. Run: gh auth login\"\n```\n\n### Getting Issue Numbers\n```bash\n# From a task file's github field:\ngrep 'github:' <file> | grep -oE '[0-9]+$'\n```\n\n---\n\n## Git / Worktree Conventions\n\n- One branch per epic: `epic/<name>`\n- Worktrees live at `../epic-<name>/` (sibling to project root)\n- Always start branches from an up-to-date main:\n  ```bash\n  git checkout main && git pull origin main\n  git worktree add ../epic-<name> -b epic/<name>\n  ```\n- Commit format inside epics: `Issue #<N>: <description>`\n- Never use `--force` in any git operation\n\n---\n\n## Naming Conventions\n\n- Feature names: kebab-case, lowercase, letters/numbers/hyphens, starts with a letter\n- Task files before sync: `001.md`, `002.md`, ... (sequential)\n- Task files after sync: renamed to GitHub issue number (e.g., `1234.md`)\n- Labels applied on sync: `epic`, `epic:<name>`, `feature` (for epics); `task`, `epic:<name>` (for tasks)\n\n---\n\n## Epic Progress Calculation\n\n```bash\ntotal=$(ls .claude/epics/<name>/[0-9]*.md 2>/dev/null | wc -l)\nclosed=$(grep -l '^status: closed' .claude/epics/<name>/[0-9]*.md 2>/dev/null | wc -l)\nprogress=$((closed * 100 / total))\n```\n\nUpdate epic frontmatter when any task closes.\n"
  },
  {
    "path": "skill/ccpm/references/execute.md",
    "content": "# Execute — Start Building with Parallel Agents\n\nThis phase covers analyzing GitHub issues for parallel work streams and launching agents to execute them.\n\n---\n\n## Issue Analysis\n\n**Trigger**: User wants to understand how to parallelize work on an issue before starting.\n\n### Preflight\n- Find the local task file: check `.claude/epics/*/<N>.md` first, then search for `github:.*issues/<N>` in frontmatter.\n- If not found: \"❌ No local task for issue #<N>. Run a sync first.\"\n\n### Process\n\nGet issue details: `gh issue view <N> --json title,body,labels`\n\nRead the local task file fully. Identify independent work streams by asking:\n- Which files will be created/modified?\n- Which changes can happen simultaneously without conflict?\n- What are the dependencies between changes?\n\n**Common stream patterns:**\n- Database Layer: schema, migrations, models\n- Service Layer: business logic, data access\n- API Layer: endpoints, validation, middleware\n- UI Layer: components, pages, styles\n- Test Layer: unit tests, integration tests\n\nCreate `.claude/epics/<epic_name>/<N>-analysis.md`:\n\n```markdown\n---\nissue: <N>\ntitle: <title>\nanalyzed: <run: date -u +\"%Y-%m-%dT%H:%M:%SZ\">\nestimated_hours: <total>\nparallelization_factor: <1.0-5.0>\n---\n\n# Parallel Work Analysis: Issue #<N>\n\n## Overview\n\n## Parallel Streams\n\n### Stream A: <Name>\n**Scope**: \n**Files**: \n**Can Start**: immediately\n**Estimated Hours**: \n**Dependencies**: none\n\n### Stream B: <Name>\n**Scope**: \n**Files**: \n**Can Start**: after Stream A\n**Dependencies**: Stream A\n\n## Coordination Points\n### Shared Files\n### Sequential Requirements\n\n## Conflict Risk Assessment\n\n## Parallelization Strategy\n\n## Expected Timeline\n- With parallel execution: <max_stream_hours>h wall time\n- Without: <sum_all_hours>h\n- Efficiency gain: <pct>%\n```\n\n**Output**: \"✅ Analysis complete for issue #<N> — N parallel streams identified. Ready to start? Say: start issue <N>\"\n\n---\n\n## Starting an Issue\n\n**Trigger**: User wants to begin work on a specific GitHub issue.\n\n### Preflight\n1. Verify issue exists and is open: `gh issue view <N> --json state,title,labels,body`\n2. Find local task file (as above).\n3. Check for analysis file: `.claude/epics/*/<N>-analysis.md` — if missing, run analysis first (or do both in sequence: analyze then start).\n4. Verify epic worktree exists: `git worktree list | grep \"epic-<name>\"` — if not: \"❌ No worktree. Sync the epic first.\"\n\n### Process\n\n**Step 1 — Read the analysis**, identify which streams can start immediately vs. which have dependencies.\n\n**Step 2 — Create progress tracking:**\n```bash\nmkdir -p .claude/epics/<epic>/updates/<N>\ncurrent_date=$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\n```\n\nCreate `.claude/epics/<epic>/updates/<N>/stream-<X>.md` for each stream:\n```markdown\n---\nissue: <N>\nstream: <stream_name>\nstarted: <datetime>\nstatus: in_progress\n---\n## Scope\n## Progress\n- Starting implementation\n```\n\n**Step 3 — Launch parallel agents** for each stream that can start immediately:\n\n```yaml\nTask:\n  description: \"Issue #<N> Stream <X>\"\n  subagent_type: \"general-purpose\"\n  prompt: |\n    You are working on Issue #<N> in the epic worktree at: ../epic-<name>/\n    \n    Your stream: <stream_name>\n    Your scope — files to modify: <file_patterns>\n    Work to complete: <stream_description>\n    \n    Instructions:\n    1. Read full task from: .claude/epics/<epic>/<N>.md\n    2. Read analysis from: .claude/epics/<epic>/<N>-analysis.md\n    3. Work ONLY in your assigned files\n    4. Commit frequently: \"Issue #<N>: <specific change>\"\n    5. Update progress in: .claude/epics/<epic>/updates/<N>/stream-<X>.md\n    6. If you need to touch files outside your scope, note it in your progress file and wait\n    7. Never use --force on git operations\n    \n    Complete your stream's work and mark status: completed when done.\n```\n\nStreams with unmet dependencies are queued — launch them as their dependencies complete.\n\n**Step 4 — Assign on GitHub:**\n```bash\ngh issue edit <N> --add-assignee @me --add-label \"in-progress\"\n```\n\n**Step 5 — Create execution status file** at `.claude/epics/<epic>/updates/<N>/execution.md`:\n```markdown\n## Active Streams\n- Stream A: <name> — Started <time>\n- Stream B: <name> — Started <time>\n\n## Queued\n- Stream C: <name> — Waiting on Stream A\n\n## Completed\n(none yet)\n```\n\n**Output:**\n```\n✅ Started work on issue #<N>\n\nLaunched N agents:\n  Stream A: <name> ✓ Started\n  Stream B: <name> ✓ Started\n  Stream C: <name> ⏸ Waiting (depends on A)\n\nMonitor: check progress in .claude/epics/<epic>/updates/<N>/\nSync updates: \"sync issue <N>\"\n```\n\n---\n\n## Starting a Full Epic\n\n**Trigger**: User wants to launch parallel agents across all ready issues in an epic at once.\n\n### Preflight\n- Verify `.claude/epics/<name>/epic.md` exists and has a `github:` field (i.e., it's been synced).\n- Check for uncommitted changes: `git status --porcelain` — block if dirty.\n- Verify epic branch exists: `git branch -a | grep \"epic/<name>\"`\n\n### Process\n\n**Step 1 — Read all task files** in `.claude/epics/<name>/`. Parse frontmatter for `status`, `depends_on`, `parallel`.\n\n**Step 2 — Categorize tasks:**\n- Ready: status=open, no unmet depends_on\n- Blocked: has unmet depends_on\n- In Progress: already has an execution file\n- Complete: status=closed\n\n**Step 3 — Analyze any ready tasks** that don't have an analysis file yet (run issue analysis inline).\n\n**Step 4 — Launch agents** for all ready tasks following the same per-issue agent launch pattern above.\n\n**Step 5 — Create/update** `.claude/epics/<name>/execution-status.md` with all active agents and queued issues.\n\n**Step 6 — As agents complete**, check if blocked issues are now unblocked and launch those agents.\n\n---\n\n## Agent Coordination Rules\n\nWhen multiple agents work in the same worktree simultaneously:\n\n- Each agent works only on files in its assigned stream scope.\n- Agents commit frequently with `Issue #<N>: <description>` format.\n- Before modifying a shared file, check `git status <file>` — if another agent has it modified, wait and pull first.\n- Agents sync via commits: `git pull --rebase origin epic/<name>` before starting new file work.\n- Conflicts are never auto-resolved — agents report them and pause.\n- No `--force` flags ever.\n\nShared files that commonly need coordination (types, config, package.json) should be handled by one designated stream; others pull after that commit.\n"
  },
  {
    "path": "skill/ccpm/references/plan.md",
    "content": "# Plan — Capture Requirements\n\nThis phase turns an idea into a structured PRD, then converts the PRD into a technical epic ready for decomposition.\n\n---\n\n## Writing a PRD\n\n**Trigger**: User wants to plan a new feature, product requirement, or area of work.\n\n### Preflight\n- Check if `.claude/prds/<name>.md` already exists — if so, confirm overwrite before proceeding.\n- Ensure `.claude/prds/` directory exists; create it if not.\n- Feature name must be kebab-case (lowercase, letters/numbers/hyphens, starts with a letter). If not: \"❌ Feature name must be kebab-case. Example: user-auth, payment-v2\"\n\n### Process\n\nConduct a genuine brainstorming session before writing anything. Ask the user:\n- What problem does this solve?\n- Who are the users affected?\n- What does success look like?\n- What's explicitly out of scope?\n- What are the constraints (tech, time, resources)?\n\nThen write `.claude/prds/<name>.md` with this frontmatter and structure:\n\n```markdown\n---\nname: <feature-name>\ndescription: <one-line summary>\nstatus: backlog\ncreated: <run: date -u +\"%Y-%m-%dT%H:%M:%SZ\">\n---\n\n# PRD: <feature-name>\n\n## Executive Summary\n## Problem Statement\n## User Stories\n## Functional Requirements\n## Non-Functional Requirements\n## Success Criteria\n## Constraints & Assumptions\n## Out of Scope\n## Dependencies\n```\n\n**Quality gates before saving:**\n- No placeholder text in any section\n- User stories include acceptance criteria\n- Success criteria are measurable\n- Out of scope is explicitly listed\n\n**After creation**: Confirm \"✅ PRD created: `.claude/prds/<name>.md`\" and suggest: \"Ready to create technical epic? Say: parse the <name> PRD\"\n\n---\n\n## Parsing a PRD into a Technical Epic\n\n**Trigger**: User wants to convert an existing PRD into a technical implementation plan.\n\n### Preflight\n- Verify `.claude/prds/<name>.md` exists with valid frontmatter (name, description, status, created).\n- Check if `.claude/epics/<name>/epic.md` already exists — confirm overwrite if so.\n\n### Process\n\nRead the PRD fully, then produce `.claude/epics/<name>/epic.md`:\n\n```markdown\n---\nname: <feature-name>\nstatus: backlog\ncreated: <run: date -u +\"%Y-%m-%dT%H:%M:%SZ\">\nprogress: 0%\nprd: .claude/prds/<name>.md\ngithub: (will be set on sync)\n---\n\n# Epic: <feature-name>\n\n## Overview\n## Architecture Decisions\n## Technical Approach\n### Frontend Components\n### Backend Services\n### Infrastructure\n## Implementation Strategy\n## Task Breakdown Preview\n## Dependencies\n## Success Criteria (Technical)\n## Estimated Effort\n```\n\n**Key constraints:**\n- Aim for ≤10 tasks total — prefer simplicity over completeness.\n- Look for ways to leverage existing functionality before creating new code.\n- Identify parallelization opportunities in the task breakdown preview.\n\n**After creation**: Confirm \"✅ Epic created: `.claude/epics/<name>/epic.md`\" and suggest: \"Ready to decompose into tasks? Say: decompose the <name> epic\"\n\n---\n\n## Editing a PRD or Epic\n\nRead the file first, make targeted edits preserving all frontmatter. Update the `updated` frontmatter field with current datetime.\n"
  },
  {
    "path": "skill/ccpm/references/scripts/blocked.sh",
    "content": "#!/bin/bash\necho \"Getting tasks...\"\necho \"\"\necho \"\"\n\necho \"🚫 Blocked Tasks\"\necho \"================\"\necho \"\"\n\nfound=0\n\nfor epic_dir in .claude/epics/*/; do\n  [ -d \"$epic_dir\" ] || continue\n  epic_name=$(basename \"$epic_dir\")\n\n  for task_file in \"$epic_dir\"/[0-9]*.md; do\n    [ -f \"$task_file\" ] || continue\n\n    # Check if task is open\n    status=$(grep \"^status:\" \"$task_file\" | head -1 | sed 's/^status: *//')\n    if [ \"$status\" != \"open\" ] && [ -n \"$status\" ]; then\n      continue\n    fi\n\n    # Check for dependencies\n    deps_line=$(grep \"^depends_on:\" \"$task_file\" | head -1)\n    if [ -n \"$deps_line\" ]; then\n      deps=$(echo \"$deps_line\" | sed 's/^depends_on: *//' | sed 's/^\\[//' | sed 's/\\]$//' | sed 's/,/ /g' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')\n      [ -z \"$deps\" ] && deps=\"\"\n    else\n      deps=\"\"\n    fi\n\n    if [ -n \"$deps\" ] && [ \"$deps\" != \"depends_on:\" ]; then\n      task_name=$(grep \"^name:\" \"$task_file\" | head -1 | sed 's/^name: *//')\n      task_num=$(basename \"$task_file\" .md)\n\n      echo \"⏸️ Task #$task_num - $task_name\"\n      echo \"   Epic: $epic_name\"\n      echo \"   Blocked by: [$deps]\"\n\n      # Check status of dependencies\n      open_deps=\"\"\n      for dep in $deps; do\n        dep_file=\"$epic_dir$dep.md\"\n        if [ -f \"$dep_file\" ]; then\n          dep_status=$(grep \"^status:\" \"$dep_file\" | head -1 | sed 's/^status: *//')\n          [ \"$dep_status\" = \"open\" ] && open_deps=\"$open_deps #$dep\"\n        fi\n      done\n\n      [ -n \"$open_deps\" ] && echo \"   Waiting for:$open_deps\"\n      echo \"\"\n      ((found++))\n    fi\n  done\ndone\n\nif [ $found -eq 0 ]; then\n  echo \"No blocked tasks found!\"\n  echo \"\"\n  echo \"💡 All tasks with dependencies are either completed or in progress.\"\nelse\n  echo \"📊 Total blocked: $found tasks\"\nfi\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/epic-list.sh",
    "content": "#!/bin/bash\necho \"Getting epics...\"\necho \"\"\necho \"\"\n\n[ ! -d \".claude/epics\" ] && echo \"📁 No epics directory found. Create your first epic with: /pm:prd-parse <feature-name>\" && exit 0\n[ -z \"$(ls -d .claude/epics/*/ 2>/dev/null)\" ] && echo \"📁 No epics found. Create your first epic with: /pm:prd-parse <feature-name>\" && exit 0\n\necho \"📚 Project Epics\"\necho \"================\"\necho \"\"\n\n# Initialize arrays to store epics by status\nplanning_epics=\"\"\nin_progress_epics=\"\"\ncompleted_epics=\"\"\n\n# Process all epics\nfor dir in .claude/epics/*/; do\n  [ -d \"$dir\" ] || continue\n  [ -f \"$dir/epic.md\" ] || continue\n\n  # Extract metadata\n  n=$(grep \"^name:\" \"$dir/epic.md\" | head -1 | sed 's/^name: *//')\n  s=$(grep \"^status:\" \"$dir/epic.md\" | head -1 | sed 's/^status: *//' | tr '[:upper:]' '[:lower:]')\n  p=$(grep \"^progress:\" \"$dir/epic.md\" | head -1 | sed 's/^progress: *//')\n  g=$(grep \"^github:\" \"$dir/epic.md\" | head -1 | sed 's/^github: *//')\n\n  # Defaults\n  [ -z \"$n\" ] && n=$(basename \"$dir\")\n  [ -z \"$p\" ] && p=\"0%\"\n\n  # Count tasks\n  t=$(ls \"$dir\"/[0-9]*.md 2>/dev/null | wc -l)\n\n  # Format output with GitHub issue number if available\n  if [ -n \"$g\" ]; then\n    i=$(echo \"$g\" | grep -o '/[0-9]*$' | tr -d '/')\n    entry=\"   📋 ${dir}epic.md (#$i) - $p complete ($t tasks)\"\n  else\n    entry=\"   📋 ${dir}epic.md - $p complete ($t tasks)\"\n  fi\n\n  # Categorize by status (handle various status values)\n  case \"$s\" in\n    planning|draft|\"\")\n      planning_epics=\"${planning_epics}${entry}\\n\"\n      ;;\n    in-progress|in_progress|active|started)\n      in_progress_epics=\"${in_progress_epics}${entry}\\n\"\n      ;;\n    completed|complete|done|closed|finished)\n      completed_epics=\"${completed_epics}${entry}\\n\"\n      ;;\n    *)\n      # Default to planning for unknown statuses\n      planning_epics=\"${planning_epics}${entry}\\n\"\n      ;;\n  esac\ndone\n\n# Display categorized epics\necho \"📝 Planning:\"\nif [ -n \"$planning_epics\" ]; then\n  echo -e \"$planning_epics\" | sed '/^$/d'\nelse\n  echo \"   (none)\"\nfi\n\necho \"\"\necho \"🚀 In Progress:\"\nif [ -n \"$in_progress_epics\" ]; then\n  echo -e \"$in_progress_epics\" | sed '/^$/d'\nelse\n  echo \"   (none)\"\nfi\n\necho \"\"\necho \"✅ Completed:\"\nif [ -n \"$completed_epics\" ]; then\n  echo -e \"$completed_epics\" | sed '/^$/d'\nelse\n  echo \"   (none)\"\nfi\n\n# Summary\necho \"\"\necho \"📊 Summary\"\ntotal=$(ls -d .claude/epics/*/ 2>/dev/null | wc -l)\ntasks=$(find .claude/epics -name \"[0-9]*.md\" 2>/dev/null | wc -l)\necho \"   Total epics: $total\"\necho \"   Total tasks: $tasks\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/epic-show.sh",
    "content": "#!/bin/bash\n\nepic_name=\"$1\"\n\nif [ -z \"$epic_name\" ]; then\n  echo \"❌ Please provide an epic name\"\n  echo \"Usage: /pm:epic-show <epic-name>\"\n  exit 1\nfi\n\necho \"Getting epic...\"\necho \"\"\necho \"\"\n\nepic_dir=\".claude/epics/$epic_name\"\nepic_file=\"$epic_dir/epic.md\"\n\nif [ ! -f \"$epic_file\" ]; then\n  echo \"❌ Epic not found: $epic_name\"\n  echo \"\"\n  echo \"Available epics:\"\n  for dir in .claude/epics/*/; do\n    [ -d \"$dir\" ] && echo \"  • $(basename \"$dir\")\"\n  done\n  exit 1\nfi\n\n# Display epic details\necho \"📚 Epic: $epic_name\"\necho \"================================\"\necho \"\"\n\n# Extract metadata\nstatus=$(grep \"^status:\" \"$epic_file\" | head -1 | sed 's/^status: *//')\nprogress=$(grep \"^progress:\" \"$epic_file\" | head -1 | sed 's/^progress: *//')\ngithub=$(grep \"^github:\" \"$epic_file\" | head -1 | sed 's/^github: *//')\ncreated=$(grep \"^created:\" \"$epic_file\" | head -1 | sed 's/^created: *//')\n\necho \"📊 Metadata:\"\necho \"  Status: ${status:-planning}\"\necho \"  Progress: ${progress:-0%}\"\n[ -n \"$github\" ] && echo \"  GitHub: $github\"\necho \"  Created: ${created:-unknown}\"\necho \"\"\n\n# Show tasks\necho \"📝 Tasks:\"\ntask_count=0\nopen_count=0\nclosed_count=0\n\nfor task_file in \"$epic_dir\"/[0-9]*.md; do\n  [ -f \"$task_file\" ] || continue\n\n  task_num=$(basename \"$task_file\" .md)\n  task_name=$(grep \"^name:\" \"$task_file\" | head -1 | sed 's/^name: *//')\n  task_status=$(grep \"^status:\" \"$task_file\" | head -1 | sed 's/^status: *//')\n  parallel=$(grep \"^parallel:\" \"$task_file\" | head -1 | sed 's/^parallel: *//')\n\n  if [ \"$task_status\" = \"closed\" ] || [ \"$task_status\" = \"completed\" ]; then\n    echo \"  ✅ #$task_num - $task_name\"\n    ((closed_count++))\n  else\n    echo \"  ⬜ #$task_num - $task_name\"\n    [ \"$parallel\" = \"true\" ] && echo -n \" (parallel)\"\n    ((open_count++))\n  fi\n\n  ((task_count++))\ndone\n\nif [ $task_count -eq 0 ]; then\n  echo \"  No tasks created yet\"\n  echo \"  Run: /pm:epic-decompose $epic_name\"\nfi\n\necho \"\"\necho \"📈 Statistics:\"\necho \"  Total tasks: $task_count\"\necho \"  Open: $open_count\"\necho \"  Closed: $closed_count\"\n[ $task_count -gt 0 ] && echo \"  Completion: $((closed_count * 100 / task_count))%\"\n\n# Next actions\necho \"\"\necho \"💡 Actions:\"\n[ $task_count -eq 0 ] && echo \"  • Decompose into tasks: /pm:epic-decompose $epic_name\"\n[ -z \"$github\" ] && [ $task_count -gt 0 ] && echo \"  • Sync to GitHub: /pm:epic-sync $epic_name\"\n[ -n \"$github\" ] && [ \"$status\" != \"completed\" ] && echo \"  • Start work: /pm:epic-start $epic_name\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/epic-status.sh",
    "content": "#!/bin/bash\n\necho \"Getting status...\"\necho \"\"\necho \"\"\n\nepic_name=\"$1\"\n\nif [ -z \"$epic_name\" ]; then\n  echo \"❌ Please specify an epic name\"\n  echo \"Usage: /pm:epic-status <epic-name>\"\n  echo \"\"\n  echo \"Available epics:\"\n  for dir in .claude/epics/*/; do\n    [ -d \"$dir\" ] && echo \"  • $(basename \"$dir\")\"\n  done\n  exit 1\nelse\n  # Show status for specific epic\n  epic_dir=\".claude/epics/$epic_name\"\n  epic_file=\"$epic_dir/epic.md\"\n\n  if [ ! -f \"$epic_file\" ]; then\n    echo \"❌ Epic not found: $epic_name\"\n    echo \"\"\n    echo \"Available epics:\"\n    for dir in .claude/epics/*/; do\n      [ -d \"$dir\" ] && echo \"  • $(basename \"$dir\")\"\n    done\n    exit 1\n  fi\n\n  echo \"📚 Epic Status: $epic_name\"\n  echo \"================================\"\n  echo \"\"\n\n  # Extract metadata\n  status=$(grep \"^status:\" \"$epic_file\" | head -1 | sed 's/^status: *//')\n  progress=$(grep \"^progress:\" \"$epic_file\" | head -1 | sed 's/^progress: *//')\n  github=$(grep \"^github:\" \"$epic_file\" | head -1 | sed 's/^github: *//')\n\n  # Count tasks\n  total=0\n  open=0\n  closed=0\n  blocked=0\n\n  # Use find to safely iterate over task files\n  for task_file in \"$epic_dir\"/[0-9]*.md; do\n    [ -f \"$task_file\" ] || continue\n    ((total++))\n\n    task_status=$(grep \"^status:\" \"$task_file\" | head -1 | sed 's/^status: *//')\n    deps=$(grep \"^depends_on:\" \"$task_file\" | head -1 | sed 's/^depends_on: *\\[//' | sed 's/\\]//')\n\n    if [ \"$task_status\" = \"closed\" ] || [ \"$task_status\" = \"completed\" ]; then\n      ((closed++))\n    elif [ -n \"$deps\" ] && [ \"$deps\" != \"depends_on:\" ]; then\n      ((blocked++))\n    else\n      ((open++))\n    fi\n  done\n\n  # Display progress bar\n  if [ $total -gt 0 ]; then\n    percent=$((closed * 100 / total))\n    filled=$((percent * 20 / 100))\n    empty=$((20 - filled))\n\n    echo -n \"Progress: [\"\n    [ $filled -gt 0 ] && printf '%0.s█' $(seq 1 $filled)\n    [ $empty -gt 0 ] && printf '%0.s░' $(seq 1 $empty)\n    echo \"] $percent%\"\n  else\n    echo \"Progress: No tasks created\"\n  fi\n\n  echo \"\"\n  echo \"📊 Breakdown:\"\n  echo \"  Total tasks: $total\"\n  echo \"  ✅ Completed: $closed\"\n  echo \"  🔄 Available: $open\"\n  echo \"  ⏸️ Blocked: $blocked\"\n\n  [ -n \"$github\" ] && echo \"\"\n  [ -n \"$github\" ] && echo \"🔗 GitHub: $github\"\nfi\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/help.sh",
    "content": "#!/bin/bash\necho \"Helping...\"\necho \"\"\necho \"\"\n\necho \"📚 Claude Code PM - Project Management System\"\necho \"=============================================\"\necho \"\"\necho \"🎯 Quick Start Workflow\"\necho \"  1. /pm:prd-new <name>        - Create a new PRD\"\necho \"  2. /pm:prd-parse <name>      - Convert PRD to epic\"\necho \"  3. /pm:epic-decompose <name> - Break into tasks\"\necho \"  4. /pm:epic-sync <name>      - Push to GitHub\"\necho \"  5. /pm:epic-start <name>     - Start parallel execution\"\necho \"\"\necho \"📄 PRD Commands\"\necho \"  /pm:prd-new <name>     - Launch brainstorming for new product requirement\"\necho \"  /pm:prd-parse <name>   - Convert PRD to implementation epic\"\necho \"  /pm:prd-list           - List all PRDs\"\necho \"  /pm:prd-edit <name>    - Edit existing PRD\"\necho \"  /pm:prd-status         - Show PRD implementation status\"\necho \"\"\necho \"📚 Epic Commands\"\necho \"  /pm:epic-decompose <name> - Break epic into task files\"\necho \"  /pm:epic-sync <name>      - Push epic and tasks to GitHub\"\necho \"  /pm:epic-oneshot <name>   - Decompose and sync in one command\"\necho \"  /pm:epic-list             - List all epics\"\necho \"  /pm:epic-show <name>      - Display epic and its tasks\"\necho \"  /pm:epic-status [name]    - Show epic progress\"\necho \"  /pm:epic-close <name>     - Mark epic as complete\"\necho \"  /pm:epic-edit <name>      - Edit epic details\"\necho \"  /pm:epic-refresh <name>   - Update epic progress from tasks\"\necho \"  /pm:epic-start <name>     - Launch parallel agent execution\"\necho \"\"\necho \"📝 Issue Commands\"\necho \"  /pm:issue-show <num>      - Display issue and sub-issues\"\necho \"  /pm:issue-status <num>    - Check issue status\"\necho \"  /pm:issue-start <num>     - Begin work with specialized agent\"\necho \"  /pm:issue-sync <num>      - Push updates to GitHub\"\necho \"  /pm:issue-close <num>     - Mark issue as complete\"\necho \"  /pm:issue-reopen <num>    - Reopen closed issue\"\necho \"  /pm:issue-edit <num>      - Edit issue details\"\necho \"  /pm:issue-analyze <num>   - Analyze for parallel work streams\"\necho \"\"\necho \"🔄 Workflow Commands\"\necho \"  /pm:next               - Show next priority tasks\"\necho \"  /pm:status             - Overall project dashboard\"\necho \"  /pm:standup            - Daily standup report\"\necho \"  /pm:blocked            - Show blocked tasks\"\necho \"  /pm:in-progress        - List work in progress\"\necho \"\"\necho \"🔗 Sync Commands\"\necho \"  /pm:sync               - Full bidirectional sync with GitHub\"\necho \"  /pm:import <issue>     - Import existing GitHub issues\"\necho \"\"\necho \"🔧 Maintenance Commands\"\necho \"  /pm:validate           - Check system integrity\"\necho \"  /pm:clean              - Archive completed work\"\necho \"  /pm:search <query>     - Search across all content\"\necho \"\"\necho \"⚙️  Setup Commands\"\necho \"  /pm:init               - Install dependencies and configure GitHub\"\necho \"  /pm:help               - Show this help message\"\necho \"\"\necho \"💡 Tips\"\necho \"  • Use /pm:next to find available work\"\necho \"  • Run /pm:status for quick overview\"\necho \"  • Epic workflow: prd-new → prd-parse → epic-decompose → epic-sync\"\necho \"  • View README.md for complete documentation\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/in-progress.sh",
    "content": "#!/bin/bash\necho \"Getting status...\"\necho \"\"\necho \"\"\n\necho \"🔄 In Progress Work\"\necho \"===================\"\necho \"\"\n\n# Check for active work in updates directories\nfound=0\n\nif [ -d \".claude/epics\" ]; then\n  for updates_dir in .claude/epics/*/updates/*/; do\n    [ -d \"$updates_dir\" ] || continue\n\n    issue_num=$(basename \"$updates_dir\")\n    epic_name=$(basename $(dirname $(dirname \"$updates_dir\")))\n\n    if [ -f \"$updates_dir/progress.md\" ]; then\n      completion=$(grep \"^completion:\" \"$updates_dir/progress.md\" | head -1 | sed 's/^completion: *//')\n      [ -z \"$completion\" ] && completion=\"0%\"\n\n      # Get task name from the task file\n      task_file=\".claude/epics/$epic_name/$issue_num.md\"\n      if [ -f \"$task_file\" ]; then\n        task_name=$(grep \"^name:\" \"$task_file\" | head -1 | sed 's/^name: *//')\n      else\n        task_name=\"Unknown task\"\n      fi\n\n      echo \"📝 Issue #$issue_num - $task_name\"\n      echo \"   Epic: $epic_name\"\n      echo \"   Progress: $completion complete\"\n\n      # Check for recent updates\n      if [ -f \"$updates_dir/progress.md\" ]; then\n        last_update=$(grep \"^last_sync:\" \"$updates_dir/progress.md\" | head -1 | sed 's/^last_sync: *//')\n        [ -n \"$last_update\" ] && echo \"   Last update: $last_update\"\n      fi\n\n      echo \"\"\n      ((found++))\n    fi\n  done\nfi\n\n# Also check for in-progress epics\necho \"📚 Active Epics:\"\nfor epic_dir in .claude/epics/*/; do\n  [ -d \"$epic_dir\" ] || continue\n  [ -f \"$epic_dir/epic.md\" ] || continue\n\n  status=$(grep \"^status:\" \"$epic_dir/epic.md\" | head -1 | sed 's/^status: *//')\n  if [ \"$status\" = \"in-progress\" ] || [ \"$status\" = \"active\" ]; then\n    epic_name=$(grep \"^name:\" \"$epic_dir/epic.md\" | head -1 | sed 's/^name: *//')\n    progress=$(grep \"^progress:\" \"$epic_dir/epic.md\" | head -1 | sed 's/^progress: *//')\n    [ -z \"$epic_name\" ] && epic_name=$(basename \"$epic_dir\")\n    [ -z \"$progress\" ] && progress=\"0%\"\n\n    echo \"   • $epic_name - $progress complete\"\n  fi\ndone\n\necho \"\"\nif [ $found -eq 0 ]; then\n  echo \"No active work items found.\"\n  echo \"\"\n  echo \"💡 Start work with: /pm:next\"\nelse\n  echo \"📊 Total active items: $found\"\nfi\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/init.sh",
    "content": "#!/bin/bash\n\necho \"Initializing...\"\necho \"\"\necho \"\"\n\necho \" ██████╗ ██████╗██████╗ ███╗   ███╗\"\necho \"██╔════╝██╔════╝██╔══██╗████╗ ████║\"\necho \"██║     ██║     ██████╔╝██╔████╔██║\"\necho \"╚██████╗╚██████╗██║     ██║ ╚═╝ ██║\"\necho \" ╚═════╝ ╚═════╝╚═╝     ╚═╝     ╚═╝\"\n\necho \"┌─────────────────────────────────┐\"\necho \"│ Claude Code Project Management  │\"\necho \"│ by https://x.com/aroussi        │\"\necho \"└─────────────────────────────────┘\"\necho \"https://github.com/automazeio/ccpm\"\necho \"\"\necho \"\"\n\necho \"🚀 Initializing Claude Code PM System\"\necho \"======================================\"\necho \"\"\n\n# Check for required tools\necho \"🔍 Checking dependencies...\"\n\n# Check gh CLI\nif command -v gh &> /dev/null; then\n  echo \"  ✅ GitHub CLI (gh) installed\"\nelse\n  echo \"  ❌ GitHub CLI (gh) not found\"\n  echo \"\"\n  echo \"  Installing gh...\"\n  if command -v brew &> /dev/null; then\n    brew install gh\n  elif command -v apt-get &> /dev/null; then\n    sudo apt-get update && sudo apt-get install gh\n  else\n    echo \"  Please install GitHub CLI manually: https://cli.github.com/\"\n    exit 1\n  fi\nfi\n\n# Check gh auth status\necho \"\"\necho \"🔐 Checking GitHub authentication...\"\nif gh auth status &> /dev/null; then\n  echo \"  ✅ GitHub authenticated\"\nelse\n  echo \"  ⚠️ GitHub not authenticated\"\n  echo \"  Running: gh auth login\"\n  gh auth login\nfi\n\n# Check for gh-sub-issue extension\necho \"\"\necho \"📦 Checking gh extensions...\"\nif gh extension list | grep -q \"yahsan2/gh-sub-issue\"; then\n  echo \"  ✅ gh-sub-issue extension installed\"\nelse\n  echo \"  📥 Installing gh-sub-issue extension...\"\n  gh extension install yahsan2/gh-sub-issue\nfi\n\n# Create directory structure\necho \"\"\necho \"📁 Creating directory structure...\"\nmkdir -p .claude/prds\nmkdir -p .claude/epics\nmkdir -p .claude/rules\nmkdir -p .claude/agents\nmkdir -p .claude/scripts/pm\necho \"  ✅ Directories created\"\n\n# Copy scripts if in main repo\nif [ -d \"scripts/pm\" ] && [ ! \"$(pwd)\" = *\"/.claude\"* ]; then\n  echo \"\"\n  echo \"📝 Copying PM scripts...\"\n  cp -r scripts/pm/* .claude/scripts/pm/\n  chmod +x .claude/scripts/pm/*.sh\n  echo \"  ✅ Scripts copied and made executable\"\nfi\n\n# Check for git\necho \"\"\necho \"🔗 Checking Git configuration...\"\nif git rev-parse --git-dir > /dev/null 2>&1; then\n  echo \"  ✅ Git repository detected\"\n\n  # Check remote\n  if git remote -v | grep -q origin; then\n    remote_url=$(git remote get-url origin)\n    echo \"  ✅ Remote configured: $remote_url\"\n    \n    # Check if remote is the CCPM template repository\n    if [[ \"$remote_url\" == *\"automazeio/ccpm\"* ]] || [[ \"$remote_url\" == *\"automazeio/ccpm.git\"* ]]; then\n      echo \"\"\n      echo \"  ⚠️ WARNING: Your remote origin points to the CCPM template repository!\"\n      echo \"  This means any issues you create will go to the template repo, not your project.\"\n      echo \"\"\n      echo \"  To fix this:\"\n      echo \"  1. Fork the repository or create your own on GitHub\"\n      echo \"  2. Update your remote:\"\n      echo \"     git remote set-url origin https://github.com/YOUR_USERNAME/YOUR_REPO.git\"\n      echo \"\"\n    else\n      # Create GitHub labels if this is a GitHub repository\n      if gh repo view &> /dev/null; then\n        echo \"\"\n        echo \"🏷️ Creating GitHub labels...\"\n        \n        # Create base labels with improved error handling\n        epic_created=false\n        task_created=false\n        \n        if gh label create \"epic\" --color \"0E8A16\" --description \"Epic issue containing multiple related tasks\" --force 2>/dev/null; then\n          epic_created=true\n        elif gh label list 2>/dev/null | grep -q \"^epic\"; then\n          epic_created=true  # Label already exists\n        fi\n        \n        if gh label create \"task\" --color \"1D76DB\" --description \"Individual task within an epic\" --force 2>/dev/null; then\n          task_created=true\n        elif gh label list 2>/dev/null | grep -q \"^task\"; then\n          task_created=true  # Label already exists\n        fi\n        \n        # Report results\n        if $epic_created && $task_created; then\n          echo \"  ✅ GitHub labels created (epic, task)\"\n        elif $epic_created || $task_created; then\n          echo \"  ⚠️ Some GitHub labels created (epic: $epic_created, task: $task_created)\"\n        else\n          echo \"  ❌ Could not create GitHub labels (check repository permissions)\"\n        fi\n      else\n        echo \"  ℹ️ Not a GitHub repository - skipping label creation\"\n      fi\n    fi\n  else\n    echo \"  ⚠️ No remote configured\"\n    echo \"  Add with: git remote add origin <url>\"\n  fi\nelse\n  echo \"  ⚠️ Not a git repository\"\n  echo \"  Initialize with: git init\"\nfi\n\n# Create CLAUDE.md if it doesn't exist\nif [ ! -f \"CLAUDE.md\" ]; then\n  echo \"\"\n  echo \"📄 Creating CLAUDE.md...\"\n  cat > CLAUDE.md << 'EOF'\n# CLAUDE.md\n\n> Think carefully and implement the most concise solution that changes as little code as possible.\n\n## Project-Specific Instructions\n\nAdd your project-specific instructions here.\n\n## Testing\n\nAlways run tests before committing:\n- `npm test` or equivalent for your stack\n\n## Code Style\n\nFollow existing patterns in the codebase.\nEOF\n  echo \"  ✅ CLAUDE.md created\"\nfi\n\n# Summary\necho \"\"\necho \"✅ Initialization Complete!\"\necho \"==========================\"\necho \"\"\necho \"📊 System Status:\"\ngh --version | head -1\necho \"  Extensions: $(gh extension list | wc -l) installed\"\necho \"  Auth: $(gh auth status 2>&1 | grep -o 'Logged in to [^ ]*' || echo 'Not authenticated')\"\necho \"\"\necho \"🎯 Next Steps:\"\necho \"  1. Create your first PRD: /pm:prd-new <feature-name>\"\necho \"  2. View help: /pm:help\"\necho \"  3. Check status: /pm:status\"\necho \"\"\necho \"📚 Documentation: README.md\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/next.sh",
    "content": "#!/bin/bash\necho \"Getting status...\"\necho \"\"\necho \"\"\n\necho \"📋 Next Available Tasks\"\necho \"=======================\"\necho \"\"\n\n# Find tasks that are open and have no dependencies or whose dependencies are closed\nfound=0\n\nfor epic_dir in .claude/epics/*/; do\n  [ -d \"$epic_dir\" ] || continue\n  epic_name=$(basename \"$epic_dir\")\n\n  for task_file in \"$epic_dir\"/[0-9]*.md; do\n    [ -f \"$task_file\" ] || continue\n\n    # Check if task is open\n    status=$(grep \"^status:\" \"$task_file\" | head -1 | sed 's/^status: *//')\n    if [ \"$status\" != \"open\" ] && [ -n \"$status\" ]; then\n      continue\n    fi\n\n    # Check dependencies\n    deps_line=$(grep \"^depends_on:\" \"$task_file\" | head -1)\n    if [ -n \"$deps_line\" ]; then\n      deps=$(echo \"$deps_line\" | sed 's/^depends_on: *//' | sed 's/^\\[//' | sed 's/\\]$//' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')\n      [ -z \"$deps\" ] && deps=\"\"\n    else\n      deps=\"\"\n    fi\n\n    # If no dependencies or empty, task is available\n    if [ -z \"$deps\" ] || [ \"$deps\" = \"depends_on:\" ]; then\n      task_name=$(grep \"^name:\" \"$task_file\" | head -1 | sed 's/^name: *//')\n      task_num=$(basename \"$task_file\" .md)\n      parallel=$(grep \"^parallel:\" \"$task_file\" | head -1 | sed 's/^parallel: *//')\n\n      echo \"✅ Ready: #$task_num - $task_name\"\n      echo \"   Epic: $epic_name\"\n      [ \"$parallel\" = \"true\" ] && echo \"   🔄 Can run in parallel\"\n      echo \"\"\n      ((found++))\n    fi\n  done\ndone\n\nif [ $found -eq 0 ]; then\n  echo \"No available tasks found.\"\n  echo \"\"\n  echo \"💡 Suggestions:\"\n  echo \"  • Check blocked tasks: /pm:blocked\"\n  echo \"  • View all tasks: /pm:epic-list\"\nfi\n\necho \"\"\necho \"📊 Summary: $found tasks ready to start\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/prd-list.sh",
    "content": "# !/bin/bash\n# Check if PRD directory exists\nif [ ! -d \".claude/prds\" ]; then\n  echo \"📁 No PRD directory found. Create your first PRD with: /pm:prd-new <feature-name>\"\n  exit 0\nfi\n\n# Check for PRD files\nif ! ls .claude/prds/*.md >/dev/null 2>&1; then\n  echo \"📁 No PRDs found. Create your first PRD with: /pm:prd-new <feature-name>\"\n  exit 0\nfi\n\n# Initialize counters\nbacklog_count=0\nin_progress_count=0\nimplemented_count=0\ntotal_count=0\n\necho \"Getting PRDs...\"\necho \"\"\necho \"\"\n\n\necho \"📋 PRD List\"\necho \"===========\"\necho \"\"\n\n# Display by status groups\necho \"🔍 Backlog PRDs:\"\nfor file in .claude/prds/*.md; do\n  [ -f \"$file\" ] || continue\n  status=$(grep \"^status:\" \"$file\" | head -1 | sed 's/^status: *//')\n  if [ \"$status\" = \"backlog\" ] || [ \"$status\" = \"draft\" ] || [ -z \"$status\" ]; then\n    name=$(grep \"^name:\" \"$file\" | head -1 | sed 's/^name: *//')\n    desc=$(grep \"^description:\" \"$file\" | head -1 | sed 's/^description: *//')\n    [ -z \"$name\" ] && name=$(basename \"$file\" .md)\n    [ -z \"$desc\" ] && desc=\"No description\"\n    # echo \"   📋 $name - $desc\"\n    echo \"   📋 $file - $desc\"\n    ((backlog_count++))\n  fi\n  ((total_count++))\ndone\n[ $backlog_count -eq 0 ] && echo \"   (none)\"\n\necho \"\"\necho \"🔄 In-Progress PRDs:\"\nfor file in .claude/prds/*.md; do\n  [ -f \"$file\" ] || continue\n  status=$(grep \"^status:\" \"$file\" | head -1 | sed 's/^status: *//')\n  if [ \"$status\" = \"in-progress\" ] || [ \"$status\" = \"active\" ]; then\n    name=$(grep \"^name:\" \"$file\" | head -1 | sed 's/^name: *//')\n    desc=$(grep \"^description:\" \"$file\" | head -1 | sed 's/^description: *//')\n    [ -z \"$name\" ] && name=$(basename \"$file\" .md)\n    [ -z \"$desc\" ] && desc=\"No description\"\n    # echo \"   📋 $name - $desc\"\n    echo \"   📋 $file - $desc\"\n    ((in_progress_count++))\n  fi\ndone\n[ $in_progress_count -eq 0 ] && echo \"   (none)\"\n\necho \"\"\necho \"✅ Implemented PRDs:\"\nfor file in .claude/prds/*.md; do\n  [ -f \"$file\" ] || continue\n  status=$(grep \"^status:\" \"$file\" | head -1 | sed 's/^status: *//')\n  if [ \"$status\" = \"implemented\" ] || [ \"$status\" = \"completed\" ] || [ \"$status\" = \"done\" ]; then\n    name=$(grep \"^name:\" \"$file\" | head -1 | sed 's/^name: *//')\n    desc=$(grep \"^description:\" \"$file\" | head -1 | sed 's/^description: *//')\n    [ -z \"$name\" ] && name=$(basename \"$file\" .md)\n    [ -z \"$desc\" ] && desc=\"No description\"\n    # echo \"   📋 $name - $desc\"\n    echo \"   📋 $file - $desc\"\n    ((implemented_count++))\n  fi\ndone\n[ $implemented_count -eq 0 ] && echo \"   (none)\"\n\n# Display summary\necho \"\"\necho \"📊 PRD Summary\"\necho \"   Total PRDs: $total_count\"\necho \"   Backlog: $backlog_count\"\necho \"   In-Progress: $in_progress_count\"\necho \"   Implemented: $implemented_count\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/prd-status.sh",
    "content": "#!/bin/bash\n\necho \"📄 PRD Status Report\"\necho \"====================\"\necho \"\"\n\nif [ ! -d \".claude/prds\" ]; then\n  echo \"No PRD directory found.\"\n  exit 0\nfi\n\ntotal=$(ls .claude/prds/*.md 2>/dev/null | wc -l)\n[ $total -eq 0 ] && echo \"No PRDs found.\" && exit 0\n\n# Count by status\nbacklog=0\nin_progress=0\nimplemented=0\n\nfor file in .claude/prds/*.md; do\n  [ -f \"$file\" ] || continue\n  status=$(grep \"^status:\" \"$file\" | head -1 | sed 's/^status: *//')\n\n  case \"$status\" in\n    backlog|draft|\"\") ((backlog++)) ;;\n    in-progress|active) ((in_progress++)) ;;\n    implemented|completed|done) ((implemented++)) ;;\n    *) ((backlog++)) ;;\n  esac\ndone\n\necho \"Getting status...\"\necho \"\"\necho \"\"\n\n# Display chart\necho \"📊 Distribution:\"\necho \"================\"\n\necho \"\"\necho \"  Backlog:     $(printf '%-3d' $backlog) [$(printf '%0.s█' $(seq 1 $((backlog*20/total))))]\"\necho \"  In Progress: $(printf '%-3d' $in_progress) [$(printf '%0.s█' $(seq 1 $((in_progress*20/total))))]\"\necho \"  Implemented: $(printf '%-3d' $implemented) [$(printf '%0.s█' $(seq 1 $((implemented*20/total))))]\"\necho \"\"\necho \"  Total PRDs: $total\"\n\n# Recent activity\necho \"\"\necho \"📅 Recent PRDs (last 5 modified):\"\nls -t .claude/prds/*.md 2>/dev/null | head -5 | while read file; do\n  name=$(grep \"^name:\" \"$file\" | head -1 | sed 's/^name: *//')\n  [ -z \"$name\" ] && name=$(basename \"$file\" .md)\n  echo \"  • $name\"\ndone\n\n# Suggestions\necho \"\"\necho \"💡 Next Actions:\"\n[ $backlog -gt 0 ] && echo \"  • Parse backlog PRDs to epics: /pm:prd-parse <name>\"\n[ $in_progress -gt 0 ] && echo \"  • Check progress on active PRDs: /pm:epic-status <name>\"\n[ $total -eq 0 ] && echo \"  • Create your first PRD: /pm:prd-new <name>\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/search.sh",
    "content": "#!/bin/bash\n\nquery=\"$1\"\n\nif [ -z \"$query\" ]; then\n  echo \"❌ Please provide a search query\"\n  echo \"Usage: /pm:search <query>\"\n  exit 1\nfi\n\necho \"Searching for '$query'...\"\necho \"\"\necho \"\"\n\necho \"🔍 Search results for: '$query'\"\necho \"================================\"\necho \"\"\n\n# Search in PRDs\nif [ -d \".claude/prds\" ]; then\n  echo \"📄 PRDs:\"\n  results=$(grep -l -i \"$query\" .claude/prds/*.md 2>/dev/null)\n  if [ -n \"$results\" ]; then\n    for file in $results; do\n      name=$(basename \"$file\" .md)\n      matches=$(grep -c -i \"$query\" \"$file\")\n      echo \"  • $name ($matches matches)\"\n    done\n  else\n    echo \"  No matches\"\n  fi\n  echo \"\"\nfi\n\n# Search in Epics\nif [ -d \".claude/epics\" ]; then\n  echo \"📚 Epics:\"\n  results=$(find .claude/epics -name \"epic.md\" -exec grep -l -i \"$query\" {} \\; 2>/dev/null)\n  if [ -n \"$results\" ]; then\n    for file in $results; do\n      epic_name=$(basename $(dirname \"$file\"))\n      matches=$(grep -c -i \"$query\" \"$file\")\n      echo \"  • $epic_name ($matches matches)\"\n    done\n  else\n    echo \"  No matches\"\n  fi\n  echo \"\"\nfi\n\n# Search in Tasks\nif [ -d \".claude/epics\" ]; then\n  echo \"📝 Tasks:\"\n  results=$(find .claude/epics -name \"[0-9]*.md\" -exec grep -l -i \"$query\" {} \\; 2>/dev/null | head -10)\n  if [ -n \"$results\" ]; then\n    for file in $results; do\n      epic_name=$(basename $(dirname \"$file\"))\n      task_num=$(basename \"$file\" .md)\n      echo \"  • Task #$task_num in $epic_name\"\n    done\n  else\n    echo \"  No matches\"\n  fi\nfi\n\n# Summary\ntotal=$(find .claude -name \"*.md\" -exec grep -l -i \"$query\" {} \\; 2>/dev/null | wc -l)\necho \"\"\necho \"📊 Total files with matches: $total\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/standup.sh",
    "content": "#!/bin/bash\n\necho \"📅 Daily Standup - $(date '+%Y-%m-%d')\"\necho \"================================\"\necho \"\"\n\ntoday=$(date '+%Y-%m-%d')\n\necho \"Getting status...\"\necho \"\"\necho \"\"\n\necho \"📝 Today's Activity:\"\necho \"====================\"\necho \"\"\n\n# Find files modified today\nrecent_files=$(find .claude -name \"*.md\" -mtime -1 2>/dev/null)\n\nif [ -n \"$recent_files\" ]; then\n  # Count by type\n  prd_count=$(echo \"$recent_files\" | grep -c \"/prds/\" 2>/dev/null | tr -d '[:space:]')\n  epic_count=$(echo \"$recent_files\" | grep -c \"/epic.md\" 2>/dev/null | tr -d '[:space:]')\n  task_count=$(echo \"$recent_files\" | grep -c \"/[0-9]*.md\" 2>/dev/null | tr -d '[:space:]')\n  update_count=$(echo \"$recent_files\" | grep -c \"/updates/\" 2>/dev/null | tr -d '[:space:]')\n  prd_count=${prd_count:-0}; epic_count=${epic_count:-0}; task_count=${task_count:-0}; update_count=${update_count:-0}\n\n  [ \"$prd_count\" -gt 0 ] && echo \"  • Modified $prd_count PRD(s)\"\n  [ \"$epic_count\" -gt 0 ] && echo \"  • Updated $epic_count epic(s)\"\n  [ \"$task_count\" -gt 0 ] && echo \"  • Worked on $task_count task(s)\"\n  [ \"$update_count\" -gt 0 ] && echo \"  • Posted $update_count progress update(s)\"\nelse\n  echo \"  No activity recorded today\"\nfi\n\necho \"\"\necho \"🔄 Currently In Progress:\"\n# Show active work items\nfor updates_dir in .claude/epics/*/updates/*/; do\n  [ -d \"$updates_dir\" ] || continue\n  if [ -f \"$updates_dir/progress.md\" ]; then\n    issue_num=$(basename \"$updates_dir\")\n    epic_name=$(basename $(dirname $(dirname \"$updates_dir\")))\n    completion=$(grep \"^completion:\" \"$updates_dir/progress.md\" | head -1 | sed 's/^completion: *//')\n    echo \"  • Issue #$issue_num ($epic_name) - ${completion:-0%} complete\"\n  fi\ndone\n\necho \"\"\necho \"⏭️ Next Available Tasks:\"\n# Show top 3 available tasks\ncount=0\nfor epic_dir in .claude/epics/*/; do\n  [ -d \"$epic_dir\" ] || continue\n  for task_file in \"$epic_dir\"/[0-9]*.md; do\n    [ -f \"$task_file\" ] || continue\n    status=$(grep \"^status:\" \"$task_file\" | head -1 | sed 's/^status: *//')\n    if [ \"$status\" != \"open\" ] && [ -n \"$status\" ]; then\n      continue\n    fi\n\n    deps_line=$(grep \"^depends_on:\" \"$task_file\" | head -1)\n    if [ -n \"$deps_line\" ]; then\n      deps=$(echo \"$deps_line\" | sed 's/^depends_on: *//' | sed 's/^\\[//' | sed 's/\\]$//' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')\n      [ -z \"$deps\" ] && deps=\"\"\n    else\n      deps=\"\"\n    fi\n    if [ -z \"$deps\" ] || [ \"$deps\" = \"depends_on:\" ]; then\n      task_name=$(grep \"^name:\" \"$task_file\" | head -1 | sed 's/^name: *//')\n      task_num=$(basename \"$task_file\" .md)\n      echo \"  • #$task_num - $task_name\"\n      ((count++))\n      [ $count -ge 3 ] && break 2\n    fi\n  done\ndone\n\necho \"\"\necho \"📊 Quick Stats:\"\ntotal_tasks=$(find .claude/epics -name \"[0-9]*.md\" 2>/dev/null | wc -l)\nopen_tasks=$(find .claude/epics -name \"[0-9]*.md\" -exec grep -l \"^status: *open\" {} \\; 2>/dev/null | wc -l)\nclosed_tasks=$(find .claude/epics -name \"[0-9]*.md\" -exec grep -l \"^status: *closed\" {} \\; 2>/dev/null | wc -l)\necho \"  Tasks: $open_tasks open, $closed_tasks closed, $total_tasks total\"\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/status.sh",
    "content": "#!/bin/bash\n\necho \"Getting status...\"\necho \"\"\necho \"\"\n\n\necho \"📊 Project Status\"\necho \"================\"\necho \"\"\n\necho \"📄 PRDs:\"\nif [ -d \".claude/prds\" ]; then\n  total=$(ls .claude/prds/*.md 2>/dev/null | wc -l)\n  echo \"  Total: $total\"\nelse\n  echo \"  No PRDs found\"\nfi\n\necho \"\"\necho \"📚 Epics:\"\nif [ -d \".claude/epics\" ]; then\n  total=$(ls -d .claude/epics/*/ 2>/dev/null | grep -v '/archived/$' | wc -l)\n  echo \"  Total: $total\"\nelse\n  echo \"  No epics found\"\nfi\n\necho \"\"\necho \"📝 Tasks:\"\nif [ -d \".claude/epics\" ]; then\n  total=$(find .claude/epics -path \"*/archived/*\" -prune -o -name \"[0-9]*.md\" -print 2>/dev/null | wc -l)\n  open=$(find .claude/epics -path \"*/archived/*\" -prune -o -name \"[0-9]*.md\" -print 2>/dev/null | xargs grep -l \"^status: *open\" 2>/dev/null | wc -l)\n  closed=$(find .claude/epics -path \"*/archived/*\" -prune -o -name \"[0-9]*.md\" -print 2>/dev/null | xargs grep -l \"^status: *closed\" 2>/dev/null | wc -l)\n  echo \"  Open: $open\"\n  echo \"  Closed: $closed\"\n  echo \"  Total: $total\"\nelse\n  echo \"  No tasks found\"\nfi\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/scripts/validate.sh",
    "content": "#!/bin/bash\n\necho \"Validating PM System...\"\necho \"\"\necho \"\"\n\necho \"🔍 Validating PM System\"\necho \"=======================\"\necho \"\"\n\nerrors=0\nwarnings=0\n\n# Check directory structure\necho \"📁 Directory Structure:\"\n[ -d \".claude\" ] && echo \"  ✅ .claude directory exists\" || { echo \"  ❌ .claude directory missing\"; ((errors++)); }\n[ -d \".claude/prds\" ] && echo \"  ✅ PRDs directory exists\" || echo \"  ⚠️ PRDs directory missing\"\n[ -d \".claude/epics\" ] && echo \"  ✅ Epics directory exists\" || echo \"  ⚠️ Epics directory missing\"\n[ -d \".claude/rules\" ] && echo \"  ✅ Rules directory exists\" || echo \"  ⚠️ Rules directory missing\"\necho \"\"\n\n# Check for orphaned files\necho \"🗂️ Data Integrity:\"\n\n# Check epics have epic.md files\nfor epic_dir in .claude/epics/*/; do\n  [ -d \"$epic_dir\" ] || continue\n  if [ ! -f \"$epic_dir/epic.md\" ]; then\n    echo \"  ⚠️ Missing epic.md in $(basename \"$epic_dir\")\"\n    ((warnings++))\n  fi\ndone\n\n# Check for tasks without epics\norphaned=$(find .claude -name \"[0-9]*.md\" -not -path \".claude/epics/*/*\" 2>/dev/null | wc -l)\n[ $orphaned -gt 0 ] && echo \"  ⚠️ Found $orphaned orphaned task files\" && ((warnings++))\n\n# Check for broken references\necho \"\"\necho \"🔗 Reference Check:\"\n\nfor task_file in .claude/epics/*/[0-9]*.md; do\n  [ -f \"$task_file\" ] || continue\n\n  deps_line=$(grep \"^depends_on:\" \"$task_file\" | head -1)\n  if [ -n \"$deps_line\" ]; then\n    deps=$(echo \"$deps_line\" | sed 's/^depends_on: *//' | sed 's/^\\[//' | sed 's/\\]$//' | sed 's/,/ /g' | sed 's/^[[:space:]]*//' | sed 's/[[:space:]]*$//')\n    [ -z \"$deps\" ] && deps=\"\"\n  else\n    deps=\"\"\n  fi\n  if [ -n \"$deps\" ] && [ \"$deps\" != \"depends_on:\" ]; then\n    epic_dir=$(dirname \"$task_file\")\n    for dep in $deps; do\n      if [ ! -f \"$epic_dir/$dep.md\" ]; then\n        echo \"  ⚠️ Task $(basename \"$task_file\" .md) references missing task: $dep\"\n        ((warnings++))\n      fi\n    done\n  fi\ndone\n\nif [ $warnings -eq 0 ] && [ $errors -eq 0 ]; then\n  echo \"  ✅ All references valid\"\nfi\n\n# Check frontmatter\necho \"\"\necho \"📝 Frontmatter Validation:\"\ninvalid=0\n\nfor file in $(find .claude -name \"*.md\" -path \"*/epics/*\" -o -path \"*/prds/*\" 2>/dev/null); do\n  if ! grep -q \"^---\" \"$file\"; then\n    echo \"  ⚠️ Missing frontmatter: $(basename \"$file\")\"\n    ((invalid++))\n  fi\ndone\n\n[ $invalid -eq 0 ] && echo \"  ✅ All files have frontmatter\"\n\n# Summary\necho \"\"\necho \"📊 Validation Summary:\"\necho \"  Errors: $errors\"\necho \"  Warnings: $warnings\"\necho \"  Invalid files: $invalid\"\n\nif [ $errors -eq 0 ] && [ $warnings -eq 0 ] && [ $invalid -eq 0 ]; then\n  echo \"\"\n  echo \"✅ System is healthy!\"\nelse\n  echo \"\"\n  echo \"💡 Run /pm:clean to fix some issues automatically\"\nfi\n\nexit 0\n"
  },
  {
    "path": "skill/ccpm/references/structure.md",
    "content": "# Structure — Break Down an Epic\n\nThis phase converts a technical epic into concrete, numbered task files with dependency and parallelization metadata.\n\n---\n\n## Epic Decomposition\n\n**Trigger**: User wants to break an epic into actionable tasks.\n\n### Preflight\n- Verify `.claude/epics/<name>/epic.md` exists with valid frontmatter.\n- If numbered task files (001.md, 002.md...) already exist in the epic directory, list them and confirm deletion before recreating.\n- If epic status is \"completed\", warn the user before proceeding.\n\n### Process\n\nRead the epic fully. Analyze for parallelism — which pieces of work can happen simultaneously without file conflicts?\n\n**Task types to consider:**\n- Setup: environment, scaffolding, dependencies\n- Data: models, schemas, migrations\n- API: endpoints, services, integration\n- UI: components, pages, styling\n- Tests: unit, integration, e2e\n- Docs: README, API docs, changelogs\n\n**Parallelization strategy by epic size:**\n- Small (<5 tasks): create sequentially\n- Medium (5–10 tasks): batch into 2–3 groups, spawn parallel Task agents\n- Large (>10 tasks): analyze dependencies first, launch parallel agents (max 5 concurrent), create dependent tasks after prerequisites\n\nFor parallel creation, use the Task tool:\n```yaml\nTask:\n  description: \"Create task files batch N\"\n  subagent_type: \"general-purpose\"\n  prompt: |\n    Create task files for epic: <name>\n    Tasks to create: [list 3-4 tasks]\n    Save to: .claude/epics/<name>/001.md, 002.md, etc.\n    Follow the task file format exactly.\n    Return: list of files created.\n```\n\n### Task File Format\n\n```markdown\n---\nname: <Task Title>\nstatus: open\ncreated: <run: date -u +\"%Y-%m-%dT%H:%M:%SZ\">\nupdated: <same as created>\ngithub: (will be set on sync)\ndepends_on: []\nparallel: true\nconflicts_with: []\n---\n\n# Task: <Task Title>\n\n## Description\n\n## Acceptance Criteria\n- [ ]\n\n## Technical Details\n\n## Dependencies\n\n## Effort Estimate\n- Size: XS/S/M/L/XL\n- Hours: N\n\n## Definition of Done\n- [ ] Code implemented\n- [ ] Tests written and passing\n- [ ] Code reviewed\n```\n\n**Numbering**: sequential 001.md, 002.md, etc. Tasks are renamed to GitHub issue numbers after sync — do not hard-code dependencies by filename, use the `depends_on` array.\n\n### After Creating All Tasks\n\nAppend a summary to the epic file:\n\n```markdown\n## Tasks Created\n- [ ] 001.md - <Title> (parallel: true/false)\n- [ ] 002.md - <Title> (parallel: true/false)\n\nTotal tasks: N\nParallel tasks: N\nSequential tasks: N\nEstimated total effort: N hours\n```\n\n**After completion**: Confirm \"✅ Created N tasks for epic: <name>\" and suggest: \"Ready to push to GitHub? Say: sync the <name> epic\"\n\n---\n\n## Dependency Rules\n- `depends_on` lists task numbers that must complete before this task can start.\n- `parallel: true` means the task can run concurrently with others it doesn't conflict with.\n- `conflicts_with` lists tasks that touch the same files — these cannot run in parallel.\n- Circular dependencies are an error — check before finalizing.\n"
  },
  {
    "path": "skill/ccpm/references/sync.md",
    "content": "# Sync — Push to GitHub & Track Progress\n\nThis phase covers pushing local epics/tasks to GitHub as issues, syncing progress as comments, and closing issues when work is done.\n\n---\n\n## Repository Safety Check\n\n**Always run this before any GitHub write operation:**\n\n```bash\nremote_url=$(git remote get-url origin 2>/dev/null || echo \"\")\nif [[ \"$remote_url\" == *\"automazeio/ccpm\"* ]]; then\n  echo \"❌ Cannot sync to the CCPM template repository.\"\n  echo \"Update remote: git remote set-url origin https://github.com/YOUR/REPO.git\"\n  exit 1\nfi\nREPO=$(echo \"$remote_url\" | sed 's|.*github.com[:/]||' | sed 's|\\.git$||')\n```\n\n---\n\n## Epic Sync — Push Epic + Tasks to GitHub\n\n**Trigger**: User wants to push a local epic and its tasks to GitHub as issues.\n\n### Preflight\n- Verify `.claude/epics/<name>/epic.md` exists.\n- Verify numbered task files exist — if none: \"❌ No tasks to sync. Decompose the epic first.\"\n\n### Process\n\n**Step 1 — Create epic issue:**\n\nStrip frontmatter from epic.md, then:\n```bash\nsed '1,/^---$/d; 1,/^---$/d' .claude/epics/<name>/epic.md > /tmp/epic-body.md\nepic_number=$(gh issue create \\\n  --repo \"$REPO\" \\\n  --title \"Epic: <name>\" \\\n  --body-file /tmp/epic-body.md \\\n  --label \"epic,epic:<name>,feature\" \\\n  --json number -q .number)\n```\n\n**Step 2 — Create task sub-issues:**\n\nCheck if `gh-sub-issue` extension is available:\n```bash\nif gh extension list | grep -q \"yahsan2/gh-sub-issue\"; then\n  use_subissues=true\nfi\n```\n\nFor <5 tasks: create sequentially.\nFor ≥5 tasks: use parallel Task agents (3-4 tasks per batch).\n\nPer task:\n```bash\nsed '1,/^---$/d; 1,/^---$/d' <task_file> > /tmp/task-body.md\ntask_number=$(gh issue create \\\n  --repo \"$REPO\" \\\n  --title \"<task_name>\" \\\n  --body-file /tmp/task-body.md \\\n  --label \"task,epic:<name>\" \\\n  --json number -q .number)\n# or with sub-issues:\n# gh sub-issue create --parent $epic_number ...\n```\n\n**Step 3 — Rename task files and update references:**\n\nAfter all issues are created, rename `001.md` → `<issue_number>.md` and update all `depends_on`/`conflicts_with` arrays to use real issue numbers (not sequential numbers).\n\n```bash\n# Build old→new mapping, then for each task file:\nsed -i.bak \"s/\\b001\\b/<new_num_1>/g\" <file>  # repeat for each mapping\nmv 001.md <new_num>.md\n```\n\n**Step 4 — Update frontmatter:**\n```bash\ncurrent_date=$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\n# Update github: and updated: fields in epic.md and each task file\ngithub_url=\"https://github.com/$REPO/issues/<number>\"\nsed -i.bak \"/^github:/c\\\\github: $github_url\" <file>\nsed -i.bak \"/^updated:/c\\\\updated: $current_date\" <file>\nrm <file>.bak\n```\n\n**Step 5 — Create worktree for the epic:**\n```bash\ngit checkout main && git pull origin main\ngit worktree add ../epic-<name> -b epic/<name>\n```\n\n**Step 6 — Create github-mapping.md:**\n```markdown\n# GitHub Issue Mapping\nEpic: #<N> - https://github.com/<repo>/issues/<N>\nTasks:\n- #<N>: <title> - https://github.com/<repo>/issues/<N>\nSynced: <datetime>\n```\n\n**Output:**\n```\n✅ Synced epic <name> to GitHub\n  Epic: #<N>\n  Tasks: N sub-issues\n  Worktree: ../epic-<name>\n  Next: \"start working on issue <N>\" or \"start the <name> epic\"\n```\n\n---\n\n## Issue Sync — Post Progress to GitHub\n\n**Trigger**: User wants to sync local development progress to a GitHub issue as a comment.\n\n### Preflight\n- Verify issue exists: `gh issue view <N> --json state`\n- Check `.claude/epics/*/updates/<N>/` exists with a `progress.md` file.\n- Check `last_sync` in progress.md — if synced <5 minutes ago, confirm before proceeding.\n\n### Process\n\nGather updates from `.claude/epics/<epic>/updates/<N>/` (progress.md, notes.md, commits.md).\n\nFormat and post a comment:\n```bash\ngh issue comment <N> --body-file /tmp/update-comment.md\n```\n\nComment format:\n```markdown\n## 🔄 Progress Update - <date>\n\n### ✅ Completed Work\n### 🔄 In Progress\n### 📝 Technical Notes\n### 📊 Acceptance Criteria Status\n### 🚀 Next Steps\n### ⚠️ Blockers\n\n---\n*Progress: N% | Synced at <timestamp>*\n```\n\nAfter posting: update `last_sync` in progress.md frontmatter, update `updated` in the task file.\n\nAdd sync marker to local files to prevent duplicate comments:\n```markdown\n<!-- SYNCED: <datetime> -->\n```\n\n---\n\n## Closing an Issue\n\n**Trigger**: User marks a task complete.\n\n### Process\n\n1. Find the local task file (`.claude/epics/*/<N>.md`).\n2. Update frontmatter: `status: closed`, `updated: <now>`.\n3. Post completion comment:\n```bash\necho \"✅ Task completed — all acceptance criteria met.\" | gh issue comment <N> --body-file -\ngh issue close <N>\n```\n4. Check off the task in the epic issue body:\n```bash\ngh issue view <epic_N> --json body -q .body > /tmp/epic-body.md\nsed -i \"s/- \\[ \\] #<N>/- [x] #<N>/\" /tmp/epic-body.md\ngh issue edit <epic_N> --body-file /tmp/epic-body.md\n```\n5. Recalculate and update epic progress: `progress = closed_tasks / total_tasks * 100`\n\n---\n\n## Merging an Epic\n\n**Trigger**: User wants to merge a completed epic back to main.\n\n### Preflight\n- Verify worktree `../epic-<name>` exists.\n- Check for uncommitted changes in the worktree — block if dirty.\n- Warn if any task issues are still open.\n\n### Process\n\n```bash\n# From worktree: run project tests if detectable\ncd ../epic-<name>\n# detect and run: npm test / pytest / cargo test / go test / etc.\n\n# From main repo:\ngit checkout main && git pull origin main\ngit merge epic/<name> --no-ff -m \"Merge epic: <name>\"\ngit push origin main\n\n# Cleanup\ngit worktree remove ../epic-<name>\ngit branch -d epic/<name>\ngit push origin --delete epic/<name>\n\n# Archive\nmkdir -p .claude/epics/archived/\nmv .claude/epics/<name> .claude/epics/archived/\n\n# Close GitHub issues\nepic_issue=$(grep 'github:' .claude/epics/archived/<name>/epic.md | grep -oE '[0-9]+$')\ngh issue close $epic_issue -c \"Epic completed and merged to main\"\n```\n\nUpdate epic.md frontmatter: `status: completed`.\n\n---\n\n## Reporting a Bug Against a Completed Issue\n\n**Trigger**: User finds a bug while testing a completed or in-progress issue — e.g. \"found a bug in issue 42\", \"email validation is broken, came up while testing issue 42\".\n\nThe workflow should stay automated: create a linked bug task without losing context from the original issue.\n\n### Process\n\n**Step 1 — Read the original issue for context:**\n```bash\ngh issue view <original_N> --json title,body,labels\n```\nAlso read the local task file if it exists: `.claude/epics/*/<original_N>.md`\n\n**Step 2 — Create a local bug task file:**\n\n```markdown\n---\nname: Bug: <short description>\nstatus: open\ncreated: <run: date -u +\"%Y-%m-%dT%H:%M:%SZ\">\nupdated: <same>\ngithub: (will be set on sync)\ndepends_on: []\nparallel: false\nconflicts_with: []\nbug_for: <original_N>\n---\n\n# Bug: <short description>\n\n## Context\nFound while working on / testing issue #<original_N>: <original title>\n\n## Description\n<what's broken>\n\n## Steps to Reproduce\n<steps>\n\n## Expected vs Actual\n- Expected: \n- Actual: \n\n## Acceptance Criteria\n- [ ] Bug is fixed\n- [ ] Original issue #<original_N> behaviour is unaffected\n\n## Effort Estimate\n- Size: XS/S\n```\n\nSave to `.claude/epics/<same_epic_as_original>/bug-<original_N>-<slug>.md`\n\n**Step 3 — Create a linked GitHub issue:**\n```bash\ngh issue create \\\n  --repo \"$REPO\" \\\n  --title \"Bug: <short description>\" \\\n  --body \"$(cat /tmp/bug-body.md)\" \\\n  --label \"bug,epic:<epic_name>\" \\\n  --json number -q .number\n```\n\nThe issue body should open with `Fixes / follow-up to #<original_N>` so GitHub auto-links them.\n\n**Step 4 — Update the local file** with the GitHub issue number and rename to `<new_N>.md`.\n\n**Output:**\n```\n✅ Bug issue created: #<new_N> — \"Bug: <short description>\"\n  Linked to: #<original_N>\n  Epic: <epic_name>\n\nStart fixing it: \"start working on issue <new_N>\"\n```\n"
  },
  {
    "path": "skill/ccpm/references/track.md",
    "content": "# Track — Know Where Things Stand\n\nTracking operations use bash scripts directly for speed and consistency. The LLM is not needed for these — just run the script and present the output.\n\n---\n\n## Script-First Rule\n\nAll tracking operations have a corresponding bash script. Run the script; do not reconstruct the output manually.\n\nScripts live in `references/scripts/` relative to this skill, but need to run from the **project root** (where `.claude/` lives). Run them as:\n\n```bash\nbash <skill_path>/references/scripts/<script>.sh [args]\n```\n\nOr if ccpm is installed project-locally:\n```bash\nbash ccpm/scripts/pm/<script>.sh [args]\n```\n\n---\n\n## Project Status\n\n**Trigger**: \"what's our status\", \"project status\", \"overview\"\n\n```bash\nbash references/scripts/status.sh\n```\n\nShows: active epics, open issues count, recent activity.\n\n---\n\n## Standup Report\n\n**Trigger**: \"standup\", \"daily standup\", \"what did we do\", \"morning update\"\n\n```bash\nbash references/scripts/standup.sh\n```\n\nShows: what was completed yesterday, what's in progress today, any blockers.\n\n---\n\n## List Epics\n\n**Trigger**: \"list epics\", \"show epics\", \"what epics do we have\"\n\n```bash\nbash references/scripts/epic-list.sh\n```\n\n---\n\n## Show Epic Details\n\n**Trigger**: \"show the <name> epic\", \"epic details for <name>\"\n\n```bash\nbash references/scripts/epic-show.sh <name>\n```\n\n---\n\n## Epic Status\n\n**Trigger**: \"status of the <name> epic\", \"how far along is <name>\"\n\n```bash\nbash references/scripts/epic-status.sh <name>\n```\n\nShows: task completion breakdown, active agents, blocking issues.\n\n---\n\n## List PRDs\n\n**Trigger**: \"list PRDs\", \"what PRDs do we have\", \"show backlog\"\n\n```bash\nbash references/scripts/prd-list.sh\n```\n\n---\n\n## PRD Status\n\n**Trigger**: \"PRD status\", \"which PRDs are parsed\", \"what's in backlog\"\n\n```bash\nbash references/scripts/prd-status.sh\n```\n\n---\n\n## Search\n\n**Trigger**: \"search for <query>\", \"find issues about <topic>\", \"look for <term>\"\n\n```bash\nbash references/scripts/search.sh \"<query>\"\n```\n\nSearches local task files, PRDs, and epics for the query term.\n\n---\n\n## What's In Progress\n\n**Trigger**: \"what's in progress\", \"what are we working on\", \"active work\"\n\n```bash\nbash references/scripts/in-progress.sh\n```\n\n---\n\n## What's Next\n\n**Trigger**: \"what should I work on next\", \"what's next\", \"next priority\"\n\n```bash\nbash references/scripts/next.sh\n```\n\nShows highest-priority open tasks with no blocking dependencies.\n\n---\n\n## What's Blocked\n\n**Trigger**: \"what's blocked\", \"any blockers\", \"what can't we move on\"\n\n```bash\nbash references/scripts/blocked.sh\n```\n\n---\n\n## Validate Project State\n\n**Trigger**: \"validate\", \"check project state\", \"is everything consistent\"\n\n```bash\nbash references/scripts/validate.sh\n```\n\nChecks: frontmatter consistency, orphaned files, missing GitHub links, dependency integrity.\n\n---\n\n## When Scripts Fail\n\nIf a script fails or the output needs interpretation (e.g., an error in the output, or the user asks \"what does this mean\"), then step in to explain. But always run the script first — don't guess at what status/standup output would look like.\n\nIf `.claude/` directory doesn't exist at all, the project hasn't been initialized. Direct the user to run:\n```bash\nbash references/scripts/init.sh\n```\n"
  }
]