planr 1.6.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 (63) hide show
  1. package/README.md +46 -22
  2. package/docs/ARCHITECTURE.md +12 -1
  3. package/docs/RELEASE.md +37 -7
  4. package/docs/SWITCHLOOM_COMPATIBILITY.md +46 -0
  5. package/docs/contracts/EVAL_CONTRACT_V1.md +2072 -0
  6. package/docs/documentation/CONTRACT.md +7 -7
  7. package/docs/documentation/COVERAGE.md +5 -3
  8. package/docs/documentation/INFORMATION_ARCHITECTURE.md +5 -2
  9. package/docs/fixtures/mcp-contract.json +12 -0
  10. package/npm/native/darwin-arm64/planr +0 -0
  11. package/npm/native/darwin-x86_64/planr +0 -0
  12. package/npm/native/linux-arm64/planr +0 -0
  13. package/npm/native/linux-x86_64/planr +0 -0
  14. package/package.json +5 -1
  15. package/plugins/planr/.claude-plugin/plugin.json +1 -1
  16. package/plugins/planr/.codex-plugin/plugin.json +1 -1
  17. package/plugins/planr/agents/planr-worker.md +1 -1
  18. package/plugins/planr/skills/planr-goal/SKILL.md +21 -49
  19. package/plugins/planr/skills/planr-loop/SKILL.md +28 -94
  20. package/plugins/planr/skills/planr-loop/agents/planr-worker.md +1 -1
  21. package/plugins/planr/skills/planr-loop/references/host-dispatch.md +10 -0
  22. package/plugins/planr/skills/planr-loop/references/recovery-and-verification.md +24 -0
  23. package/plugins/planr/skills/planr-task-graph/SKILL.md +21 -190
  24. package/docs/CI.md +0 -54
  25. package/docs/CLAUDE_CODE.md +0 -52
  26. package/docs/CLI_REFERENCE.md +0 -160
  27. package/docs/CODEX.md +0 -56
  28. package/docs/CURSOR.md +0 -114
  29. package/docs/EXAMPLE_WEBAPP.md +0 -103
  30. package/docs/GOALS.md +0 -175
  31. package/docs/HANDOFFS_AND_STORIES.md +0 -121
  32. package/docs/HOOKS.md +0 -34
  33. package/docs/IMPORT.md +0 -21
  34. package/docs/INSTALL.md +0 -115
  35. package/docs/MCP_CONTRACT.md +0 -73
  36. package/docs/MCP_GUIDE.md +0 -40
  37. package/docs/MODEL_ROUTING.md +0 -33
  38. package/docs/NPM.md +0 -40
  39. package/docs/OPERATING_MODEL.md +0 -250
  40. package/docs/ROUTING_BUNDLES.md +0 -15
  41. package/docs/SECURITY.md +0 -8
  42. package/docs/SKILLS.md +0 -261
  43. package/docs/TASK_GRAPH_MODEL.md +0 -272
  44. package/docs/TESTING.md +0 -87
  45. package/docs/TROUBLESHOOTING.md +0 -30
  46. package/docs/planr-spec/ADRS.md +0 -160
  47. package/docs/planr-spec/AI_SPEC.md +0 -138
  48. package/docs/planr-spec/ANALYTICS_OBSERVABILITY_SPEC.md +0 -124
  49. package/docs/planr-spec/API_AND_DATA_MODEL.md +0 -517
  50. package/docs/planr-spec/BACKEND_IMPLEMENTATION_SPEC.md +0 -178
  51. package/docs/planr-spec/CLIENT_IMPLEMENTATION_SPEC.md +0 -119
  52. package/docs/planr-spec/DESIGN_SYSTEM_SPEC.md +0 -102
  53. package/docs/planr-spec/PRODUCT_SPEC.md +0 -193
  54. package/docs/planr-spec/QA_ACCEPTANCE_TESTS.md +0 -146
  55. package/docs/planr-spec/README.md +0 -67
  56. package/docs/planr-spec/REFERENCES.md +0 -29
  57. package/docs/planr-spec/RELEASE_READINESS.md +0 -95
  58. package/docs/planr-spec/SAFETY_PRIVACY_SECURITY.md +0 -169
  59. package/docs/planr-spec/TASKS.md +0 -932
  60. package/docs/planr-spec/TECH_ARCHITECTURE.md +0 -143
  61. package/docs/planr-spec/UX_FLOWS.md +0 -235
  62. package/docs/release-candidates/planr-v1.5.2.md +0 -164
  63. /package/docs/{planr-spec → contracts}/V1_1_DIFFERENTIATION_CONTRACT.md +0 -0
package/docs/CURSOR.md DELETED
@@ -1,114 +0,0 @@
1
- # Cursor Integration
2
-
3
- Cursor is a first-class Planr client. One command wires a project completely — MCP tools, the worker/reviewer subagents, and the full skill set:
4
-
5
- ```bash
6
- planr install cursor
7
- ```
8
-
9
- This writes only repository-local files (never global Cursor config):
10
-
11
- | Path | Purpose |
12
- | --- | --- |
13
- | `.cursor/mcp.json` | project-scoped stdio MCP server (`planr mcp`) with the 44 Planr tools |
14
- | `.cursor/agents/planr-worker.md` | worker subagent: implements exactly one picked item, then requests review and stops |
15
- | `.cursor/agents/planr-reviewer.md` | reviewer subagent: audits evidence and closes the review with a verdict |
16
- | `.cursor/skills/planr*/SKILL.md` | all ten Planr skills (`planr`, `planr-goal`, `planr-loop`, stage and capability skills) |
17
-
18
- Re-running the command refreshes `.cursor/mcp.json` but never overwrites edited agent or skill files. `planr project init "My Product" --client cursor` (or `--client all`) provisions the same subagent roles at init time. Verify with `planr doctor --client cursor`.
19
-
20
- ## Skills And Agents Only (No MCP)
21
-
22
- The skills are CLI-first — they drive the `planr` binary directly through the terminal — so MCP is optional. To install project subagents, skills, and the default hooks without MCP:
23
-
24
- ```bash
25
- planr install cursor --no-mcp
26
- ```
27
-
28
- This writes `.cursor/agents/`, `.cursor/skills/`, and the default project hooks, but no `.cursor/mcp.json` or deeplink. Add `--no-hooks` when hooks must also be skipped. Everything below works in this mode because the skills call the Planr CLI directly. `--no-mcp --dry-run` lists the roles and skills and states whether the non-dry run would reconcile hooks. For Claude Code the flag writes standalone project roles and hooks but no project skills; for Codex it writes hooks only. Their workflow skills come from their respective plugins.
29
-
30
- ## One-Click MCP Install
31
-
32
- For user-level setup (all projects, no repo files), the dry-run prints a Cursor deeplink:
33
-
34
- ```bash
35
- planr install cursor --dry-run
36
- ```
37
-
38
- ```text
39
- cursor://anysphere.cursor-deeplink/mcp/install?name=planr&config=eyJhcmdzIjpbIm1jcCJdLCJjb21tYW5kIjoicGxhbnIifQ==
40
- ```
41
-
42
- Open the link (or paste it into a browser) and Cursor prompts to install the server. The embedded config is `{"command": "planr", "args": ["mcp"]}` with no `--db` path on purpose: Cursor starts the server in the workspace directory, so every project resolves its own `.planr/planr.sqlite`.
43
-
44
- ## Plugin
45
-
46
- The repository carries a Cursor plugin manifest (`.cursor-plugin/plugin.json`) bundling the skills and both subagents. Marketplace listing is pending review; until it is listed:
47
-
48
- - `planr install cursor` (above) provides the identical component set per project, or
49
- - install the plugin locally: copy the repository to `~/.cursor/plugins/local/planr` and reload Cursor.
50
-
51
- ## Multitasking With Cursor's Built-In Features
52
-
53
- Cursor's subagents, background execution, and parallel agents map directly onto Planr's maker/checker loop. The Planr map is the shared state, so concurrent Cursor agents coordinate through `planr pick` leases instead of stepping on each other.
54
-
55
- ### Subagent dispatch (maker/checker)
56
-
57
- The installed subagents are dispatched from any Agent chat with `/name` or by mention:
58
-
59
- ```text
60
- /planr-worker implement item <item-id>
61
- /planr-reviewer review item <item-id>
62
- ```
63
-
64
- The worker preloads the `planr-work` protocol (implement one item, log evidence, request review, stop); the reviewer preloads `planr-review` (audit the diff, rerun logged commands, close with a verdict). Because each subagent runs in its own context window, the driving chat stays focused on `plan audit`, dispatch decisions, and synthesis — the same division of labor as Codex `/goal` and Claude Code (see [Long-Running Goals](GOALS.md)).
65
-
66
- Cost tiering: the worker file ships with `model: inherit`; edit its frontmatter to pin a cheaper Cursor model id when dispatch cost matters. Leave the reviewer on `inherit` — make workers cheap, not the verdict.
67
-
68
- ### Parallel and background work
69
-
70
- - **Parallel subagents:** ask the driver to dispatch several workers at once ("implement items A, B, and C in parallel with planr-worker subagents"). Each worker calls `planr pick` (or is handed its item id); the map's single-owner lease guarantees no two agents hold the same item, and `planr recover sweep` reclaims work from any that die.
71
- - **Background subagents:** long items can run as background subagents; evidence logging doubles as the liveness heartbeat, so `planr pick stale` shows honestly stuck work.
72
- - **Cloud agents (`/in-cloud`):** cloud VMs do not share your local `.planr` database or local MCP config. Give cloud agents the CLI workflow instead (`planr prompt cli --client cursor`) and let them commit evidence through normal Planr CLI calls in their own checkout.
73
-
74
- ### Parallel agents in worktrees
75
-
76
- Cursor's parallel agents run in separate git worktrees, and each worktree would otherwise get its own copy of `.planr/planr.sqlite` — forking the map. Keep one authoritative map by pointing every worktree at a shared absolute database path:
77
-
78
- ```json
79
- {
80
- "mcpServers": {
81
- "planr": {"command": "planr", "args": ["--db", "/absolute/path/to/main-checkout/.planr/planr.sqlite", "mcp"]}
82
- }
83
- }
84
- ```
85
-
86
- `planr install cursor` already writes the absolute path of the current checkout, so worktrees created from an installed project inherit the right value — verify with `planr project show --json` from each worktree. One picked item per agent instance stays the rule (`plugins/planr/skills/planr-loop/SKILL.md`, Hard Rules).
87
-
88
- ### Goal loops
89
-
90
- Cursor has no `/goal` primitive; the human (or an automation) is the re-dispatcher:
91
-
92
- ```text
93
- Use $planr-goal: <your goal>
94
- Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
95
- ```
96
-
97
- `$planr-loop` iterates inside the session, dispatching `/planr-worker` and `/planr-reviewer` per item. If the session ends before `planr plan audit <plan-id>` holds, send the same starter line in a fresh session — the map, the stored contract, and open reviews carry the run, not chat history.
98
-
99
- ## HTTP And Review Feedback
100
-
101
- Planr V1 defaults to MCP stdio. Local HTTP/SSE is available through:
102
-
103
- ```bash
104
- planr serve --port 7526
105
- ```
106
-
107
- Cursor tasks can attach review feedback through either MCP stdio or the local HTTP API:
108
-
109
- ```bash
110
- planr review annotate <item-id> --message "Cursor review note" --severity warning
111
- planr review ingest <item-id> --from .planr/tmp/cursor-review.json
112
- ```
113
-
114
- Review ingestion does not auto-close or auto-approve work.
@@ -1,103 +0,0 @@
1
- # Worked Example: Routing a Small Web App
2
-
3
- This provider-neutral example routes a todo web app by work type. Planr Core treats every profile field as opaque data and does not select a host or model.
4
-
5
- ## 1. Create the project and registry
6
-
7
- ```bash
8
- planr project init "Todo Webapp"
9
- planr agents init
10
- ```
11
-
12
- Edit the repository-local `.planr/agents.toml` with profiles owned by your team or routing package:
13
-
14
- ```toml
15
- [profiles.frontend-worker]
16
- client = "your-host"
17
- model = "your-fast-model"
18
- effort = "medium"
19
- cost_tier = "budget"
20
- skill = "planr-work"
21
-
22
- [profiles.backend-worker]
23
- client = "your-host"
24
- model = "your-engineering-model"
25
- effort = "high"
26
- cost_tier = "standard"
27
- skill = "planr-work"
28
-
29
- [profiles.independent-reviewer]
30
- client = "your-host"
31
- model = "your-review-model"
32
- effort = "high"
33
- cost_tier = "premium"
34
- skill = "planr-review"
35
-
36
- [[routes]]
37
- match = { work_type = "frontend" }
38
- profile = "frontend-worker"
39
-
40
- [[routes]]
41
- match = { work_type = "backend" }
42
- profile = "backend-worker"
43
-
44
- [[routes]]
45
- match = { work_type = "review" }
46
- profile = "independent-reviewer"
47
- ```
48
-
49
- Validate without contacting a provider:
50
-
51
- ```bash
52
- planr agents check
53
- planr agents list
54
- ```
55
-
56
- Alternatively, an external routing tool such as [Switchloom v0.2.1](https://github.com/instructa/switchloom/releases/tag/v0.2.1) can manage repository-local declarations and host roles outside Planr. After that external lifecycle step, Planr still sees only provider-neutral declarations:
57
-
58
- ```bash
59
- planr agents check
60
- planr agents list --json
61
- ```
62
-
63
- ## 2. Tag items by use case
64
-
65
- ```bash
66
- planr item create "API: task CRUD endpoints" \
67
- --description "GET/POST/PATCH/DELETE /api/tasks with sqlite store" \
68
- --work-type backend
69
-
70
- planr item create "UI: task list and add form" \
71
- --description "List view and optimistic add form" \
72
- --work-type frontend
73
- ```
74
-
75
- ## 3. Pick and dispatch
76
-
77
- ```bash
78
- planr pick --work-type backend --json
79
- ```
80
-
81
- The pick packet contains the selected opaque profile, client, model, effort, skill, and selector. The host remains responsible for dispatching it; Planr never claims that the requested model actually ran.
82
-
83
- ## 4. Close with evidence
84
-
85
- ```bash
86
- planr done <item-id> \
87
- --summary "CRUD endpoints implemented; 8 tests green" \
88
- --files server/routes/tasks.ts \
89
- --tests "vitest --run: 8 passed" \
90
- --profile backend-worker
91
- ```
92
-
93
- `--profile` records the run's claimed profile. For stronger evidence, attach a route observation that keeps requested, host-resolved, and effective values separate.
94
-
95
- ## 5. Trace declared versus actual
96
-
97
- ```bash
98
- planr trace item <item-id>
99
- ```
100
-
101
- A mismatch is recorded as advisory evidence instead of silently rewritten. Missing effective-host evidence stays unavailable and is never inferred from the registry.
102
-
103
- One-off exceptions use `planr item route <id> --set <profile>`; `--clear` restores policy resolution. See [Model Routing](MODEL_ROUTING.md) and [External Routing Declarations](ROUTING_BUNDLES.md).
package/docs/GOALS.md DELETED
@@ -1,175 +0,0 @@
1
- # Long-Running Goals
2
-
3
- Planr makes long-running, autonomous goal runs durable. A loop driver — Codex `/goal`, Claude Code `/goal` or `/loop`, an automation, or a human re-dispatching a skill — supplies continuation pressure: "do not stop until the goal holds." Planr supplies everything such a run loses between sessions: the plan, the task map, picks, evidence logs, review gates, approvals, and recovery.
4
-
5
- This is complementary, not competing. `/goal` stays the orchestrator; Planr is the state layer underneath it. Without a native loop primitive you lose only automatic re-prompting — never state, evidence, or recovery.
6
-
7
- ## Division Of Labor
8
-
9
- | Concern | Owner |
10
- | --- | --- |
11
- | Continuation pressure, re-prompting, session autonomy | loop driver (`/goal`, automation, human) |
12
- | Scope, acceptance criteria, verification contract | Planr plan (`planr plan new/check`) |
13
- | Task state, dependencies, what is next | Planr map (`planr map`, `planr pick`) |
14
- | Stop condition that survives compaction | Planr context (`--tag goal-contract`) |
15
- | Proof the work happened and runs | Planr logs (`planr log`, `planr done`) |
16
- | Maker/checker separation | Planr reviews (`planr review`) + subagent roles |
17
- | Recovery after session loss or host switch | Planr map + stored contract, from zero chat context |
18
-
19
- ## The Workflow
20
-
21
- ### 1. Prep — `$planr-goal` (once, interactive)
22
-
23
- ```text
24
- $planr-goal Add CSV export to the reports page, should work in the browser
25
- ```
26
-
27
- The skill compiles the goal and stops — no implementation:
28
-
29
- - creates and checks a feature-scoped plan (`planr plan new` -> `plan check`; strict, empty sections fail),
30
- - builds the map and links execution order (`planr map build` is idempotent; `planr link add ... --type blocks`),
31
- - stores the goal contract durably in Planr:
32
-
33
- ```bash
34
- planr context add "GOAL CONTRACT pl-csv-export: DONE when every in-scope map item is closed with log evidence, all reviews closed with verdict complete, no open approvals in scope, and a live browser verification log exists for the export flow. Iteration budget: 10." --tag goal-contract
35
- ```
36
-
37
- - prints the exact starter command for your host.
38
-
39
- ### 2. Execute — the loop driver runs `$planr-loop`
40
-
41
- ```text
42
- /goal Use $planr-loop on plan pl-csv-export. 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.
43
- ```
44
-
45
- The autonomy clause matters on long runs: deep into a session, frontier models occasionally end a turn with a statement of intent instead of the corresponding action, or pause to ask permission they already have. Stating the operating mode up front prevents both.
46
-
47
- Each iteration follows the `$planr-loop` protocol:
48
-
49
- ```text
50
- 1. planr plan audit <plan-id> one-call contract verdict; holds -> exit
51
- 2. $planr-work pick exactly one ready item, implement, finish with planr done --review
52
- 3. live verify run the platform verification, log it with planr log add --kind verification --cmd
53
- 4. $planr-review independent audit; complete -> review close --close-target,
54
- findings -> fix items become the next ready items
55
- 5. repeat
56
- ```
57
-
58
- `plan audit` replaces the hand-rolled final audit: it checks `items_settled`, `reviews_complete`, `approvals_clear`, and `verification_logged` clause by clause with evidence, includes the stored goal contract, and answers `holds: true/false` in one command.
59
-
60
- The per-item path is three commands since v1.1.6:
61
-
62
- ```bash
63
- planr pick --json --plan <plan-id> # flat work packet, leased only from the goal's plan
64
- planr done <item-id> --summary "..." --cmd "..." --review --next
65
- planr review close <review-id> --verdict complete --reviewer <id> --close-target
66
- ```
67
-
68
- `--plan` keeps the lease inside the goal contract: when several plans share the board (a parallel feature, leftovers from an aborted prep run), a plan-scoped goal run never picks work outside its own plan. A pick that finds nothing in scope never widens silently: it reports `reason: "nothing_ready"` when nothing is ready at all, or `reason: "ready_items_excluded_by_filter"` with the excluded items, the cause per item, and the exact `repair` pick commands when ready work exists outside the filter.
69
-
70
- `done`/`close`/`review close` responses and the pick packet include a `remaining` snapshot (`counts` with explicit zeros for every status, `settled`, `total`), so the orchestrator evaluates the stop condition straight from the completion output — no extra `map status` round-trip. The same responses list what each settlement `unlocked`, so the loop sees its next work without re-reading the map. `--next` never hands a worker its own freshly created review, so maker and checker stay separate even in compact loops. The review verdict records `review_mode` (`single_agent` or `independent`) automatically from worker identity — no ceremony note needed. The contract's "all reviews closed" clause audits review items that exist; an item closed with plain `done` satisfies the contract without a review gate, so low-signal reviews can be skipped without blocking `plan audit`.
71
-
72
- ### 3. Finish
73
-
74
- When the contract holds, the loop exits through `$planr-summary`: an evidence-backed account of what shipped, which commands proved it, and what (if anything) stayed blocked.
75
-
76
- ## Recovery
77
-
78
- The defining property of a long-running goal: the session will die before the goal does. With Planr that costs nothing. Start a new session — same host or a different one — with the same starter line:
79
-
80
- ```text
81
- /goal Use $planr-loop on plan pl-csv-export. The loop contract is stored in planr context (tag: goal-contract).
82
- ```
83
-
84
- Iteration 1 reads the map and the stored contract: items already settled stay settled, open reviews stay open, the next ready item is picked. No chat history needed. `planr recover sweep` handles stale picks from interrupted workers.
85
-
86
- ## Per-Host Setup
87
-
88
- ### Codex with `/goal`
89
-
90
- Install the plugin and initialize the repository. Optional routing declarations are repository-local and may be edited directly or managed by an external tool such as [Switchloom v0.2.1](https://github.com/instructa/switchloom/releases/tag/v0.2.1) before the run:
91
-
92
- ```bash
93
- codex plugin marketplace add instructa/planr
94
- codex plugin add planr@planr
95
- planr project init "My Product"
96
- planr agents check
97
- ```
98
-
99
- Then:
100
-
101
- ```text
102
- $planr-goal <your goal> # prep: plan, map, contract, starter command
103
- /goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
104
- ```
105
-
106
- When repository routing declarations exist, the `/goal` PM treats them as advisory dispatch input. The external routing owner decides exact models, effort, role names, fallback policy, and lifecycle; Planr only carries the resulting opaque route in pick packets and records observed evidence when workers provide it. Codex Automations use the same starter line.
107
-
108
- ### Claude Code
109
-
110
- Same shape via the plugin (`/plugin install planr@planr`), which registers the `planr-worker` and `planr-reviewer` subagents automatically:
111
-
112
- ```text
113
- /planr:planr-goal <your goal>
114
- /goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
115
- ```
116
-
117
- `/loop` works for fixed-cadence runs instead of goal-conditioned ones. The registered worker subagent pins a cheaper model tier; see [Cost Tiering](#cost-tiering).
118
-
119
- ### Cursor
120
-
121
- No `/goal` primitive, but full subagent support. Install once:
122
-
123
- ```bash
124
- planr install cursor # writes .cursor/mcp.json, .cursor/agents/planr-worker.md + planr-reviewer.md, and the skills
125
- ```
126
-
127
- Then run the identical protocol with the human (or an automation) as the re-dispatcher:
128
-
129
- ```text
130
- Use $planr-goal: <your goal>
131
- Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
132
- ```
133
-
134
- `$planr-loop` iterates within the session under its own budget, dispatching `/planr-worker` and `/planr-reviewer` per item — the provisioned subagents preload the work and review protocols, so dispatches stay one line. If the session ends before the contract holds, dispatch the same line again — recovery is identical to the `/goal` case. Parallelism, background subagents, and worktree caveats: [Cursor](CURSOR.md).
135
-
136
- ### Hosts without a loop primitive
137
-
138
- Identical protocol; the human (or a background agent) is the re-dispatcher, and worker/reviewer run as separate sequential dispatches when the host has no subagents.
139
-
140
- ### Plain MCP clients
141
-
142
- Any MCP-capable agent uses the same flow over `planr mcp`. Every session starts with map state, so the loop is resumable by construction.
143
-
144
- ## Cost Tiering
145
-
146
- A goal run has distinct roles with different intelligence needs. Planr represents those decisions as opaque profiles and routes; it does not choose providers, models, effort levels, fallback chains, or host-native role names.
147
-
148
- An optional external routing tool can map planning, exploration, implementation, mechanical work, and independent review onto different cost or quality tiers. If [Switchloom v0.2.1](https://github.com/instructa/switchloom/releases/tag/v0.2.1) or another repository-local process writes routing declarations or host roles, follow that tool's generated instructions outside Planr and verify effective child metadata because declarations alone are not proof. The Core contract is documented in [Model Routing](MODEL_ROUTING.md).
149
-
150
- ## Coming From Other Goal Tools
151
-
152
- If you already run goal workflows with other tools, the concepts map directly:
153
-
154
- | Elsewhere | In Planr |
155
- | --- | --- |
156
- | Goal charter file (`goal.md`) | product/build plan (`planr plan new`, rich scope + verification) |
157
- | Board/state file (`state.yaml`) | the map (`planr map show`, authoritative item state) |
158
- | One active task | `planr pick` (single owner, heartbeat, stale recovery) |
159
- | Task receipts | `planr log` / `planr done` (files, commands, results) |
160
- | Goal oracle / completion proof | goal contract + live verification log |
161
- | Scout/Judge/Worker roles | worker/reviewer subagents + `$planr-status` for honest reads |
162
- | Final audit before done | `$planr-review` with `review close --verdict complete` |
163
-
164
- Using such tools for intake or visualization alongside Planr is fine — keep one rule: the Planr map stays the single source of truth for item status, links, picks, reviews, approvals, and completion.
165
-
166
- ## Rules That Keep Goal Runs Honest
167
-
168
- - Never weaken a stored goal contract mid-run; scope changes go through `$planr-plan` and the user.
169
- - "Done" means the feature ran (live verification log), not that it compiles.
170
- - The maker never closes its own review; single-agent hosts record `review-mode` honestly.
171
- - Two iterations without map-state movement -> stop and report instead of grinding.
172
- - Destructive or out-of-repo side effects always go behind `planr approval request`.
173
- - Lessons that should outlive the iteration (a confirmed approach, a correction, a dead end) go into `planr context add "..." --tag lesson` — the next iteration or a fresh session recovers them with `planr context list --tag lesson`, not from chat history.
174
-
175
- See also: [Skills](SKILLS.md), [Operating Model](OPERATING_MODEL.md), [Task Graph Model](TASK_GRAPH_MODEL.md), [Codex](CODEX.md), [Claude Code](CLAUDE_CODE.md), [Cursor](CURSOR.md).
@@ -1,121 +0,0 @@
1
- # Handoffs And Stories
2
-
3
- Planr separates live state from narrative memory.
4
-
5
- - Live state belongs in the map.
6
- - Completion proof belongs in logs.
7
- - Searchable decisions belong in contexts.
8
- - Long-form narrative belongs in story logs.
9
-
10
- ## Handoff Logs
11
-
12
- Use `planr log add` whenever another agent, reviewer, or future session must know what happened:
13
-
14
- ```bash
15
- planr log add --item <item-id> \
16
- --summary "Implemented release dry-run checks" \
17
- --files scripts/build-release.sh,docs/RELEASE.md \
18
- --cmd "scripts/build-release.sh" \
19
- --cmd "cargo test"
20
- ```
21
-
22
- A useful handoff log names:
23
-
24
- - changed files;
25
- - commands run;
26
- - test results;
27
- - assumptions kept;
28
- - decisions made;
29
- - known remaining risk.
30
-
31
- Do not paste private source files, secrets, tokens, or full transcripts into logs.
32
-
33
- ## Context Entries
34
-
35
- Use context for durable discoveries:
36
-
37
- ```bash
38
- planr context add "Release dry-runs must not edit global agent configuration." --tag constraint
39
- planr context add "Use project-scoped MCP config for client examples." --tag decision
40
- ```
41
-
42
- Prefer context when the fact may influence multiple future items.
43
-
44
- ## Task Notes
45
-
46
- Use notes for local item discussion:
47
-
48
- ```bash
49
- planr note add "Reviewer asked for an extra npm pack dry-run before closure." --item <item-id>
50
- ```
51
-
52
- Prefer notes when the fact is not project-wide and should stay near one item.
53
-
54
- ## Story Logs
55
-
56
- Use story logs only when map items, contexts, and logs are too thin to preserve the decision chain.
57
-
58
- Create a story log for:
59
-
60
- - a large architecture or ownership change;
61
- - a multi-round review/fix sequence;
62
- - a discovery that invalidates earlier assumptions;
63
- - a release or schema-upgrade path that future agents must understand;
64
- - interruption-prone work where the "why" matters as much as the status.
65
-
66
- Recommended location for repo-versioned product stories:
67
-
68
- ```text
69
- .planr/stories/
70
- ```
71
-
72
- Recommended location for private operator-only stories:
73
-
74
- ```text
75
- ~/.planr/<project>/stories/
76
- ```
77
-
78
- Do not create `todo`, `in-progress`, or `finished` story folders. Status belongs to the map.
79
-
80
- ## Story Template
81
-
82
- ```markdown
83
- # <Story Title>
84
-
85
- Project: <project name>
86
- Related items: <item ids>
87
- Updated: <YYYY-MM-DD>
88
-
89
- ## Problem
90
-
91
- ## Current State
92
-
93
- ## Key Discoveries
94
-
95
- ## Decisions
96
-
97
- ## Rejected Alternatives
98
-
99
- ## Implementation Or Review History
100
-
101
- ## Verification
102
-
103
- ## Open Risks
104
-
105
- ## Next Likely Steps
106
- ```
107
-
108
- Keep the story focused on narrative. Do not duplicate the full map.
109
-
110
- ## Recovery Order
111
-
112
- When resuming work:
113
-
114
- 1. `git status --short`
115
- 2. `planr map show --json`
116
- 3. `planr trace item <item-id>`
117
- 4. `planr log list --item <item-id>`
118
- 5. `planr context list --item <item-id>`
119
- 6. read a relevant story log only if the trace and logs do not explain why the work exists
120
-
121
- The story log may explain direction, but it must not override the map.
package/docs/HOOKS.md DELETED
@@ -1,34 +0,0 @@
1
- # Host Hooks
2
-
3
- `planr install codex|claude|cursor` wires Planr into the host's native hook system **by default** — skip it with `--no-hooks`. The hooks solve one problem: loop state must survive the moments context is created or destroyed. Every new session and every context compaction gets the map state injected automatically via `planr prime`, so recovery stops being discipline and becomes mechanism.
4
-
5
- ## What gets installed
6
-
7
- | Host | File | Events | Runs |
8
- | --- | --- | --- | --- |
9
- | Cursor | `.cursor/hooks.json` | `sessionStart` | `planr prime --cursor-json` |
10
- | | | `subagentStop` | `.cursor/hooks/planr-evidence-guard.sh` |
11
- | Claude Code | `.claude/settings.json` | `SessionStart` (matcher `startup\|resume\|compact`) | `planr prime --hook-json` |
12
- | Codex CLI | `.codex/hooks.json` | `SessionStart` | `planr prime` |
13
-
14
- `planr prime` prints one compact, bounded state block (project, map counts, your held items with log status, the goal contract, registry presence, and the next command) — deterministic and read-only. `--hook-json` wraps it in the Claude Code SessionStart envelope (`hookSpecificOutput.additionalContext`); `--cursor-json` emits Cursor's `additional_context` shape.
15
-
16
- Only session-start events are wired, deliberately: they are the one place all three hosts inject hook output as context, and Claude's `compact` source plus post-compaction session starts cover the compaction case. Pre/post-compaction events (`preCompact`, `PreCompact`, `PostCompact`) cannot restore model context and are not used.
17
-
18
- The evidence guard is advisory and identity-scoped: a Cursor subagent that stops while *its own* pick (matched via `PLANR_WORKER_ID`/`PLANR_SESSION_ID`) has no completion log gets one follow-up message naming the item and the two ways out (`planr done ...` or `planr pick release ...`). Without an explicit worker identity it stays silent rather than steering the wrong agent toward foreign items. It never blocks.
19
-
20
- ## Design rules
21
-
22
- - **Fail open, always.** Every hook command ends in `|| true` with a 10-second timeout; a missing, broken, or uninitialized planr never blocks a session. In a repo without a Planr database, `planr prime` exits silently and creates nothing.
23
- - **Additive merge, planr owns only its own entries.** Existing hook files keep every foreign entry; planr entries are reconciled on re-install (current ones untouched, outdated ones upgraded in place, entries under retired events removed) — so `planr install <client>` after an update also refreshes the hooks. A file planr cannot parse as a JSON object is left untouched with a note in the install output — add the snippet manually in that case.
24
- - **Default, not mandatory.** `--no-hooks` skips hook installation entirely; deleting the planr entries from the hook files removes the behavior with no other effect.
25
-
26
- ## Codex trust model
27
-
28
- Codex requires reviewing hooks before they run: after installing, open `/hooks` in the Codex TUI once and trust the planr entries. Codex records trust against the hook definition's hash, so if a future planr version changes the hook commands, Codex will ask again — that is the host working as intended.
29
-
30
- ## Removing hooks
31
-
32
- Delete the planr entries from `.cursor/hooks.json` / `.claude/settings.json` / `.codex/hooks.json` (and `.cursor/hooks/planr-evidence-guard.sh`). Nothing else depends on them.
33
-
34
- See also: [Model Routing](MODEL_ROUTING.md), [Goals](GOALS.md), [CLI Reference](CLI_REFERENCE.md).
package/docs/IMPORT.md DELETED
@@ -1,21 +0,0 @@
1
- # Planr Packages
2
-
3
- ```bash
4
- planr project init "New Project"
5
- planr export --include-plans --include-logs --template-name "API backend slice" --tag api --out planr-package.json
6
- planr import planr-package.json --preview
7
- planr import planr-package.json --confirm
8
- ```
9
-
10
- Planr packages are local-first JSON files created by `planr export`. They carry graph items, links, contexts, optional logs, optional plan file snapshots, and review artifacts.
11
-
12
- Imports are preview-first. Preview reports package metadata, create counts, and conflicting item ids before mutating the current project.
13
-
14
- Planr packages are local-first JSON. For encrypted sharing, review the JSON locally and encrypt the file with your team's standard tool, for example:
15
-
16
- ```bash
17
- age -o planr-backup.json.age -r <recipient> planr-backup.json
18
- gpg -c planr-backup.json
19
- ```
20
-
21
- Planr does not require a hosted share service for V1.1.