claude-code-session-manager 0.26.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/.claude-plugin/marketplace.json +21 -0
  2. package/dist/assets/{TiptapBody-BsI_35c5.js → TiptapBody-CJ6GK5CM.js} +1 -1
  3. package/dist/assets/index-DtQ4LzuV.js +3534 -0
  4. package/dist/assets/index-Dwb94Uxm.css +32 -0
  5. package/dist/index.html +2 -2
  6. package/package.json +3 -1
  7. package/plugins/session-manager-dev/.claude-plugin/plugin.json +19 -0
  8. package/plugins/session-manager-dev/skills/develop/SKILL.md +112 -0
  9. package/plugins/session-manager-dev/skills/develop/standards.md +67 -0
  10. package/plugins/session-manager-dev/skills/explain-to-me/SKILL.md +192 -0
  11. package/plugins/session-manager-dev/skills/explain-to-me/assets/style-reference.html +163 -0
  12. package/plugins/session-manager-dev/skills/local-project-health/SKILL.md +58 -0
  13. package/plugins/session-manager-dev/skills/my-feedback/SKILL.md +132 -0
  14. package/plugins/session-manager-dev/skills/optimize-kpi/SKILL.md +289 -0
  15. package/plugins/session-manager-dev/skills/prd/SKILL.md +134 -0
  16. package/plugins/session-manager-dev/skills/process-feedback/SKILL.md +183 -0
  17. package/plugins/session-manager-dev/skills/project-status/SKILL.md +244 -0
  18. package/plugins/session-manager-dev/skills/requesting-code-review/SKILL.md +105 -0
  19. package/plugins/session-manager-dev/skills/requesting-code-review/code-reviewer.md +146 -0
  20. package/plugins/session-manager-dev/skills/security-review/SKILL.md +105 -0
  21. package/src/main/__tests__/scheduler-autofix-select.test.cjs +95 -0
  22. package/src/main/__tests__/scheduler-autopromote.test.cjs +33 -0
  23. package/src/main/hives.cjs +96 -36
  24. package/src/main/scheduler.cjs +135 -11
  25. package/src/main/templates/PRD_AUTHORING.md +316 -0
  26. package/src/preload/api.d.ts +8 -7
  27. package/dist/assets/index-BKkf6gtA.css +0 -32
  28. package/dist/assets/index-C61eFtxs.js +0 -3525
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: prd
3
+ description: >-
4
+ Write a PRD for the session-manager scheduler queue (the right place for
5
+ token-budget-managed work). Use this whenever the user says "make this a PRD",
6
+ "queue this up", "add to the scheduler", or asks for a PRD without specifying a
7
+ target location. Keywords: prd, queue, scheduler, scheduled-plans, token budget.
8
+ ---
9
+
10
+ # /prd — author one scheduler PRD
11
+
12
+ **Role:** `/prd` is the single authority on one PRD's *structure, location, and scope sizing*. It does not own the engineering rules (that's `standards.md`) and does not decompose a large ask into multiple PRDs (that's `/develop`). Never restate rules that live in `standards.md` — reference and append them.
13
+
14
+ You are writing a PRD that will be executed by the user's session-manager scheduler — a system that runs `claude -p <prd-body> --dangerously-skip-permissions` jobs around 5-hour token-window resets, with auto-pause on rate-limit and auto-resume.
15
+
16
+ ## Canonical location — non-negotiable
17
+
18
+ PRDs MUST be written to:
19
+
20
+ ```
21
+ ~/.claude/session-manager/scheduled-plans/prds/<NN>-<kebab-slug>.md
22
+ ```
23
+
24
+ **Anywhere else doesn't get scheduled.** If you write to `data/prds/`, `docs/prds/`, or the project root, the scheduler will not see it and the user loses their token-budget-managed execution. There is exactly one queue for all projects — that's intentional, because the 5-hour token budget is global across all of the user's Claude work. The `~` expands to `os.homedir()` so the same convention works for any user on any machine.
25
+
26
+ ## Filename rules
27
+
28
+ - `NN` is the **parallel group** (2-digit zero-padded). Jobs in the same group run in parallel up to a concurrency cap; groups run serially. Pick `NN` by reading the existing files in `~/.claude/session-manager/scheduled-plans/prds/` and choosing:
29
+ - The same `NN` as a sibling that's logically independent and can run in parallel.
30
+ - The next unused `NN` if this PRD has a hard dependency on prior work landing first.
31
+ - `<kebab-slug>` is a short, descriptive kebab-case identifier (e.g. `voice-commands-send-cancel`, `ticker-velocity-mcp`). Keep under 60 chars.
32
+
33
+ Compute the current max `NN` **deterministically** before writing — do NOT eyeball the `ls` or narrow the pattern (a grep like `'^10[0-9]'` silently misses `110+` and overwrites/mis-groups a PRD):
34
+
35
+ ```bash
36
+ ls ~/.claude/session-manager/scheduled-plans/prds/ | grep -oE '^[0-9]+' | sort -n | uniq | tail -5
37
+ ```
38
+
39
+ The last line is the highest in use; the next free group is **max+1**. Use that for an independent/dependent PRD, or reuse a specific sibling's `NN` only when you deliberately want it in that parallel group. Verify your chosen filename doesn't already exist before writing.
40
+
41
+ ## Required frontmatter
42
+
43
+ ```yaml
44
+ ---
45
+ title: <one-line human-readable title>
46
+ cwd: <path to target project — where claude -p will run>
47
+ estimateMinutes: <integer wall-clock estimate>
48
+ ---
49
+ ```
50
+
51
+ `cwd` is critical. Without it the job runs in the scheduler's default cwd (session-manager). Always set it to the path of the project the work targets. **Write it as `~/Projects/<repo>`** — the parser expands `~` to `os.homedir()` at ingest, so the same PRD works on Linux and macOS. Avoid hardcoding an absolute home path (`/home/<you>/Projects/<repo>`); it breaks on any machine with a different home directory.
52
+
53
+ ## Required body sections (in this order)
54
+
55
+ ```markdown
56
+ # Goal
57
+
58
+ <2-4 sentences. What the executor will build and why it matters. NO "as a user I want to" framing. Concrete: name the function, the file, the user-visible change.>
59
+
60
+ # Acceptance criteria
61
+
62
+ - [ ] <each line is a verifiable check the executor can run after building>
63
+ - [ ] <include explicit file paths, function names, expected behavior>
64
+ - [ ] a bounded test command passes, e.g. `timeout 300 npm run typecheck` / `pytest -x` / `cargo check` (the run-before-done / never-end-on-red rule lives in standards.md → Execution discipline; the AC just has to name the command).
65
+
66
+ # Implementation notes
67
+
68
+ <file paths the executor will need to read first; the architectural pattern to follow; any non-obvious constraints. Be specific. Quote function signatures if it saves the executor a Read call.>
69
+
70
+ # Out of scope
71
+
72
+ <short bulleted list of what NOT to build, to prevent scope creep>
73
+ ```
74
+
75
+ ## Self-containment is load-bearing
76
+
77
+ The executor (`claude -p`) starts with NO conversation context — only this PRD body and the project files. So:
78
+
79
+ - Include exact file paths (`src/main/index.cjs:142`).
80
+ - Quote function signatures or relevant code blocks if the executor would have to grep for them.
81
+ - Name the libraries / patterns to use (e.g. "use the existing `validatePath` helper in `config.cjs`").
82
+ - Don't reference "the conversation we just had" or "the design we discussed."
83
+ - If the PRD depends on another PRD's output, say so in `# Implementation notes` AND give it a higher `NN` so it queues after.
84
+
85
+ ## Scope sizing — keep it SMALL (data-driven, 2026-06)
86
+
87
+ Across 400+ real runs the median PRD finishes in **~7 minutes**, p90 **~21 min**, p99 **~66 min** — yet authored `estimateMinutes` ran **5–8× too high**. Oversized scoping is the root problem: it anchors PRDs too big and pushes them into the rare >60-min tail where ~100% of true hangs live (deploy poll-loops, unbounded e2e suites).
88
+
89
+ - **Target ~15 minutes of wall-clock work per PRD. Hard ceiling ~30 min — if you project more, SPLIT** into sequential `NN` PRDs and document the dependency in each.
90
+ - Set `estimateMinutes` realistically: **p50≈8, p90≈21**. Don't write 60/90 — it's almost always wrong and it hides real outliers.
91
+ - Each execution costs ~$0.50–$2; the 5-hour token window is global. Smaller PRDs = smaller blast radius when a run is rate-limited, timed out, or killed.
92
+ - **`rateLimited` exit-1 is NOT a failure** — it's the scheduler's designed auto-pause; the job auto-resumes at the next window reset. Don't add retry logic for it.
93
+
94
+ ## Execution discipline — append it, don't restate it
95
+
96
+ The runtime rules (bound every command, verify-before-done, fail-loud, stay-in-AC,
97
+ negative-assertion-exits-0) have a single home: the **Execution discipline** section of
98
+ `~/.claude/skills/develop/standards.md`. Don't paraphrase them here — they drift.
99
+
100
+ Long hangs — not bad code — are the dominant *real* failure (the watchdog only fires at 4
101
+ hours, so an unbounded command burns hours), so these rules are load-bearing and MUST reach
102
+ the headless executor in the PRD body:
103
+
104
+ - If this PRD is being authored **via `/develop`**, that skill already appends `standards.md`
105
+ verbatim — nothing to do here.
106
+ - If you are authoring a PRD **directly** (`/prd` alone), **append the Execution discipline
107
+ section from `standards.md` to the PRD body** (under an `## Execution discipline` heading)
108
+ before queueing. That is the only way the bounded-command / verify-before-done rules reach
109
+ `claude -p`.
110
+
111
+ The one rule worth echoing inline because it shapes the AC: **wrap every test/build/deploy/poll
112
+ command in a hard timeout** (`timeout 300 npm run typecheck`, `timeout 120 npx playwright test
113
+ one.spec.ts` — shard e2e to one spec, never a full suite; `curl --max-time 15`; bound any
114
+ `until/while`). Never queue a publish that polls an endpoint until a condition — the #1 hang
115
+ offender (PRD_AUTHORING §1/§5).
116
+
117
+ ## Workflow
118
+
119
+ 1. Read existing PRDs in `~/.claude/session-manager/scheduled-plans/prds/` to pick `NN`.
120
+ 2. Write the file with the structure above.
121
+ 3. Confirm to the user:
122
+ - The filename (so they can see it queued).
123
+ - The chosen `parallelGroup` (NN) and the rationale (parallel-with-X / serial-after-Y).
124
+ - The chosen `cwd` (so they can correct if it's wrong).
125
+ - Estimated wall time + a token-cost ballpark.
126
+ 4. Tell the user the PRD will fire when the scheduler's policy says — they can click "Run now" in the SchedulePanel to execute immediately, or wait for `when-available` polling.
127
+
128
+ ## What NOT to do
129
+
130
+ - Don't write the PRD to `data/prds/`, `docs/prds/`, the project's own folder, or anywhere outside the canonical path. The user has explicitly flagged this as a recurring problem.
131
+ - Don't combine multiple unrelated features into one PRD. Each PRD is one focused, completable unit.
132
+ - Don't add a parallelGroup field to the frontmatter — the scheduler reads the filename prefix.
133
+ - Don't leave `cwd` unset hoping for the default. Be explicit.
134
+ - Don't write the PRD body inline in the chat for review *before* writing the file. Write the file directly, then confirm. The user wants the PRD queued, not draft-reviewed in chat.
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: process-feedback
3
+ description: >-
4
+ Process the current project's inbound feedback folder end-to-end: read every
5
+ open item, evaluate it against real code, and for work that belongs to this
6
+ project queue it as scheduled PRDs via /develop (never implement inline) —
7
+ then track those PRDs to completion, archive the item as processed, and fold
8
+ lessons back into the folder's README so future feedback (written by other
9
+ agents/projects) gets better. Use whenever the user says "/process-feedback",
10
+ "review the feedback folder", "work through the feedback", "any open
11
+ feedback?", or drops new files into feedback/. Keywords: feedback, intake,
12
+ external-feedback, cross-project requests, process feedback, triage feedback.
13
+ model: opus
14
+ ---
15
+
16
+ # process-feedback
17
+
18
+ **Role:** the *agent-side intake* for the dev pipeline — the project-to-project complement of
19
+ an interactive human prompt. It evaluates inbound feedback, dispatches the codeable parts to
20
+ `/develop` (the shared pipeline), and owns the feedback-specific bookkeeping (status log,
21
+ RESOLUTION, archive). It does **not** implement, and it does **not** re-specify how PRDs are
22
+ tracked — that lives once, in `/develop` Phase 2.
23
+
24
+ Work the project's intra-project feedback intake (`feedback/` at the repo root;
25
+ some projects name it `external-feedback/`). Each file is a request from an
26
+ upstream/downstream service in the same stack (e.g. Burrow ⇄ signal-builder ⇄
27
+ social-signals-trader). The folder's own `README.md` is the authority on file
28
+ conventions — read it first; the steps below are the process.
29
+
30
+ **Core principle:** this skill *triages and dispatches*; it does not implement.
31
+ Anything that requires writing code for this project is decomposed and queued as
32
+ scheduled PRDs through **`/develop`**, which runs them headlessly on the
33
+ session-manager scheduler. process-feedback then watches those PRDs to
34
+ completion and does the bookkeeping. Implementing feedback inline — bypassing
35
+ the scheduler — is the one thing this skill must not do.
36
+
37
+ ## Steps
38
+
39
+ ### 0. Quick-exit — bail in milliseconds if there's nothing to do
40
+
41
+ **Do this first, cheaply, before reading any code or spawning anything.** This
42
+ skill is run on a schedule across many projects (the scheduler's feedback sweep),
43
+ so the empty case must cost almost nothing:
44
+
45
+ - If neither `feedback/` nor `external-feedback/` exists → report
46
+ "no feedback intake in `<project>`" and **EXIT**.
47
+ - If the folder exists but holds **no open item** (every file is in `processed/`
48
+ or marked ✅/archived; nothing open/🆕) → report "no open feedback in
49
+ `<project>`" and **EXIT immediately**. Do NOT read source, evaluate, or start
50
+ an agent loop.
51
+ - Only when at least one **open** item exists do you continue — an open item
52
+ means *someone cares about this project*, so it's worth the full pass (and,
53
+ per step 7, leaving the README better for next time).
54
+
55
+ ### 1. Read the intake
56
+
57
+ - Read `feedback/README.md` (conventions + the status log), then every file
58
+ whose status is open/🆕. Skip files already ✅/archived. Items already 🛠
59
+ (queued — see step 4) are in flight: don't re-queue them, just re-check their
60
+ PRD status (step 5).
61
+ - If the folder doesn't exist, say so and stop — don't invent one.
62
+
63
+ ### 2. Evaluate before queueing
64
+
65
+ For each open item, verify the claims against current code and live data —
66
+ feedback cites the state of the world when it was written, which may have
67
+ drifted. Then classify each ask:
68
+
69
+ - **Ours, do it** — the fix belongs to this project. → goes to `/develop`
70
+ (step 3). Do NOT write the code here.
71
+ - **Ours, decline** — conflicts with the project's contracts/vision (e.g. a
72
+ convenience ask that violates a service boundary). Decline explicitly in the
73
+ RESOLUTION with the reason; never silently skip. Resolved now (no code) →
74
+ close immediately in step 4.
75
+ - **Theirs, forward** — the root cause lives in another service. Do NOT reach
76
+ across the boundary to hack around it; file a feedback/PRD item in *that*
77
+ project's intake folder and reference it (use `/my-feedback to <project>`).
78
+ Resolved now (no code in *this* repo) → close immediately in step 4.
79
+
80
+ Root-cause with evidence (logs, live queries, health checks), not from the
81
+ file's narrative alone — the reporter sees symptoms, you can see causes.
82
+
83
+ ### 3. Queue the work via /develop (never implement inline)
84
+
85
+ For every **Ours, do it** item, invoke the **`develop`** skill to turn the ask
86
+ into one or more self-contained PRDs in the scheduler queue. Hand `/develop` a
87
+ complete brief so it does not have to re-ask scope — your step-2 evaluation
88
+ already established it:
89
+
90
+ - The goal, in this-project terms.
91
+ - **Acceptance criteria taken from the feedback's own AC**, made verifiable
92
+ (with the test/health command to prove them).
93
+ - The absolute `cwd`, plus the exact files/patterns/utilities to reuse that you
94
+ found while root-causing (the API-reuse standard — don't make the headless run
95
+ rediscover them).
96
+ - Any constraints, service boundaries, or "out of scope" lines.
97
+
98
+ `/develop` owns decomposition (small ~15-min PRDs), inlining the engineering
99
+ standards, the `NN-` parallel grouping, and — because each PRD publishes its own
100
+ work — the implementation **commit + deploy**. That means process-feedback does
101
+ **not** commit implementation code; the PRDs do, when they run.
102
+
103
+ Record the emitted PRD filenames/ids — you need them for steps 4–6.
104
+
105
+ ### 4. Interim bookkeeping — commit the triage now
106
+
107
+ Two cases:
108
+
109
+ - **Closed-without-code** items (declines, upstream forwards): append a full
110
+ `## RESOLUTION` (what was declined and why / what was forwarded where, with the
111
+ upstream file id), flip the README row to ✅, and `git mv` the file to
112
+ `feedback/processed/` — these are done.
113
+ - **Queued** items (sent to `/develop`): append a `## RESOLUTION (in progress)`
114
+ recording the queued PRD filenames/ids and that execution is pending the
115
+ scheduler. Flip the README row to **🛠 queued** (add 🛠 to the log's legend if
116
+ absent) — **not** ✅. Leave the file in `feedback/` until the PRDs land. Do not
117
+ fabricate verification for code that hasn't run yet.
118
+
119
+ Commit only this feedback bookkeeping + any upstream filings (message references
120
+ the feedback file id, e.g. `chore(feedback): triage + queue 2026-06-10-01`).
121
+ Only commit a clean, green tree; if unrelated in-flight work is mixed into the
122
+ working tree, stop and tell the user instead of committing around it.
123
+
124
+ ### 5. Track to completion — delegate to /develop Phase 2
125
+
126
+ The queued PRDs run headlessly and can take a while. **Do not re-implement the
127
+ monitor here** — `/develop` Phase 2 already owns it (the 30-min scheduler watch,
128
+ the escalate-on-stuck/`needs_review`/timeout logic, and the live verification
129
+ against each PRD's acceptance criteria). When you call `/develop` in step 3, that
130
+ tracking runs as part of it.
131
+
132
+ Your only job in this step is to consume its outcome per queued item:
133
+
134
+ - **`/develop` escalated a PRD** (failed / stuck / needs attention) — relay it to
135
+ the user with its specifics; leave the feedback item at 🛠 (still in flight)
136
+ until it's resolved or re-queued. Don't archive a broken item as done.
137
+ - **`/develop` reported all of an item's PRDs landed + verified** — proceed to
138
+ step 6 to finalize that item's bookkeeping.
139
+
140
+ ### 6. Finalize the archive (when an item's PRDs land + verify)
141
+
142
+ Once `/develop` Phase 2 reports an item's PRDs merged and verified against the AC:
143
+
144
+ - Append the final `## RESOLUTION`: what changed, the PRD/commit refs, what was
145
+ declined/forwarded, and how `/develop` verified it (cite its gate result —
146
+ don't re-run the verification it already did).
147
+ - Flip the README row **🛠 → ✅** (keep the row — the log is the durable index).
148
+ - `git mv` the file to `feedback/processed/` (create the dir if needed). Closed
149
+ items live there as the durable record; only files entered in error are ever
150
+ deleted.
151
+ - Commit the bookkeeping.
152
+
153
+ ### 7. Self-improve the intake (always do this)
154
+
155
+ Update the folder's `README.md` guidance section based on what this round
156
+ taught you:
157
+
158
+ - What made an item easy to queue + close? Distill it into a bullet other agents
159
+ can imitate (cite the file as the example) — e.g. a feedback item that already
160
+ carried a crisp, testable AC turned straight into a clean PRD.
161
+ - What slowed you down — a missing log path, an unverifiable claim, an ask that
162
+ actually belonged to a third service, a PRD that got stuck? Add the
163
+ counter-guidance.
164
+ - Keep the section calibrated and short: merge/rewrite stale bullets rather than
165
+ appending forever.
166
+
167
+ This step is the point of the skill: every processing pass should make the
168
+ *next* pass cheaper.
169
+
170
+ ## Guardrails
171
+
172
+ - **Never implement feedback inline.** Code that belongs to this project goes
173
+ through `/develop` → the scheduler. The only commits process-feedback makes
174
+ itself are feedback bookkeeping and upstream filings.
175
+ - **Never mark a queued item ✅ or move it to `processed/` before its PRDs land
176
+ and verify.** Queued ≠ done; 🛠 is the honest interim state. An item archived
177
+ as resolved must point to merged, verified work.
178
+ - Never delete feedback files to "clear" the folder — archive them.
179
+ - Service boundaries outrank feedback asks: an item that requests a boundary
180
+ violation gets a documented decline + an upstream filing, not compliance.
181
+ - Report honestly in the RESOLUTION: PRDs that failed or stalled, asks left
182
+ open, deps on other teams. An archived item with open external deps should say
183
+ what unblocks it.
@@ -0,0 +1,244 @@
1
+ ---
2
+ name: project-status
3
+ model: opus
4
+ description: >-
5
+ GLOBAL FRAMEWORK for one operational status rollup of the project in the
6
+ current working directory — defines the contract (what a status report must
7
+ contain, in what order, on which model) and DELEGATES the project-specific
8
+ measurement to that project's own `project-status-local` skill. Use whenever
9
+ the user asks "what's the project status", "/project-status", "how is this
10
+ project doing", "are the jobs healthy", or wants a one-shot status rollup for
11
+ the repo they're in. Keywords: project status, KPI, north-star, crons, jobs,
12
+ last run, health, rollup, ops.
13
+ ---
14
+
15
+ # project-status — global framework
16
+
17
+ This is the **global framework**, not an implementation. It owns the *contract*
18
+ (what a status rollup must contain, the order, the presentation, the model
19
+ expectation) and **delegates** the project-specific *how* to the project's own
20
+ `project-status-local` skill.
21
+
22
+ > **Two skills, no name collision (by design).**
23
+ > `project-status` (this, global) = the framework/expectations.
24
+ > `project-status-local` (per project) = the implementation.
25
+ > They have **different names on purpose** — a project must NOT ship a second
26
+ > skill also named `project-status`, because a same-name skill silently shadows
27
+ > this one and drops everything it defines (that is exactly how the model
28
+ > fallback got lost once). Each project ships exactly one `project-status-local`.
29
+
30
+ ## What to do when invoked
31
+
32
+ First decide **scope**: one project (the current repo) or several (the user named
33
+ multiple repos, said "all my projects", or wants a cross-project board).
34
+
35
+ ### Single project (the cwd)
36
+
37
+ 1. **Delegate if a local exists.** If a `project-status-local` skill is available
38
+ in the current project (it appears in the available-skills list), **invoke it**
39
+ (Skill tool, `skill: project-status-local`). It owns the specifics — which KPI
40
+ command to run, which crons are this project's, which health entrypoint to
41
+ call. Present its output; if it omits an element of the contract below, fill
42
+ the gap or note it.
43
+ 2. **Otherwise run the generic fallback inline** (the flow at the bottom) and, at
44
+ the end, **offer to scaffold a `project-status-local`** for this repo so the
45
+ next run is project-aware.
46
+
47
+ Do not re-implement a project's specifics here — that belongs in its
48
+ `project-status-local`.
49
+
50
+ ### Multiple projects (parallel fan-out)
51
+
52
+ The whole point of the framework/`-local` split: the per-project work is
53
+ **independent**, so run it **concurrently** — one project's KPI/crons/health
54
+ never depends on another's.
55
+
56
+ 1. **Resolve the project list.** Use the repos the user named; for "all", or to
57
+ discover them, enumerate every repo that ships a local skill:
58
+ ```bash
59
+ for d in ~/Projects/*/.claude/skills/project-status-local/SKILL.md; do
60
+ [ -f "$d" ] && echo "${d%/.claude/skills/project-status-local/SKILL.md}"
61
+ done
62
+ ```
63
+ 2. **Fan out one agent per project — in a SINGLE message with multiple `Agent`
64
+ tool calls** so they run in parallel (sequential calls would defeat the
65
+ purpose). Each agent (`subagent_type: general-purpose`) gets a prompt like:
66
+ > `cd <ABS_REPO_PATH>`. Produce this repo's status rollup by executing its
67
+ > own `project-status-local`: **read** `.claude/skills/project-status-local/SKILL.md`
68
+ > and run its steps (they are deterministic — a `brief.py`/analyzer call, a
69
+ > `crontab -l | grep` for its crons, its `scripts/health.sh`). If the repo has
70
+ > no `project-status-local`, follow the generic contract (KPI→chores→health)
71
+ > using its `CLAUDE.md` + crontab + health entrypoint. Return a **compact**
72
+ > rollup (≤12 lines): the project name, the 7d North-Star line (KPI vs
73
+ > benchmark → alpha), the health color, and the single worst ❌/⚠️ chore.
74
+ Let each agent **inherit the model** (omit `model`) — it just runs the repo's
75
+ commands; this framework's `model: opus` governs *this* turn.
76
+ 3. **Aggregate** the returned rollups into one board: a lead table
77
+ (Project · 7d KPI · Health · Worst signal), RED/❌ projects first, then each
78
+ project's detail block beneath. Note any agent that failed to produce a rollup
79
+ (missing repo, broken local) rather than dropping it silently.
80
+
81
+ Why agents, not the Skill tool, for the others: skill availability is bound to
82
+ the launch repo, so `project-status-local` is only directly invokable for the
83
+ **current** project. For other repos the agent reproduces the local by reading +
84
+ running it (it is deterministic bash), which works from any cwd.
85
+
86
+ ## The contract (what every report must satisfy)
87
+
88
+ Order — **1. North-Star KPI (last 7d) → 2. Chores (crons) → 3. Logs & usage
89
+ patterns → 4. Health verdict.** Lead with the KPI line and the single worst
90
+ ❌/⚠️ chore or health signal; detail after. Keep it tight; relay engine/analyzer
91
+ output rather than re-deriving numbers by hand.
92
+
93
+ A status check is an **audit**, not just a liveness ping — it reads the project's
94
+ *operational logs* (are the runs clean or throwing?) and its *usage/consumption
95
+ patterns* (who consumes the product's outputs, how often, which surfaces are hot
96
+ vs dead) alongside the KPI and crons. The KPI says "is the output valuable," the
97
+ logs+usage say "is the machine actually being used, and is it healthy under that
98
+ use." Both dimensions belong in every report.
99
+
100
+ - **KPI (the intro):** the metric the project's `CLAUDE.md` mission statement
101
+ names as optimized (a `## North-Star KPI` / `## Objective` section, usually
102
+ linking a definition doc or a measurement command). Measure it over a trailing
103
+ 7-day window with the project's own command; state it with the
104
+ benchmark/target the section defines. If `CLAUDE.md` declares no KPI, say so
105
+ plainly (it belongs in the mission statement) and use a git/activity summary
106
+ for the intro — never invent a metric.
107
+ - **Chores:** only THIS project's cron jobs (match by repo name / absolute path),
108
+ each with last-run time, recent result, and an error count, in a table:
109
+ Job · Schedule · Purpose · Last run · Errors · Last result. Staleness: newest
110
+ log line older than ~2× cadence ⇒ ⚠️ overdue; an installed cron with an
111
+ empty/missing log ⇒ ❌ (often a Vixie-cron `TZ=` inline-prefix drop — fix with a
112
+ standalone `TZ=` line). Market-hours-only jobs stale overnight is expected.
113
+ - **Logs & usage patterns:** two sub-parts, both delegated to the `-local` for
114
+ *where the data lives*, but expected in every report:
115
+ - **Logs** — scan the recent operational logs for error/warning rates,
116
+ tracebacks, timeouts, and silent-stall signatures (a job that "ran ok" but
117
+ did no work). Surface counts + the worst recent line, not just last-exit.
118
+ - **Usage / consumption** — how the project's *outputs* are actually consumed:
119
+ per-endpoint/-tool invocation counts, the consumer/tenant breakdown, and
120
+ hot-vs-cold surfaces over a trailing window. This answers "is what we built
121
+ being used, and by whom" — the dimension a KPI alone misses. The `-local`
122
+ names the source (a usage/metering store, an access log, or a proxy like a
123
+ panel/history table); if no usage source exists yet, say so and recommend
124
+ standing one up rather than inventing numbers.
125
+ - **Health verdict:** run the project's own health entrypoint (first hit wins:
126
+ `scripts/health.sh` · `.claude/health.sh` · `bin/health.sh` · a `health`
127
+ Make/just target) and relay its GREEN/YELLOW/RED rollup. A non-zero exit for
128
+ YELLOW/RED is expected, not a skill failure; only a crash is.
129
+
130
+ ## After the audit — route findings, then improve (the loop)
131
+
132
+ A status check shouldn't dead-end at a report. Once the four dimensions are in,
133
+ **act on what the audit surfaced** — this is what makes `/project-status` a
134
+ self-contained *bootstrap → evaluate → improve* loop, usable even on a brand-new
135
+ project.
136
+
137
+ **First, work the inbox — triage before generating new work.** Right after the
138
+ audit, clear the inbound queue via **`/process-feedback`**: it evaluates any
139
+ pending feedback (cross-project asks others filed to us, plus the prior cycle's
140
+ `/optimize-kpi` item) and routes each — ours-do-it → `/develop`, theirs →
141
+ `/my-feedback`, decline-with-reason. Don't generate new levers on top of an
142
+ unprocessed backlog. (If the inbox is empty, say so and move on.)
143
+
144
+ Then route **this audit's own findings**, by ownership:
145
+
146
+ 1. **A finding that belongs to another project** (an upstream/downstream service
147
+ in the stack — e.g. the data source is stale, a contract drifted): do NOT
148
+ reach across the boundary. File it with **`/my-feedback <project>`** into that
149
+ project's intake, and note it in the report. (Same rule as everywhere: service
150
+ boundaries outrank convenience.)
151
+ 2. **A finding that belongs to THIS project** (a real bug, a missing guard, an
152
+ enhancement the audit revealed — a cold sold-surface, a recurring error in the
153
+ logs, a usage gap): queue it as a scheduled PRD via **`/develop`** — never
154
+ implement it inline here. Record the queued PRD id in the report.
155
+ 3. **Nothing actionable** — just report.
156
+
157
+ Then, the improvement gate: **if and only if the full health verdict is GREEN**
158
+ (every check passing — not degraded, not down) **and** the KPI/crons are clean,
159
+ invoke **`/optimize-kpi`** to drive the next North-Star improvement. The green gate
160
+ is load-bearing: optimizing the KPI on a broken or degraded base is wasted
161
+ motion — *fix health first* (via routes 1/2 above), and let a later run, once
162
+ green, trigger the optimizer. State explicitly in the report whether the gate
163
+ opened (green → optimize queued) or stayed shut (degraded/down → health findings
164
+ routed first).
165
+
166
+ This sequence — audit → route findings (my-feedback / develop) → optimize-when-green
167
+ — is enough to bootstrap, evaluate, and continuously improve a project from a
168
+ single `/project-status` invocation. The `-local` owns the *specifics* of each
169
+ step; this framework owns the *loop*.
170
+
171
+ ## Model expectation (every local must mirror this)
172
+
173
+ This framework runs on **`model: opus`** (Opus 4.8) — a status check is reasoning
174
+ work that should run on the strongest model. **Every `project-status-local` MUST
175
+ carry the same single-value `model: opus` frontmatter line**, so a direct
176
+ `/project-status-local` invocation runs on Opus too. A local that omits it loses
177
+ the override and runs on whatever the session model happens to be.
178
+
179
+ > **Syntax matters — this is a real, documented field.** Skill frontmatter
180
+ > `model:` takes a **single** value (the same aliases as `/model`: `opus`,
181
+ > `sonnet`, `haiku`, `fable`, or a full id like `claude-opus-4-8`). It does NOT
182
+ > accept a comma-separated fallback chain — `model: opus,sonnet` is an invalid
183
+ > value and silently fails to apply (the skill then runs on the session model,
184
+ > not Opus). Graceful failover to Sonnet is configured **at the session level**,
185
+ > not per-skill, via `fallbackModel` in settings:
186
+ > `"fallbackModel": ["opus", "sonnet"]` in `~/.claude/settings.json`. Per the
187
+ > Claude Code docs, a skill's `model:` override applies for the rest of the
188
+ > current turn and reverts to the session model on the next prompt.
189
+
190
+ ## Scaffolding a new `project-status-local` — establish the framework with the user
191
+
192
+ When a project has none, **do not silently guess the implementation.** The whole
193
+ point of the framework/`-local` split is that every project's report covers the
194
+ **same four dimensions** (KPI · chores · logs+usage · health) — so the parent's job
195
+ on a missing `-local` is to *establish those expectations with the user*, then
196
+ write a complete local. Run a short **Q&A** (use `AskUserQuestion`, batching the
197
+ gaps you couldn't auto-detect) to pin down each contract dimension:
198
+
199
+ 1. **Probe first, ask only the gaps.** Read `CLAUDE.md` (KPI section?), the
200
+ crontab (this repo's jobs + their log paths?), the repo for a health entrypoint
201
+ (`scripts/health.sh` etc.), and for a usage source (a metering/access-log store,
202
+ or a proxy table). Auto-fill what you can find.
203
+ 2. **Ask the user to confirm/supply the rest**, one question per unresolved
204
+ dimension:
205
+ - **KPI** — what is this project's North-Star metric + the command that measures
206
+ it over 7d? (If `CLAUDE.md` has no `## North-Star KPI` section, offer to add
207
+ one — the KPI belongs in the mission statement, not only the skill.)
208
+ - **Chores** — which crons are this project's, and where do their logs live?
209
+ - **Logs & usage** — which logs carry the operational signal, and **what is the
210
+ usage/consumption source** (a metering store / access log / proxy)? If none
211
+ exists, flag it and offer to stand one up — a project with no usage telemetry
212
+ can't answer "is what we built being used."
213
+ - **Health** — the health entrypoint + how to read its verdict.
214
+ 3. **Write the local** `<repo>/.claude/skills/project-status-local/SKILL.md` with
215
+ frontmatter `name: project-status-local`, `model: opus` (single value — see the
216
+ syntax note above; `fallbackModel` owns failover), a project-specific
217
+ `description`, and a body implementing **all four** contract dimensions against
218
+ the answers — so the next `/project-status` here is project-aware and consistent
219
+ with every other project's report.
220
+
221
+ This Q&A is the deliberate "pain" that makes cross-project reports comparable:
222
+ each `-local` is the *same contract*, filled with that project's specifics.
223
+
224
+ ## Generic fallback flow (no local present)
225
+
226
+ Run inline only when the project ships no `project-status-local`:
227
+
228
+ 1. **Current time:** `date '+%Y-%m-%d %H:%M %Z'` (for staleness judgment).
229
+ 2. **KPI:** read `./CLAUDE.md`, find the North-Star section, run its measurement
230
+ command over 7 days, and state the headline. No KPI section ⇒ say so + git
231
+ summary.
232
+ 3. **Chores:** `crontab -l | grep -F "$(basename "$PWD")" | grep -v '^\s*#'`
233
+ (widen/narrow if the cron path differs from the dir name); for each job
234
+ `ls -la <log>` + `tail -n 8 <log>` + an `ERROR|Traceback|failed|exception`
235
+ count; render the chores table.
236
+ 4. **Logs & usage:** scan recent logs for error/warning rates + silent stalls;
237
+ look for a usage/consumption source (a metering store, an access log, or a
238
+ request/history table) and summarize per-surface invocation + consumer
239
+ patterns over a trailing window. If none exists, say so and recommend standing
240
+ one up — don't invent usage numbers.
241
+ 5. **Health:** run the project's health entrypoint and relay the rollup; if none
242
+ exists, infer from KPI + chores and offer to create `scripts/health.sh`.
243
+ 6. Lead with the 7d KPI line and the worst chore/health/usage signal. Then offer
244
+ to scaffold a `project-status-local` (Q&A above) so the next run is consistent.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: requesting-code-review
3
+ description: Use when completing tasks, implementing major features, or before merging to verify work meets requirements
4
+ ---
5
+
6
+ # Requesting Code Review
7
+
8
+ Dispatch superpowers:code-reviewer subagent to catch issues before they cascade.
9
+
10
+ **Core principle:** Review early, review often.
11
+
12
+ ## When to Request Review
13
+
14
+ **Mandatory:**
15
+ - After each task in subagent-driven development
16
+ - After completing major feature
17
+ - Before merge to main
18
+
19
+ **Optional but valuable:**
20
+ - When stuck (fresh perspective)
21
+ - Before refactoring (baseline check)
22
+ - After fixing complex bug
23
+
24
+ ## How to Request
25
+
26
+ **1. Get git SHAs:**
27
+ ```bash
28
+ BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
29
+ HEAD_SHA=$(git rev-parse HEAD)
30
+ ```
31
+
32
+ **2. Dispatch code-reviewer subagent:**
33
+
34
+ Use Task tool with superpowers:code-reviewer type, fill template at `code-reviewer.md`
35
+
36
+ **Placeholders:**
37
+ - `{WHAT_WAS_IMPLEMENTED}` - What you just built
38
+ - `{PLAN_OR_REQUIREMENTS}` - What it should do
39
+ - `{BASE_SHA}` - Starting commit
40
+ - `{HEAD_SHA}` - Ending commit
41
+ - `{DESCRIPTION}` - Brief summary
42
+
43
+ **3. Act on feedback:**
44
+ - Fix Critical issues immediately
45
+ - Fix Important issues before proceeding
46
+ - Note Minor issues for later
47
+ - Push back if reviewer is wrong (with reasoning)
48
+
49
+ ## Example
50
+
51
+ ```
52
+ [Just completed Task 2: Add verification function]
53
+
54
+ You: Let me request code review before proceeding.
55
+
56
+ BASE_SHA=$(git log --oneline | grep "Task 1" | head -1 | awk '{print $1}')
57
+ HEAD_SHA=$(git rev-parse HEAD)
58
+
59
+ [Dispatch superpowers:code-reviewer subagent]
60
+ WHAT_WAS_IMPLEMENTED: Verification and repair functions for conversation index
61
+ PLAN_OR_REQUIREMENTS: Task 2 from docs/plans/deployment-plan.md
62
+ BASE_SHA: a7981ec
63
+ HEAD_SHA: 3df7661
64
+ DESCRIPTION: Added verifyIndex() and repairIndex() with 4 issue types
65
+
66
+ [Subagent returns]:
67
+ Strengths: Clean architecture, real tests
68
+ Issues:
69
+ Important: Missing progress indicators
70
+ Minor: Magic number (100) for reporting interval
71
+ Assessment: Ready to proceed
72
+
73
+ You: [Fix progress indicators]
74
+ [Continue to Task 3]
75
+ ```
76
+
77
+ ## Integration with Workflows
78
+
79
+ **Subagent-Driven Development:**
80
+ - Review after EACH task
81
+ - Catch issues before they compound
82
+ - Fix before moving to next task
83
+
84
+ **Executing Plans:**
85
+ - Review after each batch (3 tasks)
86
+ - Get feedback, apply, continue
87
+
88
+ **Ad-Hoc Development:**
89
+ - Review before merge
90
+ - Review when stuck
91
+
92
+ ## Red Flags
93
+
94
+ **Never:**
95
+ - Skip review because "it's simple"
96
+ - Ignore Critical issues
97
+ - Proceed with unfixed Important issues
98
+ - Argue with valid technical feedback
99
+
100
+ **If reviewer wrong:**
101
+ - Push back with technical reasoning
102
+ - Show code/tests that prove it works
103
+ - Request clarification
104
+
105
+ See template at: requesting-code-review/code-reviewer.md