claude-code-session-manager 0.34.0 → 0.35.1
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.
- package/dist/assets/{TiptapBody-DWeWI8gw.js → TiptapBody-4v5sETwF.js} +1 -1
- package/dist/assets/index-1DFsiqCu.js +3534 -0
- package/dist/assets/index-CPTin6qz.css +32 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/plugins/session-manager-dev/.claude-plugin/plugin.json +1 -1
- package/plugins/session-manager-dev/skills/develop/SKILL.md +95 -10
- package/plugins/session-manager-dev/skills/explain-to-me/SKILL.md +1 -1
- package/src/main/__tests__/chat-cancel-terminal.test.cjs +89 -0
- package/src/main/chatRunner.cjs +47 -17
- package/src/main/lib/claudeBin.cjs +3 -0
- package/src/main/lib/toolUseClassify.cjs +19 -0
- package/src/main/scheduler.cjs +1 -1
- package/src/preload/api.d.ts +9 -0
- package/src/preload/index.cjs +5 -0
- package/dist/assets/index-C2m4dco8.css +0 -32
- package/dist/assets/index-CFT773vM.js +0 -3491
- package/plugins/session-manager-dev/skills/prd/SKILL.md +0 -134
|
@@ -1,134 +0,0 @@
|
|
|
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.
|