$npx -y skills add backnotprop/plannotator --skill plannotator-compoundAnalyze a user's Plannotator plan archive to extract denial patterns, feedback taxonomy, evolution over time, and actionable prompt improvements — then produce a polished HTML dashboard report. Falls back to Claude Code ExitPlanMode denial reasons when Plannotator data is unavail
| 1 | # Compound Planning Analysis |
| 2 | |
| 3 | You are conducting a comprehensive research analysis of a user's Plannotator plan |
| 4 | archive. The goal: extract patterns from their denied plans, reduce |
| 5 | them into actionable insights, and produce an elegant HTML dashboard report. |
| 6 | |
| 7 | This is a multi-phase process. Each phase must complete fully before the next begins. |
| 8 | Research integrity is paramount — every file must be read, no skipping. |
| 9 | |
| 10 | ## Source Selection |
| 11 | |
| 12 | Before starting the analysis, determine which data source is available. |
| 13 | |
| 14 | 1. **Plannotator mode (first-class)** — Determine the Plannotator data directory: |
| 15 | use `$PLANNOTATOR_DATA_DIR` if set, otherwise `~/.plannotator`. Check the |
| 16 | `plans/` subdirectory there. If it exists and contains `*-denied.md` files, |
| 17 | use this mode. The entire workflow below is written for Plannotator data. |
| 18 | |
| 19 | 2. **Claude Code fallback mode** — If the Plannotator archive is absent or |
| 20 | contains no denied plans, check `~/.claude/projects/`. If present, read |
| 21 | [references/claude-code-fallback.md](references/claude-code-fallback.md) |
| 22 | before continuing. That reference explains how to use the bundled parser at |
| 23 | [scripts/extract_exit_plan_mode_outcomes.py](scripts/extract_exit_plan_mode_outcomes.py) |
| 24 | to extract denial reasons from Claude Code JSONL transcripts. Every phase |
| 25 | below has a short note explaining what changes in fallback mode — the |
| 26 | reference file has the details. |
| 27 | |
| 28 | 3. **Neither available** — Ask the user for their Plannotator plans directory or |
| 29 | Claude Code projects directory. Do not guess. |
| 30 | |
| 31 | ## Phase 0: Locate Plans & Check for Previous Reports |
| 32 | |
| 33 | Use the mode chosen in Source Selection above. |
| 34 | |
| 35 | **Plannotator mode:** Verify the plans directory contains `*-denied.md` files. If |
| 36 | none exist, fall back to Claude Code mode before stopping. |
| 37 | |
| 38 | **Claude Code fallback mode:** Run the bundled parser per the fallback reference to |
| 39 | build the denial-reason dataset. Create `/tmp/compound-planning/` if needed. |
| 40 | |
| 41 | In either mode, proceed to Previous Report Detection below. |
| 42 | |
| 43 | ### Previous Report Detection |
| 44 | |
| 45 | After locating the plans directory, check for existing reports: |
| 46 | |
| 47 | ``` |
| 48 | ls ${PLANNOTATOR_DATA_DIR:-~/.plannotator}/plans/compound-planning-report*.html |
| 49 | ``` |
| 50 | |
| 51 | Reports follow a versioned naming scheme: |
| 52 | - First report: `compound-planning-report.html` |
| 53 | - Subsequent reports: `compound-planning-report-v2.html`, `compound-planning-report-v3.html`, etc. |
| 54 | |
| 55 | If one or more reports exist, determine the **latest** one (highest version number). |
| 56 | Get its filesystem modification date using `stat` (macOS: `stat -f %Sm -t %Y-%m-%d`, |
| 57 | Linux: `stat -c %y | cut -d' ' -f1`). This is the **cutoff date**. |
| 58 | |
| 59 | Present the user with a choice: |
| 60 | |
| 61 | > "I found a previous report (`compound-planning-report-v{N}.html`) last updated |
| 62 | > on {CUTOFF_DATE}. I can either: |
| 63 | > |
| 64 | > 1. **Incremental** — Only analyze files dated after {CUTOFF_DATE}, saving tokens |
| 65 | > and building on previous findings |
| 66 | > 2. **Full** — Re-analyze the entire archive from scratch |
| 67 | > |
| 68 | > Which would you prefer?" |
| 69 | |
| 70 | Wait for the user's response before proceeding. |
| 71 | |
| 72 | **If incremental:** Filter all subsequent phases to only process files with dates |
| 73 | after the cutoff date. The new report version will note in its header narrative that |
| 74 | it covers the period from {CUTOFF_DATE} to present, and reference the previous |
| 75 | report for earlier findings. The inventory (Phase 1) should still count ALL files |
| 76 | for overall stats, but clearly separate "new since last report" counts. |
| 77 | |
| 78 | **If full:** Proceed normally with all files, but still use the next version number |
| 79 | for the output filename. |
| 80 | |
| 81 | **If no previous report exists:** Proceed normally. The output filename will be |
| 82 | `compound-planning-report.html` (no version suffix for the first report). |
| 83 | |
| 84 | ## Phase 1: Inventory |
| 85 | |
| 86 | Count and report the dataset. **Always count ALL files** for overall stats, |
| 87 | regardless of whether this is an incremental or full run: |
| 88 | |
| 89 | ``` |
| 90 | - *-approved.md files (count) |
| 91 | - *-denied.md files (count) |
| 92 | - Date range (earliest to latest date found in filenames) |
| 93 | - Total days spanned |
| 94 | - Revision rate: denied / (approved + denied) — this is the "X% of plans |
| 95 | revised before coding" stat used in dashboard section 1 |
| 96 | ``` |
| 97 | |
| 98 | **Note:** Ignore `*.annotations.md` files entirely. Denied files already contain |
| 99 | the full plan text plus all reviewer feedback appended after a `---` separator. |
| 100 | Annotation files are redundant subsets of this content — reading both would |
| 101 | double-count feedback. |
| 102 | |
| 103 | **If incremental mode:** After the total counts, separately report the counts for |
| 104 | files dated after the cutoff date only: |
| 105 | |
| 106 | ``` |
| 107 | New since {CUTOFF_DATE}: |
| 108 | - *-denied.md files: X (of Y total) |
| 109 | - New date range: {CUTOFF_DATE} to {LATEST |