planr 0.0.1 → 1.1.15

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 +144 -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 +124 -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 +98 -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 +112 -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 +49 -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
package/docs/GOALS.md ADDED
@@ -0,0 +1,155 @@
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.
43
+ ```
44
+
45
+ Each iteration follows the `$planr-loop` protocol:
46
+
47
+ ```text
48
+ 1. planr plan audit <plan-id> one-call contract verdict; holds -> exit
49
+ 2. $planr-work pick exactly one ready item, implement, finish with planr done --review
50
+ 3. live verify run the platform verification, log it with planr log add --kind verification --cmd
51
+ 4. $planr-review independent audit; complete -> review close --close-target,
52
+ findings -> fix items become the next ready items
53
+ 5. repeat
54
+ ```
55
+
56
+ `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.
57
+
58
+ The per-item path is three commands since v1.1.6:
59
+
60
+ ```bash
61
+ planr pick --json --plan <plan-id> # flat work packet, leased only from the goal's plan
62
+ planr done <item-id> --summary "..." --cmd "..." --review --next
63
+ planr review close <review-id> --verdict complete --reviewer <id> --close-target
64
+ ```
65
+
66
+ `--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 reports `reason: "no_ready_item_in_plan"` instead of silently widening.
67
+
68
+ `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.
69
+
70
+ ### 3. Finish
71
+
72
+ 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.
73
+
74
+ ## Recovery
75
+
76
+ 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:
77
+
78
+ ```text
79
+ /goal Use $planr-loop on plan pl-csv-export. The loop contract is stored in planr context (tag: goal-contract).
80
+ ```
81
+
82
+ 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.
83
+
84
+ ## Per-Host Setup
85
+
86
+ ### Codex with `/goal`
87
+
88
+ The recommended combination. Install the plugin and provision the subagent roles once:
89
+
90
+ ```bash
91
+ codex plugin marketplace add instructa/planr
92
+ codex plugin add planr@planr
93
+ planr project init "My Product" --client codex # writes .codex/agents/planr-worker.toml + planr-reviewer.toml
94
+ ```
95
+
96
+ Then:
97
+
98
+ ```text
99
+ $planr-goal <your goal> # prep: plan, map, contract, starter command
100
+ /goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
101
+ ```
102
+
103
+ The `/goal` PM dispatches `spawn the planr_worker agent for item <id>` and `spawn the planr_reviewer agent for item <id>` — the role files preload `$planr-work` and `$planr-review`, so dispatches stay one line. Codex Automations work the same way: set the automation prompt to the starter line.
104
+
105
+ ### Claude Code
106
+
107
+ Same shape via the plugin (`/plugin install planr@planr`), which registers the `planr-worker` and `planr-reviewer` subagents automatically:
108
+
109
+ ```text
110
+ /planr:planr-goal <your goal>
111
+ /goal Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
112
+ ```
113
+
114
+ `/loop` works for fixed-cadence runs instead of goal-conditioned ones.
115
+
116
+ ### Cursor and hosts without a loop primitive
117
+
118
+ Identical protocol; the human (or a background agent) is the re-dispatcher:
119
+
120
+ ```text
121
+ Use $planr-goal: <your goal>
122
+ Use $planr-loop on plan <plan-id>. The loop contract is stored in planr context (tag: goal-contract).
123
+ ```
124
+
125
+ `$planr-loop` iterates within the session under its own budget. If the session ends before the contract holds, dispatch the same line again — recovery is identical to the `/goal` case.
126
+
127
+ ### Plain MCP clients
128
+
129
+ Any MCP-capable agent uses the same flow over `planr mcp`. Every session starts with map state, so the loop is resumable by construction.
130
+
131
+ ## Coming From Other Goal Tools
132
+
133
+ If you already run goal workflows with other tools, the concepts map directly:
134
+
135
+ | Elsewhere | In Planr |
136
+ | --- | --- |
137
+ | Goal charter file (`goal.md`) | product/build plan (`planr plan new`, rich scope + verification) |
138
+ | Board/state file (`state.yaml`) | the map (`planr map show`, authoritative item state) |
139
+ | One active task | `planr pick` (single owner, heartbeat, stale recovery) |
140
+ | Task receipts | `planr log` / `planr done` (files, commands, results) |
141
+ | Goal oracle / completion proof | goal contract + live verification log |
142
+ | Scout/Judge/Worker roles | worker/reviewer subagents + `$planr-status` for honest reads |
143
+ | Final audit before done | `$planr-review` with `review close --verdict complete` |
144
+
145
+ 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.
146
+
147
+ ## Rules That Keep Goal Runs Honest
148
+
149
+ - Never weaken a stored goal contract mid-run; scope changes go through `$planr-plan` and the user.
150
+ - "Done" means the feature ran (live verification log), not that it compiles.
151
+ - The maker never closes its own review; single-agent hosts record `review-mode` honestly.
152
+ - Two iterations without map-state movement -> stop and report instead of grinding.
153
+ - Destructive or out-of-repo side effects always go behind `planr approval request`.
154
+
155
+ 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).
@@ -0,0 +1,121 @@
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/IMPORT.md ADDED
@@ -0,0 +1,21 @@
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.
@@ -0,0 +1,98 @@
1
+ # Install Planr
2
+
3
+ ## Recommended User Install
4
+
5
+ Planr's canonical release source is:
6
+
7
+ - https://github.com/instructa/planr/releases
8
+
9
+ Install the current GitHub Release with the repo-owned installer:
10
+
11
+ ```bash
12
+ curl -fsSL https://raw.githubusercontent.com/instructa/planr/main/scripts/install.sh | sh
13
+ planr --version
14
+ planr doctor --client all
15
+ ```
16
+
17
+ The installer downloads `planr-<os>-<arch>.tar.gz` from the latest GitHub Release. Override the release source with:
18
+
19
+ ```bash
20
+ PLANR_DOWNLOAD=1 PLANR_VERSION=v1.0.0 sh scripts/install.sh
21
+ PLANR_DOWNLOAD=1 PLANR_REPO=your-org/planr PLANR_VERSION=v1.0.0 sh scripts/install.sh
22
+ PLANR_DOWNLOAD=1 PLANR_TARGET=darwin-arm64 sh scripts/install.sh
23
+ PLANR_DOWNLOAD=1 PLANR_RELEASE_BASE_URL=https://example.com/releases sh scripts/install.sh
24
+ ```
25
+
26
+ Download installs verify `SHA256SUMS` from the same release location by default. Use `PLANR_SKIP_CHECKSUM=1` only for local development mirrors where the checksum file is intentionally unavailable.
27
+
28
+ ## Homebrew Tap
29
+
30
+ Homebrew is the preferred day-to-day package-manager path after the tap is published. The expected command is `brew install instructa/tap/planr`.
31
+
32
+ Until the tap is published, use the GitHub Release installer or manual release asset download.
33
+
34
+ ## Manual GitHub Release Install
35
+
36
+ Download the matching asset from GitHub Releases:
37
+
38
+ ```bash
39
+ tar -xzf planr-darwin-arm64.tar.gz
40
+ PREFIX="$HOME/.local" PLANR_BIN="$PWD/planr" scripts/install.sh
41
+ planr --version
42
+ ```
43
+
44
+ Windows native release assets are not part of the current public install contract. Windows users should use WSL with the Linux release asset or build from source until a Windows asset is published.
45
+
46
+ ## Client Setup
47
+
48
+ Planr does not edit global agent configuration during install. From a project, use:
49
+
50
+ ```bash
51
+ planr doctor --client all
52
+ planr install codex --dry-run
53
+ planr install claude --dry-run
54
+ planr install cursor --dry-run
55
+ planr prompt mcp
56
+ planr prompt cli --client codex
57
+ planr prompt http
58
+ ```
59
+
60
+ `planr install claude` writes a project `.mcp.json`; `planr install cursor` writes `.cursor/mcp.json`; `planr install codex` writes a project MCP snippet. All install commands also provision the `planr-worker` and `planr-reviewer` subagent role files (`.codex/agents/`, `.claude/agents/`) without overwriting existing edits; `planr project init --client <client|all>` does the same at init time. Dry-runs print the exact config and scope notes first.
61
+
62
+ Runtime surfaces:
63
+
64
+ ```bash
65
+ planr mcp # stdio MCP server for any MCP-capable client
66
+ planr serve --port 7526 # localhost HTTP/SSE
67
+ ```
68
+
69
+ Open `http://127.0.0.1:7526/review` after `planr serve` for the local browser review workspace.
70
+
71
+ ## Agent Skills And Plugin
72
+
73
+ The repository ships a plugin under `plugins/planr` for Codex, Claude Code, and Cursor that bundles the Planr skills (`$planr`, `$planr-loop`, stage and capability skills) and the subagent roles. The plugin carries skills and roles only; the CLI above must be installed separately. See [Skills](SKILLS.md) for plugin install commands and the skill workflow.
74
+
75
+ ## From Source
76
+
77
+ Use Cargo when developing Planr or building from a checked-out source tree:
78
+
79
+ ```bash
80
+ cargo build --release
81
+ PREFIX="$HOME/.local" scripts/install.sh
82
+ planr --version
83
+ planr doctor --client all
84
+ ```
85
+
86
+ The install script copies the selected binary to `PREFIX/bin/planr`. It is idempotent and does not edit global shell or agent-client configuration.
87
+
88
+ During development, run any command directly without installing: `cargo run -- <command>` (for example `cargo run -- map show`).
89
+
90
+ ## Release Artifact
91
+
92
+ ```bash
93
+ scripts/build-release.sh
94
+ cat dist/planr-*/SHA256SUMS
95
+ cat dist/SHA256SUMS
96
+ ```
97
+
98
+ Release builds include a local artifact directory plus a platform tarball named `planr-<os>-<arch>.tar.gz`.
@@ -0,0 +1,70 @@
1
+ # MCP Contract
2
+
3
+ Planr exposes a local stdio MCP server with a stable V1 contract for coding-agent clients.
4
+
5
+ ## Server
6
+
7
+ ```bash
8
+ planr --db .planr/planr.sqlite mcp
9
+ ```
10
+
11
+ The server supports:
12
+
13
+ - `tools/list`
14
+ - `tools/call`
15
+ - `resources/list`
16
+ - `resources/read`
17
+ - `prompts/list`
18
+ - `prompts/get`
19
+
20
+ ## Machine-Checkable Fixture
21
+
22
+ The canonical fixture is:
23
+
24
+ ```text
25
+ docs/fixtures/mcp-contract.json
26
+ ```
27
+
28
+ Tests compare this fixture against live MCP stdio responses, install dry-run output, and CLI reference coverage.
29
+
30
+ ## Tool Contract
31
+
32
+ Every tool declares a real JSON Schema: typed `properties`, explicit `required` fields, and `additionalProperties = false`. The only exception is `planr_review_ingest`, which keeps `additionalProperties = true` so arbitrary hook payload shapes can be ingested. Unknown tools return an `isError` MCP result containing a JSON error with code `not_found`.
33
+
34
+ Required groups:
35
+
36
+ - project and map reads
37
+ - plan creation, refinement, split, check, and link
38
+ - map build, preview, unlocks, lookahead, and pressure-oriented reads
39
+ - item create, breakdown, insert, amend, and replan
40
+ - pick, heartbeat, progress, pause, resume, stale inspection, and recovery sweep
41
+ - approval request, approve, deny, and list
42
+ - artifact add, list, and show
43
+ - event list and debug bundle preview
44
+ - log add and read
45
+ - review annotate, ingest, artifact, evidence, and close
46
+ - item close, context create, and search
47
+
48
+ `planr_recover_sweep` mirrors `planr recover sweep`: it previews by default and only mutates state when `apply` is true. It returns stale picked work, timed-out work, retryable failed work, exhausted failures, and applied release/retry counts.
49
+
50
+ ## Review Contract
51
+
52
+ Review feedback ingestion is advisory:
53
+
54
+ - `planr_review_annotate` stores item-linked annotation context.
55
+ - `planr_review_ingest` stores hook-compatible feedback and never auto-closes or auto-approves work.
56
+ - `planr_review_artifact` writes a privacy-minimized review artifact.
57
+ - `planr_review_evidence` returns Git/PR evidence scoped to files named by item logs or artifacts, and treats unrelated dirty files as non-owned.
58
+ - `planr_review_close` records the final verdict, writes a review artifact, and creates fix/follow-up review work when the verdict is not clean.
59
+
60
+ HTTP mirrors the same rule: `GET /v1/reviews/:id/artifact` is read-only; `POST /v1/reviews/:id/artifact` writes an artifact explicitly.
61
+
62
+ ## Install Contract
63
+
64
+ `planr install <client> --dry-run` prints project-scoped configuration for Codex, Claude Code, and Cursor. Non-dry install writes only repository-local files:
65
+
66
+ - Codex: `.planr/integrations/codex-mcp.toml`
67
+ - Claude Code: `.mcp.json`
68
+ - Cursor: `.cursor/mcp.json`
69
+
70
+ Planr does not edit global client configuration without a separate explicit operator action.
@@ -0,0 +1,40 @@
1
+ # MCP Guide
2
+
3
+ Planr exposes one stdio MCP server:
4
+
5
+ ```bash
6
+ planr mcp
7
+ ```
8
+
9
+ Core tools include project/map reads, map status/preview/unlocks/lookahead, plan creation/refinement/splitting, map build, item create/breakdown/insert/amend/replan, pick, runtime heartbeat/progress/pause/resume/stale inspection, recovery sweep, approval request/approve/deny/list, artifact add/list/show, event list, debug bundle preview, log, review annotate/ingest/artifact/evidence/close, close, context create, search, and log read.
10
+
11
+ Review feedback tools:
12
+
13
+ - `planr_review_annotate`: add item-linked review feedback with severity, optional file, line, and author.
14
+ - `planr_review_ingest`: ingest hook-compatible JSON feedback without auto-closing or auto-approving work.
15
+ - `planr_review_artifact`: write a privacy-minimized `.planr/reviews/*.review.md` artifact.
16
+ - `planr_review_evidence`: return scoped Git/PR review evidence without source contents.
17
+ - `planr_review_close`: close a review item, write a review artifact, and create fix/follow-up review work when the verdict is not clean.
18
+
19
+ Resources:
20
+
21
+ - `planr://project/map`
22
+ - `planr://project/context`
23
+ - `planr://item/{id}`
24
+ - `planr://plan/{id}`
25
+ - `planr://log/{id}`
26
+
27
+ Prompts:
28
+
29
+ - `planr-plan`
30
+ - `planr-work`
31
+ - `planr-review`
32
+ - `planr-map`
33
+ - `planr-summary`
34
+
35
+ Use `planr install <client> --dry-run` to print project-scoped config.
36
+
37
+ The stable V1 contract and checked fixture live in:
38
+
39
+ - `docs/MCP_CONTRACT.md`
40
+ - `docs/fixtures/mcp-contract.json`
package/docs/NPM.md ADDED
@@ -0,0 +1,40 @@
1
+ # npm Package
2
+
3
+ The npm package name is `planr`. Published versions bundle platform-native binaries under `npm/native/<os>-<arch>/planr`, so installing from npm requires no Rust toolchain:
4
+
5
+ ```bash
6
+ npm install -g planr
7
+ planr --version
8
+ ```
9
+
10
+ Supported platforms: `darwin-arm64`, `darwin-x86_64`, `linux-x86_64`, `linux-arm64`. There is no postinstall script and no network download at install time; the binaries ship inside the tarball and are checksum-verified against the GitHub Release `SHA256SUMS` before publish.
11
+
12
+ ## Publishing
13
+
14
+ Publishing happens only from the `npm-publish` job in `.github/workflows/release.yml` via npm Trusted Publishing (OIDC, no long-lived token). The job runs when the repository variable `NPM_PUBLISH_ENABLED` is `true` and requires a one-time Trusted Publisher configuration on npmjs.com: package `planr` -> Settings -> Publishing access -> GitHub Actions publisher with repository `instructa/planr` and workflow `release.yml`.
15
+
16
+ ## Binary Resolution
17
+
18
+ The wrapper looks for a native binary in this order:
19
+
20
+ 1. `PLANR_NATIVE_BIN`;
21
+ 2. `npm/native/<os>-<arch>/planr` (published package);
22
+ 3. `target/release/planr` then `target/debug/planr` (repository checkout).
23
+
24
+ ## Local Development
25
+
26
+ The repository checkout contains no `npm/native/` binaries; the wrapper falls back to local cargo builds:
27
+
28
+ ```bash
29
+ cargo build --release
30
+ npm link
31
+ planr --version
32
+ ```
33
+
34
+ For consumer E2E testing:
35
+
36
+ ```bash
37
+ cd ~/projects/planr-test
38
+ npm link ../planr
39
+ npm run test:npm-planr
40
+ ```