planr 0.0.1 → 1.1.16

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 (63) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +150 -0
  3. package/docs/ARCHITECTURE.md +75 -0
  4. package/docs/CI.md +54 -0
  5. package/docs/CLAUDE_CODE.md +33 -0
  6. package/docs/CLI_REFERENCE.md +126 -0
  7. package/docs/CODEX.md +48 -0
  8. package/docs/CURSOR.md +30 -0
  9. package/docs/GOALS.md +155 -0
  10. package/docs/HANDOFFS_AND_STORIES.md +121 -0
  11. package/docs/IMPORT.md +21 -0
  12. package/docs/INSTALL.md +113 -0
  13. package/docs/MCP_CONTRACT.md +70 -0
  14. package/docs/MCP_GUIDE.md +40 -0
  15. package/docs/NPM.md +40 -0
  16. package/docs/OPERATING_MODEL.md +250 -0
  17. package/docs/RELEASE.md +140 -0
  18. package/docs/SECURITY.md +8 -0
  19. package/docs/SKILLS.md +278 -0
  20. package/docs/TASK_GRAPH_MODEL.md +222 -0
  21. package/docs/TESTING.md +87 -0
  22. package/docs/TROUBLESHOOTING.md +26 -0
  23. package/docs/fixtures/mcp-contract.json +92 -0
  24. package/docs/planr-spec/ADRS.md +160 -0
  25. package/docs/planr-spec/AI_SPEC.md +138 -0
  26. package/docs/planr-spec/ANALYTICS_OBSERVABILITY_SPEC.md +124 -0
  27. package/docs/planr-spec/API_AND_DATA_MODEL.md +517 -0
  28. package/docs/planr-spec/BACKEND_IMPLEMENTATION_SPEC.md +178 -0
  29. package/docs/planr-spec/CLIENT_IMPLEMENTATION_SPEC.md +119 -0
  30. package/docs/planr-spec/DESIGN_SYSTEM_SPEC.md +102 -0
  31. package/docs/planr-spec/PRODUCT_SPEC.md +193 -0
  32. package/docs/planr-spec/QA_ACCEPTANCE_TESTS.md +146 -0
  33. package/docs/planr-spec/README.md +67 -0
  34. package/docs/planr-spec/REFERENCES.md +29 -0
  35. package/docs/planr-spec/RELEASE_READINESS.md +95 -0
  36. package/docs/planr-spec/SAFETY_PRIVACY_SECURITY.md +169 -0
  37. package/docs/planr-spec/TASKS.md +932 -0
  38. package/docs/planr-spec/TECH_ARCHITECTURE.md +143 -0
  39. package/docs/planr-spec/UX_FLOWS.md +235 -0
  40. package/docs/planr-spec/V1_1_DIFFERENTIATION_CONTRACT.md +177 -0
  41. package/docs/planr-spec.zip +0 -0
  42. package/npm/bin/planr.js +54 -0
  43. package/npm/native/darwin-arm64/planr +0 -0
  44. package/npm/native/darwin-x86_64/planr +0 -0
  45. package/npm/native/linux-arm64/planr +0 -0
  46. package/npm/native/linux-x86_64/planr +0 -0
  47. package/package.json +27 -8
  48. package/plugins/planr/.claude-plugin/plugin.json +11 -0
  49. package/plugins/planr/.codex-plugin/plugin.json +25 -0
  50. package/plugins/planr/agents/planr-reviewer.md +12 -0
  51. package/plugins/planr/agents/planr-worker.md +10 -0
  52. package/plugins/planr/skills/planr/SKILL.md +52 -0
  53. package/plugins/planr/skills/planr-goal/SKILL.md +69 -0
  54. package/plugins/planr/skills/planr-loop/SKILL.md +114 -0
  55. package/plugins/planr/skills/planr-loop/agents/planr-reviewer.toml +17 -0
  56. package/plugins/planr/skills/planr-loop/agents/planr-worker.toml +14 -0
  57. package/plugins/planr/skills/planr-plan/SKILL.md +58 -0
  58. package/plugins/planr/skills/planr-review/SKILL.md +51 -0
  59. package/plugins/planr/skills/planr-status/SKILL.md +50 -0
  60. package/plugins/planr/skills/planr-summary/SKILL.md +28 -0
  61. package/plugins/planr/skills/planr-task-graph/SKILL.md +228 -0
  62. package/plugins/planr/skills/planr-verify-web/SKILL.md +76 -0
  63. package/plugins/planr/skills/planr-work/SKILL.md +68 -0
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: planr-task-graph
3
+ description: Use Planr as the live local task graph for coding-agent coordination. Trigger when work needs project planning, build-plan splitting, map creation, dependency links, picking, log-backed closure, review gates, handoff context, interruption recovery, or multi-client coordination.
4
+ ---
5
+
6
+ # Planr Task Graph
7
+
8
+ Use `planr` as the canonical local coordination system for this repository.
9
+
10
+ Planr has two first-class layers:
11
+
12
+ - Markdown plans for product context, build scope, verification, and narrative decisions.
13
+ - SQLite map state for items, links, picks, runtime heartbeats, approvals, contexts, logs, reviews, runs, and closure.
14
+
15
+ The map is the source of truth for live state. Markdown explains scope and acceptance.
16
+
17
+ ## Start Here
18
+
19
+ Inspect the project and map before changing work:
20
+
21
+ ```bash
22
+ planr project show --json
23
+ planr map show --json
24
+ planr map lane --critical
25
+ planr map pressure
26
+ ```
27
+
28
+ If no project exists:
29
+
30
+ ```bash
31
+ planr project init "Project Name" --client all
32
+ planr doctor --client all
33
+ ```
34
+
35
+ ## Core Loop
36
+
37
+ Use one item at a time. The short path is two commands per step:
38
+
39
+ ```bash
40
+ planr pick --json
41
+ planr done <item-id> --summary "what changed" --files a --files b --cmd "exact verification command" --tests "exact test command" --review [--next]
42
+ ```
43
+
44
+ `pick --json` returns one flat work packet (item, links, logs, runtime, recovery, conditions, recall context, `remaining` progress); empty collections are omitted. `done` writes the completion log (test runs belong in `--tests`, build/serve commands in `--cmd`), requests review (`--review`, which moves the item to `in_review`) or closes directly, and `--next` picks the following item. Evidence logs refresh the heartbeat automatically.
45
+
46
+ For longer work, keep the live claim visible:
47
+
48
+ ```bash
49
+ planr pick progress <item-id> --percent 50 --note "tests running"
50
+ planr pick pause <item-id> --note "waiting for human input"
51
+ planr pick resume <item-id>
52
+ ```
53
+
54
+ Capture decisions and discoveries another agent may need:
55
+
56
+ ```bash
57
+ planr context add "decision or discovery" --item <item-id> --tag discovery
58
+ ```
59
+
60
+ Record evidence before review:
61
+
62
+ ```bash
63
+ planr log add --item <item-id> \
64
+ --summary "what changed" \
65
+ --files file-a,file-b \
66
+ --cmd "exact verification command"
67
+ ```
68
+
69
+ Granular alternative: request review, close review, then close the item:
70
+
71
+ ```bash
72
+ planr review request <item-id>
73
+ planr review close <review-id> --verdict complete --close-target
74
+ planr close <item-id> --summary "Verified with evidence"
75
+ ```
76
+
77
+ `--close-target` closes the reviewed item together with the review when the verdict is complete and a completion log exists; the separate `planr close` is then unnecessary.
78
+
79
+ If human approval is part of the gate, request it and do not close until it is approved:
80
+
81
+ ```bash
82
+ planr approval request <item-id> --reason "release approval"
83
+ planr approval list --open
84
+ ```
85
+
86
+ If review finds issues:
87
+
88
+ ```bash
89
+ planr review close <review-id> \
90
+ --verdict not-complete \
91
+ --findings "specific actionable finding"
92
+ planr map show --json
93
+ planr pick --json
94
+ ```
95
+
96
+ Planr creates fix and follow-up review work instead of pretending the parent item is done.
97
+
98
+ ## Planning Flow
99
+
100
+ For broad app or product work:
101
+
102
+ ```bash
103
+ planr plan new "App idea" --platform web --ai --backend
104
+ planr plan refine <plan-id> --note "Assumption or decision"
105
+ planr plan split <plan-id> --slice "MVP implementation"
106
+ planr plan check <build-plan-id>
107
+ planr map build --from <build-plan-id>
108
+ ```
109
+
110
+ Product plan work lists are candidates. They become live commitments only after `planr map build --from ...`.
111
+
112
+ `map build` creates items without ordering: everything starts ready. Linking is mandatory before the first pick — add a `blocks` link for every real execution dependency:
113
+
114
+ ```bash
115
+ planr link add <earlier-item> <later-item> --type blocks
116
+ planr map lane --critical
117
+ ```
118
+
119
+ Do not pick from a freshly built map that has zero links unless the items are genuinely independent.
120
+
121
+ ## Parent Gate Pattern
122
+
123
+ Model material changes as parent gates. The parent is the completion gate; linked children do the work.
124
+
125
+ Default shape:
126
+
127
+ ```text
128
+ parent gate
129
+ `- implementation or test child
130
+ `- review item linked to that child
131
+ |- pass -> child can close -> parent gate auto-closes
132
+ `- findings -> fix item -> follow-up review -> ...
133
+ ```
134
+
135
+ Rules:
136
+
137
+ - create a parent item for the change;
138
+ - use `planr item breakdown <parent-id> --into "Implement" --into "Verify"` (one `--into` per child; a single value may also pack newline- or comma-separated titles) to create chained child work under that parent — the output lists every child with id and status plus the next pick command;
139
+ - request review on the implementation or test child after evidence exists;
140
+ - if review finds issues, let Planr create fix and follow-up review work from the review verdict;
141
+ - make later top-level work depend on the parent gate, not only the first child.
142
+
143
+ Parent gates roll up on their own: when every child is settled, the gate auto-closes unless a review or approval on the gate itself is still open. Do not pick a parent gate as work; `planr pick` skips them.
144
+
145
+ ## Dependencies
146
+
147
+ Create ordering explicitly:
148
+
149
+ ```bash
150
+ planr item create "Design API" --description "Define endpoints and data ownership."
151
+ planr item create "Implement API" --description "Build endpoints after design is closed."
152
+ planr link add <design-item> <implementation-item> --type blocks
153
+ ```
154
+
155
+ Readiness comes from graph links and item state, not Markdown checkboxes.
156
+
157
+ Use:
158
+
159
+ ```bash
160
+ planr item breakdown <item-id> --into "Trace owner" --into "Implement" --into "Verify"
161
+ planr link remove <from-item> <to-item> --type blocks
162
+ ```
163
+
164
+ ## Handoff Evidence
165
+
166
+ Every closure must be evidence-backed:
167
+
168
+ - changed files through `--files`;
169
+ - commands through `--cmd`;
170
+ - tests through `--tests`;
171
+ - remaining risks through context, notes, or findings;
172
+ - review outcome through `planr review ...`.
173
+
174
+ Use task-local notes for nearby handoff:
175
+
176
+ ```bash
177
+ planr note add "Reviewer asked for an extra package dry-run before closure." --item <item-id>
178
+ ```
179
+
180
+ Use contexts for reusable project knowledge:
181
+
182
+ ```bash
183
+ planr context add "Do not edit global client config without explicit operator approval." --tag constraint
184
+ ```
185
+
186
+ Use a story log only when map state, logs, and contexts are too thin to preserve the decision chain. Story logs are narrative memory, not status authority.
187
+
188
+ ## Recovery
189
+
190
+ After interruption or handoff:
191
+
192
+ ```bash
193
+ git status --short
194
+ planr project show --json
195
+ planr map show --json
196
+ planr map lane --critical
197
+ planr map pressure
198
+ ```
199
+
200
+ Then inspect the item:
201
+
202
+ ```bash
203
+ planr trace item <item-id>
204
+ planr log list --item <item-id>
205
+ planr context list --item <item-id>
206
+ ```
207
+
208
+ If a stale pick must be reset:
209
+
210
+ ```bash
211
+ planr pick stale --older-than-seconds 900
212
+ planr pick stale --older-than-seconds 900 --release
213
+ planr pick release <item-id> --force
214
+ ```
215
+
216
+ ## Completion Rule
217
+
218
+ Do not call work complete until:
219
+
220
+ - required child and review items are closed;
221
+ - approval gates are approved or absent;
222
+ - log evidence exists;
223
+ - verification commands were actually run;
224
+ - review findings are closed or converted into follow-up work;
225
+ - `planr map show --json` shows no in-scope blocker;
226
+ - the user-facing summary matches map, logs, and review state.
227
+
228
+ For release-grade scopes, rerun the full verification ladder from the repository testing guide.
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: planr-verify-web
3
+ description: Live verification for web features. Use when a web map item needs proof it actually runs in a browser before review, including planr-loop step 4. Discovers the host's existing browser capability, runs the changed flow against the dev server, and logs replayable evidence. Ships no browser tooling of its own.
4
+ ---
5
+
6
+ # Planr Verify Web
7
+
8
+ Prove the feature runs. Planr owns the evidence contract; the host owns the browser tooling. Never install or configure browser infrastructure on behalf of this skill.
9
+
10
+ ## Capability Discovery
11
+
12
+ Check project memory first:
13
+
14
+ ```bash
15
+ planr context list
16
+ ```
17
+
18
+ If a `capability`-tagged entry records a web verification tool, use it. Otherwise discover what the host has, strongest first:
19
+
20
+ 1. A browser skill the host already provides (for example browser-harness): drive the real flow, screenshot the result.
21
+ 2. A browser MCP already configured (Playwright, chrome-devtools, native browser tools): same.
22
+ 3. The system browser over CDP: launch the installed Chrome/Chromium with `--remote-debugging-port=<port> --user-data-dir=<tmp>` and drive it via the DevTools protocol. This is the standard rescue when a browser tool exists but its bundled browser is missing — the tool's download step is not a dependency, the protocol is.
23
+ 4. A scriptable fallback when Node is available: a one-off headless check via `npx playwright` whose exit code is the signal.
24
+ 5. HTTP-level checks (`curl` against rendered routes or endpoints): weakest tier, only for SSR/API-shaped changes, and the log must say "HTTP-level only, not browser-verified".
25
+
26
+ If a tier fails for an environmental reason (missing download, sandbox restriction), drop to the next tier and record what actually worked — do not log the environmental failure as item evidence.
27
+
28
+ Record the decision once so later iterations and other agents reuse it instead of re-discovering:
29
+
30
+ ```bash
31
+ planr context add "web verification: <tool>, invoke via <how>" --tag capability
32
+ ```
33
+
34
+ A human may pin the capability upfront with the same command; a pinned context always wins over discovery.
35
+
36
+ ## Dev Server
37
+
38
+ Detect a running dev server before anything else and use it. Never start a second instance. Only start one (in the background, and stop it afterwards) when none is running and the loop is unattended.
39
+
40
+ ## Run The Verification
41
+
42
+ Exercise the flow the item changed — not the homepage. Interact, assert on rendered output, capture a screenshot when the tier supports it.
43
+
44
+ Then log evidence on the item:
45
+
46
+ ```bash
47
+ planr log add --item <item-id> --kind verification \
48
+ --summary "live verification (<tier>): <what was exercised and observed>" \
49
+ --cmd "<exact replayable command>"
50
+ ```
51
+
52
+ `--kind verification` marks the log as live-verify evidence; `planr plan audit` checks for it when a goal contract exists.
53
+
54
+ Attach screenshots or traces as artifacts on the item:
55
+
56
+ ```bash
57
+ planr artifact add "verify-web screenshot" --item <item-id> --path <screenshot-path> --kind screenshot
58
+ ```
59
+
60
+ The replay command is mandatory. The reviewer reruns it instead of trusting this run; a verification that cannot be replayed is not evidence.
61
+
62
+ ## When Verification Is Impossible
63
+
64
+ No capability, no Node, no reachable server: do not fake it and do not downgrade silently.
65
+
66
+ ```bash
67
+ planr context add "live verification blocked: <missing capability>" --item <item-id> --tag blocker
68
+ planr approval request <item-id> --reason "manual live verification required"
69
+ ```
70
+
71
+ Then pause (or let `planr-loop` pause) until a human resolves it.
72
+
73
+ ## Outcome
74
+
75
+ - Pass: evidence logged, proceed to `planr review request <item-id>`.
76
+ - Fail: the feature does not work — log the failing command and observed behavior, then fix under the same item before requesting review. A failed live run is a finding against the implementation, never a reason to weaken the check.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: planr-work
3
+ description: Execute one Planr map item to evidence-backed completion. Use after a task has been picked or when the next step is implementation, docs, tests, scripts, integration work, or a fix item.
4
+ ---
5
+
6
+ # Planr Work
7
+
8
+ Use this for one picked item at a time.
9
+
10
+ ## Workflow
11
+
12
+ Export your worker identity once per session so picks, logs, and heartbeats attribute to you instead of `client:host:user`:
13
+
14
+ ```bash
15
+ export PLANR_WORKER_ID=maker-1
16
+ planr pick --json
17
+ ```
18
+
19
+ The pick output is one flat work packet — item, links, logs, runtime, recovery, conditions, recall context (`upstream_handoffs`, `relevant_contexts`, `review_history`), and `remaining` progress. Each fact appears once; a missing key means "empty". No separate `trace item` call needed. Add `--work-type code` to skip review items when checker agents work the same board, and `--plan <plan-id>` when your dispatch names a plan so the lease stays inside that scope. A null pick explains itself: `{"item": null}` carries a `reason` (`all_settled`, `nothing_ready`, `ready_items_excluded_by_filter`) plus the `remaining` snapshot; when filters excluded ready work, `excluded` names each item and cause and `repair` carries the exact pick command to run instead. Read the linked plan/context, implement the smallest correct slice, then finish the step in one command:
20
+
21
+ ```bash
22
+ planr done <item-id> --summary "what changed" --files path-a --files path-b --cmd "exact verification command" --tests "exact test command" --review
23
+ ```
24
+
25
+ Put build/serve commands in `--cmd` and test runs in `--tests` — both are recorded as evidence. `done --review` writes the completion log, requests the review, and moves the item to `in_review` (you keep ownership; it is waiting on the gate, not abandoned); add `--next` to pick the following item in the same call. Without `--review` it closes the item directly (only for items that need no review gate). The response reports what your settlement `unlocked`, echoes the item's post condition, and hints when downstream work depends on an item closed without command/test evidence.
26
+
27
+ Live verification (browser flow, executed binary, real requests) gets its own log kind so `plan audit` can find it:
28
+
29
+ ```bash
30
+ planr log add --item <item-id> --kind verification --summary "verified <flow>: <observed outcome>" --cmd "<exact command>"
31
+ ```
32
+
33
+ Log persistent evidence, not transient noise: a failure you immediately fixed belongs in the final log's narrative, not as a standalone failure log. Only record a failure separately when it blocks the item.
34
+
35
+ Evidence logging refreshes the heartbeat automatically — a separate `planr pick heartbeat` is only needed for long silent stretches without logs.
36
+
37
+ The granular commands remain available when you need them:
38
+
39
+ ```bash
40
+ planr log add --item <item-id> --summary "..." --files a --files b --cmd "..."
41
+ planr review request <item-id>
42
+ planr close <item-id> --summary "Verified"
43
+ ```
44
+
45
+ For longer work, keep runtime state current:
46
+
47
+ ```bash
48
+ planr pick progress <item-id> --percent 50 --note "tests running"
49
+ planr pick pause <item-id> --note "waiting for human input"
50
+ planr pick resume <item-id>
51
+ ```
52
+
53
+ If a human approval gate is required, request it before close and wait for an approved decision:
54
+
55
+ ```bash
56
+ planr approval request <item-id> --reason "release approval"
57
+ planr approval list --open
58
+ ```
59
+
60
+ ## Rules
61
+
62
+ - Do not work on multiple picked items unless the user explicitly asks.
63
+ - Do not close without evidence.
64
+ - Do not treat a failed review as failure of the original item; let Planr create the fix and follow-up review chain.
65
+ - Do not close items with pending or denied approval.
66
+ - Use `planr context add ... --item <item-id>` for discoveries another client needs.
67
+ - Use `planr pick stale --older-than-seconds 900` before resetting abandoned ownership.
68
+ - Use `planr pick release <item-id> --force` only when ownership must be reset.