planr 1.7.0 → 1.7.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.
Files changed (62) hide show
  1. package/README.md +46 -22
  2. package/docs/ARCHITECTURE.md +3 -2
  3. package/docs/RELEASE.md +37 -7
  4. package/docs/SWITCHLOOM_COMPATIBILITY.md +46 -0
  5. package/docs/documentation/CONTRACT.md +7 -7
  6. package/docs/documentation/COVERAGE.md +5 -3
  7. package/docs/documentation/INFORMATION_ARCHITECTURE.md +5 -2
  8. package/npm/native/darwin-arm64/planr +0 -0
  9. package/npm/native/darwin-x86_64/planr +0 -0
  10. package/npm/native/linux-arm64/planr +0 -0
  11. package/npm/native/linux-x86_64/planr +0 -0
  12. package/package.json +2 -1
  13. package/plugins/planr/.claude-plugin/plugin.json +1 -1
  14. package/plugins/planr/.codex-plugin/plugin.json +1 -1
  15. package/plugins/planr/agents/planr-worker.md +1 -1
  16. package/plugins/planr/skills/planr-goal/SKILL.md +21 -49
  17. package/plugins/planr/skills/planr-loop/SKILL.md +28 -94
  18. package/plugins/planr/skills/planr-loop/agents/planr-worker.md +1 -1
  19. package/plugins/planr/skills/planr-loop/references/host-dispatch.md +10 -0
  20. package/plugins/planr/skills/planr-loop/references/recovery-and-verification.md +24 -0
  21. package/plugins/planr/skills/planr-task-graph/SKILL.md +21 -190
  22. package/docs/CI.md +0 -55
  23. package/docs/CLAUDE_CODE.md +0 -52
  24. package/docs/CLI_REFERENCE.md +0 -170
  25. package/docs/CODEX.md +0 -56
  26. package/docs/CURSOR.md +0 -114
  27. package/docs/EXAMPLE_WEBAPP.md +0 -103
  28. package/docs/GOALS.md +0 -175
  29. package/docs/HANDOFFS_AND_STORIES.md +0 -121
  30. package/docs/HOOKS.md +0 -34
  31. package/docs/IMPORT.md +0 -23
  32. package/docs/INSTALL.md +0 -115
  33. package/docs/MCP_CONTRACT.md +0 -78
  34. package/docs/MCP_GUIDE.md +0 -40
  35. package/docs/MODEL_ROUTING.md +0 -33
  36. package/docs/NPM.md +0 -40
  37. package/docs/OPERATING_MODEL.md +0 -250
  38. package/docs/ROUTING_BUNDLES.md +0 -15
  39. package/docs/SECURITY.md +0 -8
  40. package/docs/SKILLS.md +0 -261
  41. package/docs/TASK_GRAPH_MODEL.md +0 -272
  42. package/docs/TESTING.md +0 -87
  43. package/docs/TROUBLESHOOTING.md +0 -30
  44. package/docs/planr-spec/ADRS.md +0 -160
  45. package/docs/planr-spec/AI_SPEC.md +0 -138
  46. package/docs/planr-spec/ANALYTICS_OBSERVABILITY_SPEC.md +0 -124
  47. package/docs/planr-spec/API_AND_DATA_MODEL.md +0 -519
  48. package/docs/planr-spec/BACKEND_IMPLEMENTATION_SPEC.md +0 -178
  49. package/docs/planr-spec/CLIENT_IMPLEMENTATION_SPEC.md +0 -119
  50. package/docs/planr-spec/DESIGN_SYSTEM_SPEC.md +0 -102
  51. package/docs/planr-spec/PRODUCT_SPEC.md +0 -193
  52. package/docs/planr-spec/QA_ACCEPTANCE_TESTS.md +0 -146
  53. package/docs/planr-spec/README.md +0 -68
  54. package/docs/planr-spec/REFERENCES.md +0 -29
  55. package/docs/planr-spec/RELEASE_READINESS.md +0 -95
  56. package/docs/planr-spec/SAFETY_PRIVACY_SECURITY.md +0 -169
  57. package/docs/planr-spec/TASKS.md +0 -932
  58. package/docs/planr-spec/TECH_ARCHITECTURE.md +0 -145
  59. package/docs/planr-spec/UX_FLOWS.md +0 -235
  60. package/docs/release-candidates/planr-v1.5.2.md +0 -156
  61. /package/docs/{planr-spec → contracts}/EVAL_CONTRACT_V1.md +0 -0
  62. /package/docs/{planr-spec → contracts}/V1_1_DIFFERENTIATION_CONTRACT.md +0 -0
@@ -1,119 +1,53 @@
1
1
  ---
2
2
  name: planr-loop
3
- description: Drive one feature or scope to verified completion without per-step human prompting. Use when the user says build until done, loop on this, or finish autonomously. Sequences plan, map, work, live verification, and independent review until the map is clean and evidence proves the feature actually runs.
3
+ description: Drive one Planr feature or scope autonomously to audit-backed completion through scoped work, live verification, and independent review.
4
4
  ---
5
5
 
6
6
  # Planr Loop
7
7
 
8
- A closing loop: the agent prompts itself with Planr skills until a verifiable stop condition holds. The human supplies the goal at the start and reviews at the end; the map is the loop memory between iterations.
8
+ This is the iteration protocol, not the re-prompting driver. Run one goal with a checkable stop condition and an iteration budget (default 10). Refuse multi-goal loops.
9
9
 
10
- This skill is the iteration protocol, not the driver. Whoever re-prompts the next iteration a native loop primitive like Codex `/goal`, an automation, or a human re-dispatching `$planr-loop` — acts as the orchestrator and follows this protocol verbatim. The protocol is identical on every host; only the re-dispatch mechanism differs (see Loop Drivers).
10
+ Evaluation subcommands run only when the user explicitly requests them, the selected item's acceptance criteria require them, or the maintainer release workflow invokes them. Never invoke them as routine or opportunistic goal, loop, or task-graph work.
11
11
 
12
- ## Loop Contract
12
+ ## Contract And Iteration
13
13
 
14
- Before iterating, pin the contract:
14
+ Recover the stored `GOAL CONTRACT <plan-id>` from Planr every iteration. If absent, store one that requires settled items with evidence, complete reviews, clear approvals, and a live oracle. Never weaken it.
15
15
 
16
- 1. One goal: a single feature, fix scope, or build plan. Refuse multi-goal loops; split them first.
17
- 2. A stop condition that a different agent can check from map state and evidence, not from the worker's claims.
18
- 3. An iteration budget (default: 10 iterations). When exhausted, stop and report honestly instead of grinding.
16
+ Each iteration follows the Planr stage protocols:
19
17
 
20
- Stop condition template:
18
+ 1. `planr plan audit <plan-id> --json`; `holds: true` exits.
19
+ 2. Use `$planr-plan` or `$planr-task-graph` only when scope or graph structure is missing.
20
+ 3. Dispatch `$planr-work` for exactly one ready item scoped to `<plan-id>`; makers must use `planr pick --work-type code --plan <plan-id>`, never an unscoped pick, and finish implementation with `planr done <item-id> ... --review`.
21
+ 4. Run the target-platform oracle and record `planr log add --item <id> --kind verification --summary ... --cmd ...`.
22
+ 5. Dispatch `$planr-review`; findings create fix work, while `complete --close-target` settles the target.
23
+ 6. Repeat from audit.
21
24
 
22
- ```text
23
- DONE when: every in-scope map item is closed with log evidence,
24
- all reviews closed with verdict complete, no open approvals in scope,
25
- and a live verification log exists for the feature on its target platform.
26
- ```
25
+ One picked item per iteration. Use plain `done` only for low-signal setup/inspection work. Maker and checker stay separate when the host supports another agent; a maker never self-reviews when an independent checker is available, and never manufactures independence by changing worker identity. A worker may use `done --next`, which never returns its own review.
27
26
 
28
- Store the contract in Planr so it survives compaction, session loss, and host switches chat memory is not loop memory:
27
+ Pick packets explain null results and include `remaining`; follow their repair command. Destructive or out-of-repository effects require `planr approval request`. Two iterations without map movement must stop. On success or budget exhausted, finish with `$planr-summary`.
29
28
 
30
- ```bash
31
- planr context add "GOAL CONTRACT <plan-id>: DONE when ... Iteration budget: 10." --tag goal-contract
32
- ```
29
+ ## Provider-Neutral Dispatch
33
30
 
34
- `$planr-goal` does this during prep; if the loop starts without a stored contract, store it in iteration 1 before picking. Every iteration re-reads the contract from Planr (`planr context list --tag goal-contract` or `planr search "GOAL CONTRACT"`), never from chat history. `done`, `close`, and `review close` responses and the pick packet include a `remaining` progress snapshot (`counts` with explicit zeros for every status, `settled`, `total`) plus the list of items each settlement `unlocked`, so the orchestrator can evaluate the stop condition from the completion output without an extra `map status` call.
31
+ The driver dispatches and audits; it does not implement when subagents are available. Pick packets expose provider-neutral `routing.profile`; they do not expose a host-owned `routing.agent_type`. If a generated repository role exactly matches that profile, dispatch that profile identifier as the host-native role/`agent_type`. If no matching repository role exists, keep the host's default dispatch contract and treat routing as advisory.
35
32
 
36
- The stop condition itself is one command: `planr plan audit <plan-id> --json` evaluates the contract clause by clause (items settled, reviews complete, approvals clear, verification logged) with evidence and answers `holds: true/false`. Use it at the top of every iteration and as the final audit — never hand-assemble the verdict from separate calls.
33
+ Model, effort, profile, client, and fallback fields are advisory declarations and evidence labels only. Planr chooses none of them. Never infer effective model or effort from declarations. Workers report their actual profile and attach route observations when available.
37
34
 
38
- ## Iteration Shape
35
+ Dispatch messages stay minimal:
39
36
 
40
- Each iteration follows the Planr stage protocols never a hand-written workflow prompt:
37
+ - maker: `Use $planr-work on item <item-id>. Stop after requesting review.`
38
+ - checker: `Use $planr-review on item <item-id>. Close the review with a verdict.`
41
39
 
42
- ```text
43
- 1. planr plan audit <plan-id> --json contract holds -> exit loop ($planr-status for deeper reads)
44
- 2. $planr-plan / $planr-task-graph only if scope or map structure is missing
45
- 3. $planr-work pick exactly one ready item, implement, finish with planr done --review
46
- 4. live verify run the platform verification (below), log it with planr log add --kind verification
47
- 5. $planr-review independent audit; complete -> review close --close-target, findings -> Planr creates fix items
48
- 6. repeat fix items are just the next ready items
49
- ```
40
+ For generated Codex roles: The `spawn_agent` tool call itself must include `agent_type` set exactly to the matching `routing.profile`, `fork_turns: "none"`, a stable lowercase task name, and the maker/checker message. Read [host dispatch](references/host-dispatch.md) only when choosing host-specific wiring.
50
41
 
51
- The short path per item is three commands: `planr pick --json` (one flat work packet; makers add `--work-type code`), `planr done <item-id> --summary ... --cmd ... --review [--next]`, and the reviewer's `planr --json pick --work-type review` followed by `planr review close <review-id> --verdict complete --reviewer <id> --close-target` — run exactly once. Parent gates roll up automatically. When the loop runs against one plan (every `/goal` run does), add `--plan <plan-id>` to every pick so the lease never leaves the goal contract, even when other plans share the board. A null pick explains itself: when filters excluded ready work, `reason: "ready_items_excluded_by_filter"` names each excluded item, the cause (work_type or plan mismatch), and the exact `repair` pick command — run the repair instead of guessing.
42
+ ## Verification And Recovery
52
43
 
53
- `map build` chains created items in plan order with `blocks` links automatically and prints the created items and links. In step 2, verify that chain against real execution-order dependencies and adjust with `planr link add` only where document order and execution order differ. `item breakdown` works the same way: pass one `--into` per child title (or one value with newline-separated titles), and the output lists the chained children plus the next command.
44
+ “Done” means the feature ran. For web dispatch `$planr-verify-web`; for CLI execute the built binary; for API use real requests; for iOS launch the simulator. Log the replayable command. If the capability is missing, record a blocker context, request approval, and pause—never fake proof.
54
45
 
55
- Request reviews where they carry signal: implementation slices and anything user-facing finish with `done --review`. Trivial inspection, baseline, or setup items close with plain `done` (evidence still required) — a review that can only confirm "the repo was empty" adds ceremony, not safety. The goal contract's "all reviews closed" clause audits review items that exist; plain-`done` items satisfy it without a review gate, so skipping low-signal reviews never blocks `plan audit`. In a single-agent host this bar rises: a review you close yourself mostly re-runs your own commands, so reserve gates for the riskiest slices — the core implementation and the final live verification and close the rest with plain `done`.
56
-
57
- The loop never closes its own reviews when the host supports a second agent. Maker and checker stay separate. One agent instance keeps one `PLANR_WORKER_ID` for the whole session — never export a second identity inside the same instance to make reviews look `independent`; an honest `single_agent` stamp beats a fake `independent` one.
58
-
59
- ## Skills Are The Prompts
60
-
61
- When the host supports subagents, the driver never implements: it dispatches, audits, and synthesizes. Driver tokens go into `plan audit`, dispatch decisions, and conflict resolution — implementation and review run in host-native subagent roles (see the role files and `docs/GOALS.md` "Cost Tiering"). Pick packets expose provider-neutral `routing.profile`; they do not expose a host-owned `routing.agent_type`. If an external repository declaration has generated a host role whose identifier exactly matches `routing.profile`, dispatch that profile identifier as the host-native role/`agent_type` through the host's subagent wiring. If no matching repository role exists, keep the host's default dispatch contract and treat the profile as advisory evidence only. Model, effort, profile, client, and fallback fields are advisory declarations and evidence labels only; Planr does not choose a model, choose effort, choose a client, choose a fallback, or infer that a host honored any requested value. The host owns whether and how those declarations can be honored. As the dispatching driver, read the packet with `planr pick --peek [--plan <id>]` — it returns the same packet without leasing, so the worker picks under its own identity and the maker/checker audit stays clean (never pick-and-release as the driver). Workers report the profile they actually ran on (`done --profile <id>` or `PLANR_PROFILE`) and attach route observations when available, so host overrides show up in `planr trace item` as evidence instead of being inferred from declarations. Delegate with skill references plus an item id in the message body, nothing more; host-native dispatch arguments still carry the selected role/profile and isolation controls:
62
-
63
- - Worker dispatch: `Use $planr-work on item <item-id>. Stop after requesting review.`
64
- - Checker dispatch: `Use $planr-review on item <item-id>. Close the review with a verdict.`
65
-
66
- A worker subagent may take several items sequentially instead of being respawned per item: `done --next` hands it the next ready work packet, keeps its context warm, and never returns its own freshly created review — maker/checker separation survives long-lived workers.
67
-
68
- Host wiring:
69
-
70
- - When external repository declarations supply host roles matching pick-packet `routing.profile` values, pass the matching profile identifier as the native host role/`agent_type` and follow the generated role instructions exactly. Otherwise treat the profile in the pick packet as advisory and use the host's current dispatch contract. Never infer effective model or effort from a declaration alone.
71
- - Codex with native multi-agent roles (stable multi-agent or Multi-Agent v2): generated `.codex/config.toml` roles are matching repository roles. The `spawn_agent` tool call itself must include `agent_type` set exactly to the matching `routing.profile`, `fork_turns` set to `none`, a stable lowercase `task_name`, and the dispatch message above. A default-role maker/checker spawn without `agent_type` is invalid for a generated Codex role; do not wait on it or treat it as a fallback. Do not claim role binding is unavailable for generated Codex roles, and do not substitute the role name into `task_name`, prose, worker identity, or the message body as a replacement for `agent_type`; those are not native role-binding evidence.
72
- - Claude Code: subagents preload via the `skills:` frontmatter field. The Planr plugin registers `planr-worker` and `planr-reviewer` automatically from its `agents/` directory; standalone installs copy them to `.claude/agents/`. The reviewer subagent is read-only except for `planr review` commands.
73
- - Cursor: project subagents in `.cursor/agents/*.md` (Markdown templates in `agents/` next to this skill; `planr install cursor` provisions them). Dispatch explicitly: `/planr-worker implement item X`, `/planr-reviewer review item X`. Parallel dispatches are safe — the map's pick lease keeps one owner per item.
74
- - Single-agent hosts: run worker and checker as separate sequential dispatches with a fresh read of map state in between; never carry the worker's self-assessment into the review step. The mode is recorded automatically: `review close` derives `review_mode` (`single_agent`/`independent`) from worker identity.
75
-
76
- ## Live Verification By Platform
77
-
78
- "Done" means the feature ran, not that it compiles. Pick the verification from the plan's platform (`planr plan new ... --platform <p>`), run it inside step 4, and log the exact command and outcome:
79
-
80
- | Platform | Verification |
81
- | --- | --- |
82
- | `web` | dispatch `$planr-verify-web`: discovers the host's browser capability, runs the changed flow against the dev server, logs a replayable command |
83
- | `ios` | build and launch in the simulator (`xcodebuild` + `xcrun simctl`), exercise the changed flow |
84
- | `cli` | execute the built binary with the real flags the feature added; assert on output |
85
- | `api`/`backend` | start the service, hit the changed endpoints with real requests, assert responses |
86
-
87
- ```bash
88
- planr log add --item <item-id> --kind verification \
89
- --summary "live verification on <platform>: <observed outcome>" \
90
- --cmd "<exact command actually run>"
91
- ```
92
-
93
- `--kind verification` is what `plan audit` checks for its `verification_logged` clause. Log the final passing run; a transient failure you immediately fixed belongs in the summary narrative, not as a separate failure log.
94
-
95
- If the needed capability is missing (no simulator, no browser tooling), do not fake it: log the gap as context, request human approval, and pause the loop:
96
-
97
- ```bash
98
- planr context add "live verification blocked: <missing capability>" --item <item-id> --tag blocker
99
- planr approval request <item-id> --reason "manual live verification required"
100
- ```
101
-
102
- ## Loop Drivers
103
-
104
- Prefer the host's loop primitive over a bash while-loop so a separate model checks the stop condition. The driver supplies continuation pressure; Planr supplies everything else (state, evidence, reviews, recovery), so the loop works on every host:
105
-
106
- - Codex: `/goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).` — or an Automation with the same prompt. Full workflow: `docs/GOALS.md` in the Planr repository.
107
- - Claude Code: `/goal` with the same prompt shape, or `/loop` for a fixed cadence.
108
- - Cursor: no /goal primitive; re-dispatch `Use $planr-loop on plan <plan-id> ...` manually or per session. Within a session the loop dispatches the provisioned `/planr-worker` and `/planr-reviewer` subagents per item.
109
- - Anywhere else (plain MCP clients, hosts without /goal): re-dispatch `Use $planr-loop on plan <plan-id> ...` manually or per session. Nothing is lost except automatic re-prompting.
110
-
111
- Recovery is the same in all cases: a fresh session starts at step 1 (`$planr-status`), reads the map and the stored goal-contract, and continues exactly where the last iteration stopped — zero chat context required.
46
+ Recovery starts in a fresh session with audit, map state, the stored contract, and the next scoped pick. Read [recovery and platform details](references/recovery-and-verification.md) only when that branch is active.
112
47
 
113
48
  ## Hard Rules
114
49
 
115
- - One picked item per iteration. Parallel work needs separate worktrees and separate loop instances.
116
- - Every iteration must move map state (a log, a review verdict, a closed item, or a recorded blocker). Two iterations without state movement -> stop and report.
117
- - Never weaken the stop condition mid-loop. Scope changes go through `$planr-plan` and the user.
118
- - Destructive or out-of-repo side effects (deploys, migrations, infra) always go behind `planr approval request`.
119
- - On exit — success or budget exhausted — finish with `$planr-summary` so the human gets an evidence-backed account.
50
+ - Keep one active write item unless separate worktrees and loop instances were explicitly authorized.
51
+ - Scope changes go through `$planr-plan` and the user.
52
+ - Do not close your own review when independent review is available.
53
+ - Keep final claims aligned with map, logs, approvals, reviews, and oracle evidence.
@@ -3,7 +3,7 @@ name: planr-worker
3
3
  description: Implements exactly one picked Planr map item to evidence-backed completion, then requests review and stops. Dispatch with the item id.
4
4
  # Cost tiering: the pick packet bounds the worker's scope, so it can run on a
5
5
  # cheaper tier than the driver. Replace inherit with a cheaper Cursor model id
6
- # when dispatch cost matters. See docs/GOALS.md "Cost Tiering".
6
+ # when dispatch cost matters. See https://planr.so/docs/agents/skills#cost-tiering.
7
7
  model: inherit
8
8
  ---
9
9
 
@@ -0,0 +1,10 @@
1
+ # Host Dispatch
2
+
3
+ Load this only when the loop has subagents and must bind a provider-neutral Planr profile to host-native dispatch.
4
+
5
+ - Codex: generated `.codex/config.toml` roles are native roles. Bind the exact matching `routing.profile` as `agent_type` with `fork_turns: "none"`. Do not replace binding with prose, `task_name`, or worker identity, and do not wait on an invalid default-role spawn when a generated role is required.
6
+ - Claude Code: plugin agents preload the worker/reviewer skills; standalone installs provision `.claude/agents/`.
7
+ - Cursor: dispatch the provisioned `.cursor/agents/planr-worker.md` and `planr-reviewer.md` roles explicitly.
8
+ - Single-agent hosts: use separate sequential maker/checker passes with a fresh map read; Planr records `single_agent` honestly.
9
+
10
+ The driver should inspect routing with `planr pick --peek --plan <plan-id>` so the worker takes the actual lease. Host declarations are requests, never proof. Record observed profile/route evidence through worker completion metadata.
@@ -0,0 +1,24 @@
1
+ # Recovery And Verification
2
+
3
+ Load this only for an interrupted item or the live-verification stage.
4
+
5
+ Recovery:
6
+
7
+ ```bash
8
+ planr plan audit <plan-id> --json
9
+ planr trace item <item-id> --json
10
+ planr log list --item <item-id> --json
11
+ planr context list --item <item-id> --json
12
+ ```
13
+
14
+ Use `planr pick stale --older-than-seconds 900` before releasing abandoned ownership. Pause a legitimate wait with `planr pick pause`; resume it with `planr pick resume`.
15
+
16
+ Verification:
17
+
18
+ ```bash
19
+ planr log add --item <item-id> --kind verification \
20
+ --summary "verified <flow>: <observed outcome>" \
21
+ --cmd "<exact replayable command>"
22
+ ```
23
+
24
+ Use browser automation for web, the built binary for CLI, real requests for API/backend, and simulator launch plus exercised flow for iOS. If tooling is unavailable, store blocker context, request approval, and pause.
@@ -1,22 +1,17 @@
1
1
  ---
2
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.
3
+ description: Coordinate Planr plans, map dependencies, leases, evidence, approvals, reviews, handoffs, and interruption recovery.
4
4
  ---
5
5
 
6
6
  # Planr Task Graph
7
7
 
8
- Use `planr` as the canonical local coordination system for this repository.
8
+ Use Planr as the canonical local coordinator. Markdown plans own scope and narrative; the map is the source of truth for live items, links, picks, approvals, logs, reviews, and closure.
9
9
 
10
- Planr has two first-class layers:
10
+ Evaluation subcommands run only when the user explicitly requests them, the selected item's acceptance criteria require them, or the maintainer release workflow invokes them. Never invoke them as routine or opportunistic goal, loop, or task-graph work.
11
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.
12
+ ## Inspect And Work
14
13
 
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:
14
+ Before changes:
20
15
 
21
16
  ```bash
22
17
  planr project show --json
@@ -25,206 +20,42 @@ planr map lane --critical
25
20
  planr map pressure
26
21
  ```
27
22
 
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
23
+ If missing, initialize the project and run `planr doctor --client all`.
36
24
 
37
- Use one item at a time. The short path is two commands per step:
25
+ Work one item at a time:
38
26
 
39
27
  ```bash
40
28
  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>
29
+ planr done <item-id> --summary "<outcome and decisive result>" \
30
+ --files <path> --cmd "<build or live command>" \
31
+ --tests "<test command>" --review
52
32
  ```
53
33
 
54
- Capture decisions and discoveries another agent may need:
34
+ Every closure must be evidence-backed: changed files through `--files`, commands through `--cmd`, tests through `--tests`, remaining risk through context or findings, and review outcome through `planr review`. Use plain `done` only when review has no signal. Keep longer work current with `planr pick progress`, `pause`, and `resume`.
55
35
 
56
- ```bash
57
- planr context add "decision or discovery" --item <item-id> --tag discovery
58
- ```
36
+ ## Plans And Dependencies
59
37
 
60
- Record evidence before review:
38
+ Create/refine/check the plan, expand it into independently verifiable tasks, then `planr map build --from <plan-id>`. Annotate routed work types before mapping or retag afterward.
61
39
 
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
- ```
40
+ Create ordering explicitly with `planr link add <earlier> <later> --type blocks`; readiness comes from graph state, not Markdown checkboxes. Validate generated order and remove only incorrect links. Use `planr item breakdown <parent> --into <child>...` for a parent gate; later top-level work depends on the parent, which rolls up after children settle.
68
41
 
69
- Granular alternative: request review, close review, then close the item:
42
+ ## Reviews And Approvals
70
43
 
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
- ```
44
+ Request review after completion evidence. A complete review may use `planr review close <review-id> --verdict complete --close-target`. Findings use `--verdict not-complete`; Planr creates fix and follow-up review work.
76
45
 
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.
46
+ Human gates use `planr approval request <item-id> --reason <reason>`. Never close with an open or denied approval.
78
47
 
79
- If human approval is part of the gate, request it and do not close until it is approved:
48
+ ## Handoff And Recovery
80
49
 
81
- ```bash
82
- planr approval request <item-id> --reason "release approval"
83
- planr approval list --open
84
- ```
50
+ Use item notes for nearby handoff and contexts for reusable decisions. Logs are evidence, not chat summaries.
85
51
 
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
- When `planr agents list --json` shows routes with use-case `work_type` selectors (e.g. `frontend`, `backend`), retag freshly built items to match their work (`planr item update <id> --work-type frontend`) so pick packets carry the declared profile, model, and paired skill. This is the agent's job — never the user's; items matching no route keep `code` and fall to the default route.
122
-
123
- ## Parent Gate Pattern
124
-
125
- Model material changes as parent gates. The parent is the completion gate; linked children do the work.
126
-
127
- Default shape:
128
-
129
- ```text
130
- parent gate
131
- `- implementation or test child
132
- `- review item linked to that child
133
- |- pass -> child can close -> parent gate auto-closes
134
- `- findings -> fix item -> follow-up review -> ...
135
- ```
136
-
137
- Rules:
138
-
139
- - create a parent item for the change;
140
- - 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;
141
- - request review on the implementation or test child after evidence exists;
142
- - if review finds issues, let Planr create fix and follow-up review work from the review verdict;
143
- - make later top-level work depend on the parent gate, not only the first child.
144
-
145
- 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.
146
-
147
- ## Dependencies
148
-
149
- Create ordering explicitly:
150
-
151
- ```bash
152
- planr item create "Design API" --description "Define endpoints and data ownership."
153
- planr item create "Implement API" --description "Build endpoints after design is closed."
154
- planr link add <design-item> <implementation-item> --type blocks
155
- ```
156
-
157
- Readiness comes from graph links and item state, not Markdown checkboxes.
158
-
159
- Use:
160
-
161
- ```bash
162
- planr item breakdown <item-id> --into "Trace owner" --into "Implement" --into "Verify"
163
- planr link remove <from-item> <to-item> --type blocks
164
- ```
165
-
166
- ## Handoff Evidence
167
-
168
- Every closure must be evidence-backed:
169
-
170
- - changed files through `--files`;
171
- - commands through `--cmd`;
172
- - tests through `--tests`;
173
- - remaining risks through context, notes, or findings;
174
- - review outcome through `planr review ...`.
175
-
176
- Use task-local notes for nearby handoff:
177
-
178
- ```bash
179
- planr note add "Reviewer asked for an extra package dry-run before closure." --item <item-id>
180
- ```
181
-
182
- Use contexts for reusable project knowledge:
183
-
184
- ```bash
185
- planr context add "Do not edit global client config without explicit operator approval." --tag constraint
186
- ```
187
-
188
- 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.
189
-
190
- ## Recovery
191
-
192
- After interruption or handoff:
193
-
194
- ```bash
195
- git status --short
196
- planr project show --json
197
- planr map show --json
198
- planr map lane --critical
199
- planr map pressure
200
- ```
201
-
202
- Then inspect the item:
52
+ After interruption inspect Git status, map state, then:
203
53
 
204
54
  ```bash
205
55
  planr trace item <item-id>
206
56
  planr log list --item <item-id>
207
57
  planr context list --item <item-id>
208
- ```
209
-
210
- If a stale pick must be reset:
211
-
212
- ```bash
213
58
  planr pick stale --older-than-seconds 900
214
- planr pick stale --older-than-seconds 900 --release
215
- planr pick release <item-id> --force
216
59
  ```
217
60
 
218
- ## Completion Rule
219
-
220
- Do not call work complete until:
221
-
222
- - required child and review items are closed;
223
- - approval gates are approved or absent;
224
- - log evidence exists;
225
- - verification commands were actually run;
226
- - review findings are closed or converted into follow-up work;
227
- - `planr map show --json` shows no in-scope blocker;
228
- - the user-facing summary matches map, logs, and review state.
229
-
230
- For release-grade scopes, rerun the full verification ladder from the repository testing guide.
61
+ Release stale ownership only after inspection. Do not claim completion until children and reviews are closed, approvals are clear, verification commands ran, findings became settled follow-up work, and the user-facing summary matches Planr state.
package/docs/CI.md DELETED
@@ -1,55 +0,0 @@
1
- # CI
2
-
3
- Planr CI is defined in `.github/workflows/ci.yml` and `.github/workflows/security.yml`.
4
-
5
- ## Required Gates
6
-
7
- The main CI workflow runs:
8
-
9
- ```bash
10
- cargo fmt --check
11
- cargo clippy --all-targets -- -D warnings
12
- cargo test
13
- shellcheck scripts/*.sh
14
- cargo build --release
15
- npm pack --dry-run
16
- node npm/bin/planr.js --version
17
- cargo audit --deny warnings
18
- ```
19
-
20
- The security workflow runs a GitHub Actions security scan with pinned `zizmor`.
21
-
22
- ## Local Reproduction
23
-
24
- Run the full local gate:
25
-
26
- ```bash
27
- scripts/ci-local.sh
28
- ```
29
-
30
- `scripts/ci-local.sh` also runs the external consumer E2E project when the sibling `planr-test` checkout exists. Override its location with `PLANR_TEST_DIR`:
31
-
32
- ```bash
33
- PLANR_TEST_DIR=/path/to/planr-test scripts/ci-local.sh
34
- cd /path/to/planr-test
35
- npm test
36
- npm run test:npm-planr
37
- ```
38
-
39
- Run local security and leak checks:
40
-
41
- ```bash
42
- npm run security:check
43
- ```
44
-
45
- This checks tracked files for machine-specific home paths, rejects forbidden staged paths, uses BetterLeaks for secret history scanning, and runs Trivy for filesystem vulnerability, secret, and misconfiguration scanning. If Lefthook is installed, run `lefthook install` once to activate the staged-path guard for commits and pushes.
46
-
47
- ## Supply Chain
48
-
49
- Dependabot is configured in `.github/dependabot.yml` for:
50
-
51
- - Cargo dependencies
52
- - npm dependencies
53
- - GitHub Actions
54
-
55
- GitHub Actions use read-only default permissions and pin checkout by commit SHA.
@@ -1,52 +0,0 @@
1
- # Claude Code Integration
2
-
3
- ## Plugin (preferred for skills)
4
-
5
- The Planr repository is a Claude Code plugin. Install it to get the skills (namespaced as `/planr:planr`, `/planr:planr-loop`, ...) plus the `planr-worker` and `planr-reviewer` subagents:
6
-
7
- ```text
8
- /plugin marketplace add instructa/planr
9
- /plugin install planr@planr
10
- ```
11
-
12
- See [Skills](SKILLS.md) for the skill workflow. For autonomous goal runs with `/goal` or `/loop` on top of Planr state, see [Long-Running Goals](GOALS.md).
13
-
14
- ## Long-Running Goals With `/goal`
15
-
16
- Claude Code `/goal` drives autonomous Planr runs the same way Codex does: `/goal` supplies continuation pressure, Planr supplies durable state, evidence, reviews, and recovery. Run the driver session on your strongest model (`/model fable`, `/effort high`), prep once, then start:
17
-
18
- ```text
19
- /planr:planr-goal <your goal>
20
- /goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract). Continue until the contract holds or the iteration budget is exhausted. You are operating autonomously: the user is not watching, so never end a turn on a plan, a question, or a promise — proceed until the contract holds or you are blocked on input only the user can provide.
21
- ```
22
-
23
- The plugin registers the `planr-worker` and `planr-reviewer` subagents automatically. The worker pins a cheaper tier in its frontmatter; the reviewer deliberately inherits the driver's model:
24
-
25
- ```yaml
26
- # planr-worker.md frontmatter
27
- model: opus # alias tracks the current generation; budget alternative: sonnet
28
- effort: medium
29
- ```
30
-
31
- Verify the pin once: `CLAUDE_CODE_SUBAGENT_MODEL` must be unset (it silently overrides all subagent frontmatter), then dispatch the worker on a trivial item and confirm the subagent's messages in `~/.claude/projects/<project>/*.jsonl` carry the worker model. Full workflow, recovery, and the tiering rationale: [Long-Running Goals](GOALS.md).
32
-
33
- ## MCP
34
-
35
- ```bash
36
- planr install claude --dry-run
37
- planr install claude
38
- planr doctor --client claude
39
- ```
40
-
41
- Dry-run prints both project-scope `.mcp.json` content and the optional user-scope CLI form. The non-dry command writes this repository's `.mcp.json`, standalone worker/reviewer roles, and additive fail-open session hooks. Workflow skills and plugin agents come from the Claude Code plugin. Use `--no-mcp` to omit `.mcp.json`, or `--no-hooks` to omit hook reconciliation.
42
-
43
- Claude Code should treat Planr map state as authoritative and use Markdown plans as context.
44
-
45
- For repo-local review feedback, write JSON to a file and ingest it:
46
-
47
- ```bash
48
- planr review ingest <item-id> --from .planr/tmp/claude-review.json
49
- planr review artifact <review-item-id>
50
- ```
51
-
52
- Planr does not edit global Claude Code configuration. Project hooks live in `.claude/settings.json`, preserve foreign entries, and can be omitted with `--no-hooks`. The review item remains open until `planr review close` records the final verdict.