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.
- package/LICENSE.md +21 -0
- package/README.md +144 -0
- package/docs/ARCHITECTURE.md +75 -0
- package/docs/CI.md +54 -0
- package/docs/CLAUDE_CODE.md +33 -0
- package/docs/CLI_REFERENCE.md +124 -0
- package/docs/CODEX.md +48 -0
- package/docs/CURSOR.md +30 -0
- package/docs/GOALS.md +155 -0
- package/docs/HANDOFFS_AND_STORIES.md +121 -0
- package/docs/IMPORT.md +21 -0
- package/docs/INSTALL.md +98 -0
- package/docs/MCP_CONTRACT.md +70 -0
- package/docs/MCP_GUIDE.md +40 -0
- package/docs/NPM.md +40 -0
- package/docs/OPERATING_MODEL.md +250 -0
- package/docs/RELEASE.md +140 -0
- package/docs/SECURITY.md +8 -0
- package/docs/SKILLS.md +278 -0
- package/docs/TASK_GRAPH_MODEL.md +222 -0
- package/docs/TESTING.md +87 -0
- package/docs/TROUBLESHOOTING.md +26 -0
- package/docs/fixtures/mcp-contract.json +92 -0
- package/docs/planr-spec/ADRS.md +160 -0
- package/docs/planr-spec/AI_SPEC.md +138 -0
- package/docs/planr-spec/ANALYTICS_OBSERVABILITY_SPEC.md +124 -0
- package/docs/planr-spec/API_AND_DATA_MODEL.md +517 -0
- package/docs/planr-spec/BACKEND_IMPLEMENTATION_SPEC.md +178 -0
- package/docs/planr-spec/CLIENT_IMPLEMENTATION_SPEC.md +119 -0
- package/docs/planr-spec/DESIGN_SYSTEM_SPEC.md +102 -0
- package/docs/planr-spec/PRODUCT_SPEC.md +193 -0
- package/docs/planr-spec/QA_ACCEPTANCE_TESTS.md +146 -0
- package/docs/planr-spec/README.md +67 -0
- package/docs/planr-spec/REFERENCES.md +29 -0
- package/docs/planr-spec/RELEASE_READINESS.md +95 -0
- package/docs/planr-spec/SAFETY_PRIVACY_SECURITY.md +169 -0
- package/docs/planr-spec/TASKS.md +932 -0
- package/docs/planr-spec/TECH_ARCHITECTURE.md +143 -0
- package/docs/planr-spec/UX_FLOWS.md +235 -0
- package/docs/planr-spec/V1_1_DIFFERENTIATION_CONTRACT.md +177 -0
- package/docs/planr-spec.zip +0 -0
- package/npm/bin/planr.js +54 -0
- package/npm/native/darwin-arm64/planr +0 -0
- package/npm/native/darwin-x86_64/planr +0 -0
- package/npm/native/linux-arm64/planr +0 -0
- package/npm/native/linux-x86_64/planr +0 -0
- package/package.json +27 -8
- package/plugins/planr/.claude-plugin/plugin.json +11 -0
- package/plugins/planr/.codex-plugin/plugin.json +25 -0
- package/plugins/planr/agents/planr-reviewer.md +12 -0
- package/plugins/planr/agents/planr-worker.md +10 -0
- package/plugins/planr/skills/planr/SKILL.md +52 -0
- package/plugins/planr/skills/planr-goal/SKILL.md +69 -0
- package/plugins/planr/skills/planr-loop/SKILL.md +112 -0
- package/plugins/planr/skills/planr-loop/agents/planr-reviewer.toml +17 -0
- package/plugins/planr/skills/planr-loop/agents/planr-worker.toml +14 -0
- package/plugins/planr/skills/planr-plan/SKILL.md +58 -0
- package/plugins/planr/skills/planr-review/SKILL.md +49 -0
- package/plugins/planr/skills/planr-status/SKILL.md +50 -0
- package/plugins/planr/skills/planr-summary/SKILL.md +28 -0
- package/plugins/planr/skills/planr-task-graph/SKILL.md +228 -0
- package/plugins/planr/skills/planr-verify-web/SKILL.md +76 -0
- package/plugins/planr/skills/planr-work/SKILL.md +68 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
# Planr Operating Model
|
|
2
|
+
|
|
3
|
+
Planr coordinates coding-agent work through two durable surfaces:
|
|
4
|
+
|
|
5
|
+
- the Markdown plan package for product, build, architecture, verification, and narrative context;
|
|
6
|
+
- the SQLite map for item state, links, picks, reviews, logs, contexts, and closure.
|
|
7
|
+
|
|
8
|
+
The map is the source of truth for live state. Markdown explains why the work exists and what good completion means.
|
|
9
|
+
|
|
10
|
+
## Operator Start
|
|
11
|
+
|
|
12
|
+
Start every session by reading the current project and graph state:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
planr project show --json
|
|
16
|
+
planr map show --json
|
|
17
|
+
planr map lane --critical
|
|
18
|
+
planr map pressure
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If the repository has no Planr project yet:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
planr project init "Project Name" --client all
|
|
25
|
+
planr doctor --client all
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Use `--db <path>` for isolated runs and tests.
|
|
29
|
+
|
|
30
|
+
## Canonical Flow
|
|
31
|
+
|
|
32
|
+
The default product flow is:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
idea -> product plan -> build plan -> map -> pick -> log -> review/evidence -> recovery/package -> close
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Use product and build plans for broad scope:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
planr plan new "App idea" --platform web --ai --backend
|
|
42
|
+
planr plan refine <plan-id> --note "decision or assumption"
|
|
43
|
+
planr plan split <plan-id> --slice "MVP implementation"
|
|
44
|
+
planr plan check <build-plan-id>
|
|
45
|
+
planr map build --from <build-plan-id>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Product-plan task lists are candidates. Work becomes a live commitment only after it is in the map.
|
|
49
|
+
|
|
50
|
+
## Daily Agent Loop
|
|
51
|
+
|
|
52
|
+
Agents should work one map item at a time. The short path is:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
planr pick --json
|
|
56
|
+
planr done <item-id> --summary "what changed" --files a --files b --cmd "exact verification command" --review [--next]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
`pick --json` returns one flat work packet (item, links, logs, runtime, recovery, conditions, recall context, `remaining` progress), so no separate `trace item` call is needed. `pick --work-type review` (or `code`) keeps checker and maker leases separate, and a null pick always carries a `reason` plus the `remaining` snapshot. `done` writes the completion log, then requests review (`--review`) or closes directly, and `--next` picks the following item. Evidence logging refreshes the heartbeat, so explicit `pick heartbeat` calls are only needed during long silent stretches.
|
|
60
|
+
|
|
61
|
+
For longer work, update runtime state instead of relying on chat history:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
planr pick progress <item-id> --percent 50 --note "implementation done, tests running"
|
|
65
|
+
planr pick pause <item-id> --note "waiting for human decision"
|
|
66
|
+
planr pick resume <item-id>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
If a previous worker disappears, inspect stale picks before taking over:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
planr pick stale --older-than-seconds 900
|
|
73
|
+
planr pick stale --older-than-seconds 900 --release
|
|
74
|
+
planr recover sweep --older-than-seconds 900
|
|
75
|
+
planr recover sweep --older-than-seconds 900 --apply
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use `pick stale --release` for a targeted stale-claim reset. Use `recover sweep --apply` when you also want timed-out work and retryable failed work handled in the same explicit recovery pass.
|
|
79
|
+
|
|
80
|
+
Record discoveries that future work needs:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
planr context add "decision or discovery" --item <item-id> --tag discovery
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Record completion evidence before asking for review:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
planr log add --item <item-id> \
|
|
90
|
+
--summary "what changed" \
|
|
91
|
+
--files path-a,path-b \
|
|
92
|
+
--cmd "exact verification command"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Request and close review:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
planr review request <item-id>
|
|
99
|
+
planr review annotate <item-id> --message "review note" --severity warning
|
|
100
|
+
planr review evidence <item-id> --pr-url https://example.invalid/pr/123
|
|
101
|
+
planr review ingest <item-id> --from .planr/tmp/review-feedback.json
|
|
102
|
+
planr review close <review-id> --verdict complete --close-target
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
With `--close-target` a complete verdict also closes the reviewed item (it must already carry a completion log); otherwise finish with `planr close <item-id> --summary "Verified with evidence"`.
|
|
106
|
+
|
|
107
|
+
`review evidence` records Git branch, commit, dirty state, item-scoped changed-file provenance, and optional PR URL context without treating unrelated dirty files as proof. Review ingestion records hook-compatible JSON feedback as contexts and logs only. It does not close the review, approve the item, or unblock downstream work.
|
|
108
|
+
|
|
109
|
+
For a browser-based local review pass:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
planr serve --port 7526
|
|
113
|
+
open http://127.0.0.1:7526/review
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The review workspace shows review queues, linked plans, item evidence, diff-safe Git evidence, annotations, and approve/request-changes actions over the same local HTTP API.
|
|
117
|
+
|
|
118
|
+
Use approvals when a human decision must block closure:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
planr approval request <item-id> --reason "release approval"
|
|
122
|
+
planr approval approve <item-id> --by "human reviewer"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Pending or denied approval blocks `planr close`; use `planr map preview --close <item-id>` to inspect the gate before mutating state.
|
|
126
|
+
|
|
127
|
+
If review finds issues:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
planr review close <review-id> \
|
|
131
|
+
--verdict not-complete \
|
|
132
|
+
--findings "specific actionable finding"
|
|
133
|
+
planr review artifact <review-id>
|
|
134
|
+
planr map show --json
|
|
135
|
+
planr pick --json
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Review findings create follow-up work and write a `.planr/reviews/*.review.md` artifact. Do not mark the original item complete by summarizing the finding away.
|
|
139
|
+
|
|
140
|
+
## Parent Gate Pattern
|
|
141
|
+
|
|
142
|
+
Model material changes as parent gates. The parent is not the work package; its linked children are.
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
parent gate
|
|
146
|
+
`- implementation or test child
|
|
147
|
+
`- review item linked to that child
|
|
148
|
+
|- pass -> child can close -> parent gate auto-closes
|
|
149
|
+
`- findings -> fix item -> follow-up review -> ...
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Rules:
|
|
153
|
+
|
|
154
|
+
- create one parent item for the change;
|
|
155
|
+
- use `planr item breakdown <parent-id> --into "Implement, Verify"` to create child work under the parent;
|
|
156
|
+
- request review on the implementation or test child after evidence exists;
|
|
157
|
+
- if review finds issues, let Planr create fix and follow-up review work from the review verdict;
|
|
158
|
+
- downstream top-level work should depend on the parent gate, not on the first implementation child.
|
|
159
|
+
|
|
160
|
+
This keeps later work blocked until review is actually clean.
|
|
161
|
+
|
|
162
|
+
Parent gates roll up automatically: once every child is closed or cancelled, the gate becomes ready and auto-closes when no review or approval on the gate itself is open (a cancelled or partially closed child rolls up as `closed_partial`). Parent gates are never returned by `planr pick`; the children are the work.
|
|
163
|
+
|
|
164
|
+
## Notes, Contexts, Logs, And Stories
|
|
165
|
+
|
|
166
|
+
Use the smallest durable surface that fits the information:
|
|
167
|
+
|
|
168
|
+
- `planr log add`: proof that work happened, including files, commands, tests, review results, and handoff facts.
|
|
169
|
+
- `planr context add`: a project or item discovery that another future item may need.
|
|
170
|
+
- `planr note add`: a short task-local note when a human or agent needs nearby context.
|
|
171
|
+
- Story logs: longer narrative history when graph state and short contexts are too thin.
|
|
172
|
+
|
|
173
|
+
Story logs are narrative memory, not status authority. The map remains authoritative for state.
|
|
174
|
+
|
|
175
|
+
See [HANDOFFS_AND_STORIES.md](HANDOFFS_AND_STORIES.md) for file placement and contents.
|
|
176
|
+
|
|
177
|
+
## Recovery
|
|
178
|
+
|
|
179
|
+
After interruption, compaction, or agent handoff:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
git status --short
|
|
183
|
+
planr project show --json
|
|
184
|
+
planr map show --json
|
|
185
|
+
planr map lane --critical
|
|
186
|
+
planr map pressure
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Then inspect the current item:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
planr trace item <item-id>
|
|
193
|
+
planr log list --item <item-id>
|
|
194
|
+
planr context list --item <item-id>
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
If ownership must be reset:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
planr pick stale --older-than-seconds 900
|
|
201
|
+
planr pick release <item-id> --force
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Use force only when the prior owner is gone or the operator intentionally resets the claim.
|
|
205
|
+
|
|
206
|
+
For broad interruption recovery, prefer the explicit sweeper:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
planr recover sweep --older-than-seconds 900
|
|
210
|
+
planr recover sweep --older-than-seconds 900 --apply
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
The preview reports stale picks, timed-out work, retryable failures, retry delays, and manual pre/post conditions. The apply mode mutates only the listed recoverable work and records recovery events.
|
|
214
|
+
|
|
215
|
+
## Packages And Sharing
|
|
216
|
+
|
|
217
|
+
Use packages for local backups and reusable templates:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
planr export --include-plans --include-logs --template-name "Backend slice" --tag api --out planr-package.json
|
|
221
|
+
planr import planr-package.json --preview
|
|
222
|
+
planr import planr-package.json --confirm
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Import is preview-first. Confirmed import restores graph items, links, contexts, logs, plan file snapshots, and review artifacts into the current project. Encrypted sharing can wrap the JSON package with a local tool such as `age` or `gpg`; Planr does not require a hosted share service.
|
|
226
|
+
|
|
227
|
+
## Agent Prompts
|
|
228
|
+
|
|
229
|
+
Use prompt output when configuring agents without editing global config:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
planr prompt cli --client codex
|
|
233
|
+
planr prompt mcp --client all
|
|
234
|
+
planr prompt http
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Prompt commands print ready-to-use setup and operating instructions and report that global config was not edited.
|
|
238
|
+
|
|
239
|
+
## Completion Rule
|
|
240
|
+
|
|
241
|
+
Do not call a scope complete until all of these are true:
|
|
242
|
+
|
|
243
|
+
- required child and review items are closed;
|
|
244
|
+
- log evidence records exact files and commands;
|
|
245
|
+
- verification commands were actually run;
|
|
246
|
+
- review findings are closed or converted into follow-up work;
|
|
247
|
+
- `planr map show --json` has no in-scope blocker;
|
|
248
|
+
- the summary matches the map, logs, and review state.
|
|
249
|
+
|
|
250
|
+
For release-grade scopes, rerun the full verification ladder in [TESTING.md](TESTING.md).
|
package/docs/RELEASE.md
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Release
|
|
2
|
+
|
|
3
|
+
Planr V1 releases are built from the Rust binary, public docs, skills, and public assets. The canonical public release source is `https://github.com/instructa/planr`.
|
|
4
|
+
|
|
5
|
+
The v1 repository-owned public install order is:
|
|
6
|
+
|
|
7
|
+
1. GitHub Release curl installer.
|
|
8
|
+
2. Manual GitHub Release asset download.
|
|
9
|
+
3. Homebrew after the tap/formula is published.
|
|
10
|
+
4. npm (`npm install -g planr`) with bundled platform binaries.
|
|
11
|
+
5. Cargo/source builds for maintainers and contributors.
|
|
12
|
+
|
|
13
|
+
Published npm versions bundle platform-native binaries; see `docs/NPM.md`.
|
|
14
|
+
|
|
15
|
+
## Version Bump
|
|
16
|
+
|
|
17
|
+
`scripts/release.sh` is the only supported release path. The version lives in one source (`Cargo.toml`) and four distribution manifests must carry it: `Cargo.toml`, `package.json`, `plugins/planr/.codex-plugin/plugin.json`, and `plugins/planr/.claude-plugin/plugin.json`. Manual tagging skips the manifest sync and ships stale plugin versions.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
scripts/release.sh 1.2.0 "one-line release summary"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The script enforces, in order:
|
|
24
|
+
|
|
25
|
+
1. branch is `main`, worktree is clean, `CHANGELOG.md` already has a committed `## [x.y.z]` section, and the tag does not exist;
|
|
26
|
+
2. the version is written into all four manifests plus `Cargo.lock`;
|
|
27
|
+
3. gates: `cargo test` (includes the manifest drift guard in `tests/e2e.rs`), `npm pack --dry-run`, and `scripts/security-local.sh` (betterleaks + trivy leak gate);
|
|
28
|
+
4. one mechanical commit `release x.y.z: <summary>`, tag `vx.y.z`, and a single push of branch plus tag.
|
|
29
|
+
|
|
30
|
+
Two independent gates back the script:
|
|
31
|
+
|
|
32
|
+
- `cargo test` fails on every push when any manifest version drifts from `Cargo.toml`.
|
|
33
|
+
- The release workflow's `Verify release versions are consistent` step refuses the tag when the tag, any manifest, or the `CHANGELOG.md` section disagree.
|
|
34
|
+
|
|
35
|
+
## Automated Release Pipeline
|
|
36
|
+
|
|
37
|
+
Pushing a tag `vX.Y.Z` runs `.github/workflows/release.yml`:
|
|
38
|
+
|
|
39
|
+
1. `create-release` verifies the tag against `Cargo.toml`, all distribution manifests, and the changelog section, then creates a draft GitHub Release.
|
|
40
|
+
2. `build` compiles and packages `planr-<os>-<arch>.tar.gz` for `darwin-arm64`, `darwin-x86_64`, `linux-x86_64`, and `linux-arm64`, then uploads each asset to the draft release.
|
|
41
|
+
3. `finalize` downloads all uploaded assets, writes one aggregated `SHA256SUMS` covering every tarball, uploads it, and publishes the release.
|
|
42
|
+
4. `npm-publish` downloads the release assets, verifies them against `SHA256SUMS`, bundles the four platform binaries into `npm/native/`, smoke-tests the wrapper, and publishes to npm via Trusted Publishing (OIDC). Runs only when the repository variable `NPM_PUBLISH_ENABLED` is `true`; requires the one-time Trusted Publisher setup described in `docs/NPM.md`.
|
|
43
|
+
5. `homebrew-tap` regenerates `Formula/planr.rb` with `scripts/generate-formula.sh` and pushes it to `instructa/homebrew-tap` (installed as `brew install instructa/tap/planr`).
|
|
44
|
+
|
|
45
|
+
## Changelog
|
|
46
|
+
|
|
47
|
+
`CHANGELOG.md` at the repository root is the persistent release log ([Keep a Changelog](https://keepachangelog.com/en/1.1.0/) format). Maintain it continuously, not at release time only:
|
|
48
|
+
|
|
49
|
+
- Every user-visible change (CLI surface, JSON envelope, skills, MCP/HTTP contract, install paths) lands in the `[Unreleased]` section in the same PR or commit that makes the change.
|
|
50
|
+
- Before pushing a release tag, rename `[Unreleased]` to the new version with the release date, add a fresh empty `[Unreleased]` section, and update the compare links at the bottom. The tag must not ship with a non-empty `[Unreleased]` section describing its own changes.
|
|
51
|
+
- The version section is the source for the GitHub Release notes body.
|
|
52
|
+
|
|
53
|
+
The Homebrew job only runs when the repository variable `HOMEBREW_TAP_ENABLED` is `true` and requires a `TAP_GITHUB_TOKEN` secret with write access to `instructa/homebrew-tap`. The tap repository must exist before enabling it.
|
|
54
|
+
|
|
55
|
+
## Preflight
|
|
56
|
+
|
|
57
|
+
Run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
scripts/ci-local.sh
|
|
61
|
+
scripts/security-local.sh
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
The external consumer E2E suite must pass when available on the release machine.
|
|
65
|
+
|
|
66
|
+
## Build Artifact
|
|
67
|
+
|
|
68
|
+
Create the local release artifact:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
scripts/build-release.sh
|
|
72
|
+
cat dist/planr-*/SHA256SUMS
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
The artifact contains:
|
|
76
|
+
|
|
77
|
+
- `planr`
|
|
78
|
+
- `README.md`
|
|
79
|
+
- `LICENSE.md`
|
|
80
|
+
- `SHA256SUMS`
|
|
81
|
+
|
|
82
|
+
The GitHub Release upload asset is:
|
|
83
|
+
|
|
84
|
+
- `dist/planr-<os>-<arch>.tar.gz`
|
|
85
|
+
|
|
86
|
+
The tarball checksum is written to `dist/SHA256SUMS`.
|
|
87
|
+
|
|
88
|
+
The release installer downloads and verifies `SHA256SUMS` from the same release URL unless `PLANR_SKIP_CHECKSUM=1` is set for a development mirror.
|
|
89
|
+
|
|
90
|
+
## npm Dry-Run
|
|
91
|
+
|
|
92
|
+
Verify npm package contents as a development-package check:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
npm pack --dry-run
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The package must include:
|
|
99
|
+
|
|
100
|
+
- `npm/bin/planr.js`
|
|
101
|
+
- `docs/`
|
|
102
|
+
- `docs/MCP_CONTRACT.md`
|
|
103
|
+
- `docs/fixtures/mcp-contract.json`
|
|
104
|
+
- `plugins/`
|
|
105
|
+
- `README.md`
|
|
106
|
+
- `LICENSE.md`
|
|
107
|
+
|
|
108
|
+
`npm/native/` platform binaries exist only in the `npm-publish` CI job; the local dry-run does not include them.
|
|
109
|
+
|
|
110
|
+
## Install Smoke
|
|
111
|
+
|
|
112
|
+
After building:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
node npm/bin/planr.js --version
|
|
116
|
+
PREFIX="$(mktemp -d)" scripts/install.sh
|
|
117
|
+
PLANR_BIN="$(find dist -path '*/planr' -type f | head -n 1)" PREFIX="$(mktemp -d)" scripts/install.sh
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Then run:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
PLANR_BIN=planr npm run test:npm-planr
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
from the external consumer E2E project.
|
|
127
|
+
|
|
128
|
+
## Release Notes Checklist
|
|
129
|
+
|
|
130
|
+
Before publishing, record:
|
|
131
|
+
|
|
132
|
+
- `CHANGELOG.md` updated: `[Unreleased]` rolled into the tagged version section;
|
|
133
|
+
- exact commit or source snapshot;
|
|
134
|
+
- `cargo test` result;
|
|
135
|
+
- consumer E2E result;
|
|
136
|
+
- `npm pack --dry-run` file list;
|
|
137
|
+
- release artifact checksum;
|
|
138
|
+
- GitHub Release asset name and checksum;
|
|
139
|
+
- security/leak scan result;
|
|
140
|
+
- known risks or intentionally unsupported platforms.
|
package/docs/SECURITY.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Security And Privacy
|
|
2
|
+
|
|
3
|
+
- Planr is local-first and stores V1 data in the configured SQLite database and `.planr` files.
|
|
4
|
+
- No content telemetry is emitted by default.
|
|
5
|
+
- Shell commands are not run by Planr unless the user explicitly runs them outside Planr or records them as evidence.
|
|
6
|
+
- HTTP binds to `127.0.0.1`.
|
|
7
|
+
- Destructive operations require confirmation or preview flags.
|
|
8
|
+
- Logs, contexts, and inline artifact content are checked by `planr scrub` for common secret-looking patterns. `planr scrub --confirm` rewrites flagged values in place with `[REDACTED]` markers, updates the search index, and records a `secret_scrubbed` event per rewritten row.
|
package/docs/SKILLS.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# Planr Skills
|
|
2
|
+
|
|
3
|
+
Planr ships agent-facing skill templates under `plugins/planr/skills/`.
|
|
4
|
+
|
|
5
|
+
The repository ships an installable plugin under `plugins/planr` for Codex, Claude Code, and Cursor, so the skills can be installed as one package instead of copied by hand. Marketplace manifests at the repo root (`.agents/plugins/marketplace.json`, `.claude-plugin/marketplace.json`) point at that subdirectory — Codex silently ignores marketplaces whose plugin source is the repo root itself. The plugin only carries skills and agent roles; the `planr` CLI must be installed separately (`brew install instructa/tap/planr`).
|
|
6
|
+
|
|
7
|
+
## Install As Plugin (preferred)
|
|
8
|
+
|
|
9
|
+
Codex:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
codex plugin marketplace add instructa/planr
|
|
13
|
+
# then install "planr" from the plugin directory picker, or:
|
|
14
|
+
codex plugin add planr@planr
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Claude Code:
|
|
18
|
+
|
|
19
|
+
```text
|
|
20
|
+
/plugin marketplace add instructa/planr
|
|
21
|
+
/plugin install planr@planr
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Skills are namespaced in Claude Code: `/planr:planr`, `/planr:planr-loop`. The plugin also registers the `planr-worker` and `planr-reviewer` subagents from the plugin's `agents/` directory.
|
|
25
|
+
|
|
26
|
+
Cursor: pending marketplace review; until listed, use MCP plus the CLI prompt (below).
|
|
27
|
+
|
|
28
|
+
opencode: no plugin yet; use `planr mcp` as an MCP server (below). A JS plugin wrapping the CLI as custom tools is a possible follow-up.
|
|
29
|
+
|
|
30
|
+
## Included Skills
|
|
31
|
+
|
|
32
|
+
Entry points (what users invoke):
|
|
33
|
+
|
|
34
|
+
- `planr`: master router. One entry point for any request; reads live map state and dispatches to the right skill. Users do not need to remember skill names.
|
|
35
|
+
- `planr-goal`: goal prep compiler for long-running runs. Turns a broad goal into a checked plan, a linked map, and a durable goal contract (`planr context --tag goal-contract`), then prints the starter command for the host's loop driver (Codex/Claude Code `/goal`, or manual re-dispatch). Prep only — see [Long-Running Goals](GOALS.md).
|
|
36
|
+
- `planr-loop`: autonomous closing loop. Drives one feature to verified completion — work, live verification, independent review, fix items — until the map is clean or the iteration budget runs out. Ships subagent templates under `plugins/planr/skills/planr-loop/agents/`.
|
|
37
|
+
|
|
38
|
+
Capability skills (dispatched by the loop's live-verification step):
|
|
39
|
+
|
|
40
|
+
- `planr-verify-web`: proves a web feature runs in a browser. Discovers the host's existing browser capability (browser skill, browser MCP, `npx playwright`, HTTP checks as last resort), records the choice as a `capability` context, and logs replayable evidence. Ships no browser tooling itself.
|
|
41
|
+
|
|
42
|
+
Stage skills (what the router and loop dispatch to; also directly invocable):
|
|
43
|
+
|
|
44
|
+
- `planr-task-graph`: active task graph coordination with plans, parent gates, map items, picks, runtime state, approvals, logs, reviews, handoffs, stories, and recovery.
|
|
45
|
+
- `planr-plan`: product and build planning.
|
|
46
|
+
- `planr-work`: one picked item to evidence-backed completion.
|
|
47
|
+
- `planr-review`: findings-first review gates.
|
|
48
|
+
- `planr-status`: honest read-only status.
|
|
49
|
+
- `planr-summary`: evidence-backed summaries.
|
|
50
|
+
|
|
51
|
+
## Cheat Sheet
|
|
52
|
+
|
|
53
|
+
Default usage needs two skills:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
$planr any request -> routed to the right stage skill from live map state
|
|
57
|
+
$planr-loop one feature -> loop work/verify/review/fix until done or budget exhausted
|
|
58
|
+
$planr-goal broad goal -> plan + map + durable contract + starter for /goal or manual loops
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
The stage order the router follows for a new app:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
$planr-plan idea -> product plan -> build plan
|
|
65
|
+
$planr-task-graph build plan -> map -> dependencies -> critical lane
|
|
66
|
+
$planr-work pick one ready item -> implement -> log evidence -> request review
|
|
67
|
+
$planr-review audit evidence -> complete or create fix work
|
|
68
|
+
$planr-work pick generated fix work when review finds issues
|
|
69
|
+
$planr-status report honest state, blockers, and next ready work
|
|
70
|
+
$planr-summary summarize completed scope with evidence
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Example first prompt for a Habit Tracker:
|
|
74
|
+
|
|
75
|
+
```text
|
|
76
|
+
Use $planr.
|
|
77
|
+
|
|
78
|
+
Create a production-ready Habit Tracker web app plan. Include habits, daily check-ins,
|
|
79
|
+
streaks, weekly overview, local-first persistence, tests, privacy, and release readiness.
|
|
80
|
+
Create the product plan, split an MVP build plan, check it, then build the Planr map.
|
|
81
|
+
Do not implement yet. End with the build plan id, critical lane, and first ready items.
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Example autonomous feature loop:
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
Use $planr-loop.
|
|
88
|
+
|
|
89
|
+
Goal: ship the weekly overview feature. DONE when every in-scope map item is closed with
|
|
90
|
+
log evidence, all reviews are closed complete, and a live verification log shows the
|
|
91
|
+
overview rendering real check-in data in the browser. Iteration budget: 10.
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Example single implementation step (human-in-the-loop):
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
Use $planr-work.
|
|
98
|
+
|
|
99
|
+
Pick exactly one ready Habit Tracker item. Implement only that item, keep Planr runtime
|
|
100
|
+
state current, log changed files and real verification commands, then request review.
|
|
101
|
+
Do not close the item until review is complete.
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Two Journeys: New Project vs. Existing Project
|
|
105
|
+
|
|
106
|
+
Both journeys use the same entry point (`$planr` or `$planr-loop`). What differs is the state the router finds, and what kind of plan the work gets.
|
|
107
|
+
|
|
108
|
+
### Journey 1 — start a project from an idea
|
|
109
|
+
|
|
110
|
+
Initialize once per repository, then hand the idea to the router:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
planr project init "Habit Tracker" --client all
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
```text
|
|
117
|
+
Use $planr.
|
|
118
|
+
|
|
119
|
+
Create a production-ready Habit Tracker web app plan. Create the product plan,
|
|
120
|
+
split an MVP build plan, check it, then build the Planr map. Do not implement yet.
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The router runs the full stage order: product plan -> build plan -> map -> work. From there, `$planr-loop` or `$planr-work` executes against the map.
|
|
124
|
+
|
|
125
|
+
### Journey 2 — mid-project: add a feature, refactor, or fix
|
|
126
|
+
|
|
127
|
+
Never re-run `project init`; the project and map already exist. Every new scope — a feature like an auth system, a refactor, a non-trivial fix — gets its own feature-scoped plan on the same map:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
Use $planr.
|
|
131
|
+
|
|
132
|
+
Add an auth system (email+password, sessions, protected routes) to this app.
|
|
133
|
+
Create a feature plan for it, record what existing code it builds on, split a
|
|
134
|
+
narrow build slice, check it, and extend the map with linked items. Do not implement yet.
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
What the router does with that, and why:
|
|
138
|
+
|
|
139
|
+
1. `$planr-plan` creates a new plan scoped to the feature (`planr plan new "Auth system" ...`), not a new project. Refine notes capture constraints from the existing codebase; the build plan's "existing leverage" field records what is reused instead of rebuilt.
|
|
140
|
+
2. `$planr-task-graph` extends the existing map: new items, plus `blocks` links to anything already on the map that must land first.
|
|
141
|
+
3. Execution is identical to journey 1: `$planr-loop` for autonomous, `$planr-work` / `$planr-review` for human-in-the-loop.
|
|
142
|
+
|
|
143
|
+
Or autonomous in one prompt:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
Use $planr-loop.
|
|
147
|
+
|
|
148
|
+
Goal: ship an auth system (email+password, sessions, protected routes).
|
|
149
|
+
DONE when every auth map item is closed with log evidence, all reviews are closed
|
|
150
|
+
complete, and a live verification log shows login and a protected route working
|
|
151
|
+
in the browser. Iteration budget: 10.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Rules that hold in both journeys:
|
|
155
|
+
|
|
156
|
+
- No map items without a checked build plan — even a small fix gets a minimal slice (`plan new` -> `plan split` with a tiny scope). This keeps closure evidence and reviews attached to a contract.
|
|
157
|
+
- Plans accumulate: `planr plan list` shows the project's history of scopes; the map stays the single live source of item status.
|
|
158
|
+
- Status, review, and summary requests (`$planr-status`, `$planr-review`, `$planr-summary`) work the same at any point in either journey.
|
|
159
|
+
|
|
160
|
+
## Loop Roles
|
|
161
|
+
|
|
162
|
+
`planr-loop` keeps maker and checker separate. Hosts with subagents get dedicated roles that are prompted with skills, not hand-written prompts.
|
|
163
|
+
|
|
164
|
+
The CLI provisions the role files automatically — no manual copying:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
planr project init "My Product" --client all # writes .codex/agents/*.toml and .claude/agents/*.md
|
|
168
|
+
planr install codex # provisions roles for an existing project
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Codex needs these project-scoped files because its plugin system carries skills only; the Claude Code plugin registers the same roles automatically, so the provisioned `.claude/agents/` copies only matter for standalone (non-plugin) installs. Existing role files are never overwritten.
|
|
172
|
+
|
|
173
|
+
Dispatches stay one line: `Use $planr-work on item <id>` and `Use $planr-review on item <id>`. The map and logs are the loop memory, so any iteration can resume from zero context.
|
|
174
|
+
|
|
175
|
+
## Install For Codex
|
|
176
|
+
|
|
177
|
+
Copy the Planr skills into Codex's local skill directory:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
mkdir -p ~/.codex/skills
|
|
181
|
+
cp -R plugins/planr/skills/* ~/.codex/skills/
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If Planr was installed from an npm package that includes `skills/`, copy from the package location instead:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
PLANR_PKG="$(npm root -g)/planr"
|
|
188
|
+
mkdir -p ~/.codex/skills
|
|
189
|
+
cp -R "$PLANR_PKG"/plugins/planr/skills/* ~/.codex/skills/
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Do not present `npx planr` as the primary install path until the npm artifact ships platform-native Planr binaries. Today the normal user path is the GitHub Release installer; npm is a development and consumer-test wrapper.
|
|
193
|
+
|
|
194
|
+
Then run Codex from a repository where `planr` is installed and initialized:
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
planr project init "Example Product" --client codex
|
|
198
|
+
planr doctor --client codex
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Codex can also use Planr through MCP:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
planr install codex --dry-run
|
|
205
|
+
planr prompt mcp --client codex
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Install For Claude Code
|
|
209
|
+
|
|
210
|
+
Claude Code loads project skills from `.claude/skills/`:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
mkdir -p .claude/skills .claude/agents
|
|
214
|
+
cp -R plugins/planr/skills/* .claude/skills/
|
|
215
|
+
cp plugins/planr/agents/*.md .claude/agents/
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
Then add MCP and the Planr workflow prompt to project instructions when needed:
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
planr project init "Example Product" --client claude
|
|
222
|
+
planr install claude --dry-run
|
|
223
|
+
planr prompt mcp --client claude
|
|
224
|
+
planr prompt cli --client claude
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
`planr install claude` writes a project-scoped `.mcp.json` when not run as a dry-run.
|
|
228
|
+
|
|
229
|
+
## Install For Cursor
|
|
230
|
+
|
|
231
|
+
Cursor should use Planr through MCP plus the CLI prompt:
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
planr project init "Example Product" --client cursor
|
|
235
|
+
planr install cursor --dry-run
|
|
236
|
+
planr prompt mcp --client cursor
|
|
237
|
+
planr prompt cli --client cursor
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
`planr install cursor` writes `.cursor/mcp.json` when not run as a dry-run. Use `planr serve --port 7526` and `planr prompt http --client cursor` if a Cursor workflow should inspect the local HTTP/review workspace.
|
|
241
|
+
|
|
242
|
+
## MCP-Only Clients
|
|
243
|
+
|
|
244
|
+
Any MCP-capable coding agent can run:
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
planr mcp
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Use these commands for setup text without editing global config:
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
planr prompt mcp --client all
|
|
254
|
+
planr prompt cli --client all
|
|
255
|
+
planr prompt http --client all
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## What The Skills Do
|
|
259
|
+
|
|
260
|
+
The skills are client-neutral and use only Planr-owned commands:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
planr project show --json
|
|
264
|
+
planr plan new "App idea"
|
|
265
|
+
planr map build --from <plan-id>
|
|
266
|
+
planr pick --json
|
|
267
|
+
planr done <item-id> --summary "..." --files a --files b --cmd "..." --review --next
|
|
268
|
+
planr review close <review-id> --verdict complete --close-target
|
|
269
|
+
planr approval list --open
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
The granular commands (`log add`, `review request`, `close`, `pick heartbeat`) remain available; `done` chains them with identical evidence.
|
|
273
|
+
|
|
274
|
+
See also:
|
|
275
|
+
|
|
276
|
+
- [Operating Model](OPERATING_MODEL.md)
|
|
277
|
+
- [Task Graph Model](TASK_GRAPH_MODEL.md)
|
|
278
|
+
- [Handoffs And Stories](HANDOFFS_AND_STORIES.md)
|