openplanr 1.4.3 → 1.5.0

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 (42) hide show
  1. package/README.md +256 -250
  2. package/dist/cli/commands/init.d.ts.map +1 -1
  3. package/dist/cli/commands/init.js +14 -1
  4. package/dist/cli/commands/init.js.map +1 -1
  5. package/dist/cli/commands/rules.d.ts.map +1 -1
  6. package/dist/cli/commands/rules.js +10 -1
  7. package/dist/cli/commands/rules.js.map +1 -1
  8. package/dist/generators/base-generator.d.ts +15 -1
  9. package/dist/generators/base-generator.d.ts.map +1 -1
  10. package/dist/generators/base-generator.js +21 -0
  11. package/dist/generators/base-generator.js.map +1 -1
  12. package/dist/generators/claude-generator.d.ts.map +1 -1
  13. package/dist/generators/claude-generator.js +25 -8
  14. package/dist/generators/claude-generator.js.map +1 -1
  15. package/dist/generators/codex-generator.d.ts.map +1 -1
  16. package/dist/generators/codex-generator.js +17 -2
  17. package/dist/generators/codex-generator.js.map +1 -1
  18. package/dist/generators/cursor-generator.d.ts +4 -0
  19. package/dist/generators/cursor-generator.d.ts.map +1 -1
  20. package/dist/generators/cursor-generator.js +67 -8
  21. package/dist/generators/cursor-generator.js.map +1 -1
  22. package/dist/models/types.d.ts +11 -0
  23. package/dist/models/types.d.ts.map +1 -1
  24. package/dist/templates/rules/claude/CLAUDE.md.hbs +14 -0
  25. package/dist/templates/rules/claude/openplanr-pipeline.md.hbs +68 -0
  26. package/dist/templates/rules/codex/_pipeline-section.md.hbs +150 -0
  27. package/dist/templates/rules/cursor/agents/backend-agent.md +299 -0
  28. package/dist/templates/rules/cursor/agents/db-agent.md +163 -0
  29. package/dist/templates/rules/cursor/agents/designer-agent.md +219 -0
  30. package/dist/templates/rules/cursor/agents/devops-agent.md +197 -0
  31. package/dist/templates/rules/cursor/agents/doc-gen-agent.md +203 -0
  32. package/dist/templates/rules/cursor/agents/frontend-agent.md +220 -0
  33. package/dist/templates/rules/cursor/agents/qa-agent.md +170 -0
  34. package/dist/templates/rules/cursor/agents/specification-agent.md +282 -0
  35. package/dist/templates/rules/cursor/openplanr-pipeline-plan.mdc.hbs +194 -0
  36. package/dist/templates/rules/cursor/openplanr-pipeline-ship.mdc.hbs +242 -0
  37. package/dist/templates/rules/cursor/openplanr-pipeline.mdc.hbs +134 -0
  38. package/dist/utils/constants.d.ts +21 -0
  39. package/dist/utils/constants.d.ts.map +1 -1
  40. package/dist/utils/constants.js +21 -0
  41. package/dist/utils/constants.js.map +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -1,287 +1,292 @@
1
- # OpenPlanr
1
+ <div align="center">
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/openplanr.svg)](https://www.npmjs.com/package/openplanr)
4
- [![license](https://img.shields.io/npm/l/openplanr.svg)](https://github.com/openplanr/OpenPlanr/blob/main/LICENSE)
5
- [![node](https://img.shields.io/node/v/openplanr.svg)](https://nodejs.org)
3
+ # OpenPlanr
6
4
 
7
- **Website:** [openplanr.dev](https://openplanr.dev)
5
+ ### The planning layer for AI coding agents
8
6
 
9
- **AI-powered planning CLI for developers.** Capture ideas, plan sprints, generate tasks, estimate effort, and sync with GitHub or Linear all from your terminal.
7
+ **Plan once. Ship with agents.** Works natively on **Claude Code**, **Cursor**, and **Codex** via the runtime-agnostic [OpenPlanr Protocol v1.0.0](https://github.com/openplanr/openplanr-pipeline/tree/main/docs/protocol).
10
8
 
11
- Planr replaces heavyweight project management tools with a fast, file-based workflow. Artifacts live in your repo as markdown, version-controlled alongside your code. AI generates structured plans and teaches your coding agent (Cursor, Claude Code, Codex) how to follow them.
9
+ [![npm version](https://img.shields.io/npm/v/openplanr.svg?style=flat-square&color=cb3837&logo=npm)](https://www.npmjs.com/package/openplanr)
10
+ [![node](https://img.shields.io/node/v/openplanr.svg?style=flat-square&color=339933&logo=node.js&logoColor=white)](https://nodejs.org)
11
+ [![license](https://img.shields.io/npm/l/openplanr.svg?style=flat-square&color=blue)](https://github.com/openplanr/OpenPlanr/blob/main/LICENSE)
12
+ [![protocol](https://img.shields.io/badge/protocol-v1.0.0-7c3aed?style=flat-square)](https://github.com/openplanr/openplanr-pipeline/tree/main/docs/protocol)
13
+ [![runtimes](https://img.shields.io/badge/runtimes-Claude%20Code%20%7C%20Cursor%20%7C%20Codex-f97316?style=flat-square)](https://github.com/openplanr/openplanr-pipeline/blob/main/docs/compatibility-matrix.md)
12
14
 
13
- ---
15
+ **[Website](https://openplanr.dev)** · **[Pipeline plugin](https://github.com/openplanr/openplanr-pipeline)** · **[Compatibility matrix](https://github.com/openplanr/openplanr-pipeline/blob/main/docs/compatibility-matrix.md)** · **[Protocol spec](https://github.com/openplanr/openplanr-pipeline/tree/main/docs/protocol)** · **[CLI reference](docs/CLI.md)**
14
16
 
15
- ## Why Planr?
17
+ </div>
16
18
 
17
- AI coding assistants are powerful but lack structured planning. Without a clear plan, they generate code that drifts from requirements. Planr solves this by:
18
-
19
- 1. **Capturing ideas instantly** — `planr backlog add` captures work items without breaking your flow
20
- 2. **Structuring your planning** — epics, features, stories, and tasks in markdown
21
- 3. **Sprint planning** — time-boxed iterations with velocity tracking and AI task selection
22
- 4. **Reusable patterns** — task templates for common workflows (REST endpoints, React components, etc.)
23
- 5. **AI-powered estimation** — story points, effort hours, and complexity analysis
24
- 6. **Generating AI rules** — rule files that give your AI assistant context about the plan
25
- 7. **GitHub integration** — push artifacts to issues, bi-directional sync, export reports
26
- 8. **Linear integration** — push any artifact (epic / feature / story / task / quick-task / backlog) to Linear with `planr linear push <id>`, with flexible epic mappings (project / milestone / label) and bidirectional status + checkbox sync
27
- 9. **Keeping everything in your repo** — artifacts live alongside your code, version-controlled
19
+ ---
28
20
 
29
- ## Quick Start
21
+ `planr` is a Node CLI that authors structured plans (epics, features, stories, tasks, or full specs) as markdown in your repo, then generates runtime-native rule files so your AI coding agent picks up the plan automatically. One command to install, one command to initialise — your runtime activates the workflow without further setup.
30
22
 
31
23
  ```bash
32
- # Install globally
33
24
  npm install -g openplanr
34
-
35
- # Initialize in your project
36
25
  cd my-project
37
26
  planr init
27
+ # ✓ Created .planr/config.json
28
+ # ✓ Generated 17 AI agent rule file(s) (scope: all)
29
+ # ✓ Open Cursor / Codex / Claude Code — pipeline workflow is live
30
+ ```
38
31
 
39
- # Capture an idea
40
- planr backlog add "add user profiles" --priority high --tag feature
32
+ That's the whole onboarding.
41
33
 
42
- # Or jump straight into planning
43
- planr epic create
44
- planr feature create --epic EPIC-001
45
- planr story create --feature FEAT-001
46
- planr task create --feature FEAT-001
34
+ ---
47
35
 
48
- # Generate tasks from a template
49
- planr template use rest-endpoint --title "User Profile API"
36
+ ## Why OpenPlanr?
50
37
 
51
- # Start a sprint
52
- planr sprint create --name "Sprint 1" --duration 2w
53
- planr sprint add TASK-001 QT-001
38
+ AI coding agents are powerful but lack structured planning context. Without a clear plan, they generate code that drifts from requirements, churn on the same problem across sessions, and can't be audited. OpenPlanr fixes this with four properties:
54
39
 
55
- # Generate AI rules for your editor
56
- planr rules generate
57
- ```
40
+ 1. **Markdown artifacts in your repo** — plans live next to your code, version-controlled, gittable, gradable. No external SaaS, no DB.
41
+ 2. **One contract, every runtime** — author once; Claude Code, Cursor, and Codex all consume the same artifacts via [OpenPlanr Protocol v1.0.0](https://github.com/openplanr/openplanr-pipeline/tree/main/docs/protocol).
42
+ 3. **Three planning postures** — pick the ceremony level that matches the work: agile (epic → feature → story → task), quick task (one-off chores), or spec-driven (handoff to an AI factory).
43
+ 4. **Hard rules at the tool layer** — when paired with the [openplanr-pipeline](https://github.com/openplanr/openplanr-pipeline) Claude Code plugin, agent tool restrictions are enforced in the manifest, not just the prompt. Production-grade audit trail via the `.pipeline-shipped` execution marker.
58
44
 
59
- ## How It Works
45
+ ---
60
46
 
61
- ```text
62
- Backlog → Agile Hierarchy → Sprint → Implementation
47
+ ## Three planning postures
63
48
 
64
- planr backlog add "..." # Capture ideas as they come
65
- planr backlog prioritize # AI sorts by impact/effort
66
- planr backlog promote BL-001 --quick # Move to task when ready
49
+ | Posture | Best for | Output |
50
+ |---|---|---|
51
+ | **Agile** | Real teams, sprints, multi-stakeholder work | `.planr/{epics,features,stories,tasks,sprints}/*.md` + Gherkin |
52
+ | **Quick task** | Solo dev, one-off chores, no ceremony | `.planr/quick/QT-NNN-*.md` (a single checklist file) |
53
+ | **Spec-driven** | Handing a feature to an AI agent factory | `.planr/specs/SPEC-NNN-{slug}/{stories,tasks,design}/` |
67
54
 
68
- planr init
69
- └── planr epic create # Define the big picture
70
- └── planr feature create --epic EPIC-001
71
- └── planr story create --feature FEAT-001
72
- └── planr task create --feature FEAT-001
55
+ Pick one per project, mix per task. The spec-driven posture is the bridge to the [openplanr-pipeline](https://github.com/openplanr/openplanr-pipeline) — same artifact contract, no conversion adapter.
73
56
 
74
- planr sprint create --name "Sprint 1" --duration 2w
75
- planr sprint add TASK-001 QT-001 # Assign tasks (or --auto for AI)
76
- planr sprint status # Track progress
57
+ ---
77
58
 
78
- planr rules generate # Generate .cursor/rules, CLAUDE.md, AGENTS.md
79
- ```
59
+ ## Cross-runtime support
80
60
 
81
- Or use `planr plan` to run the full agile flow in a single command:
61
+ `planr init` auto-generates rule files for all three runtimes by default. Each tool is **self-sufficient after a single install**:
82
62
 
83
- ```bash
84
- planr plan # start from scratch
85
- planr plan --epic EPIC-001 # cascade from an existing epic
86
- ```
63
+ | Runtime | What gets installed | How the workflow activates |
64
+ |---|---|---|
65
+ | **Claude Code** | `CLAUDE.md` + sibling `openplanr-pipeline.md` reference card. Optional: install the `openplanr-pipeline` plugin for full manifest-enforced subagents. | `/openplanr-pipeline:plan {feature}` and `/openplanr-pipeline:ship {feature}` slash commands |
66
+ | **Cursor** | `.cursor/rules/openplanr-pipeline.mdc` + `agents/{8 role bodies}.md` | User says "plan {feature}" or "ship {feature}" — Composer dispatches the pipeline subagents |
67
+ | **Codex** | `AGENTS.md` with `## OpenPlanr Pipeline Orchestration` section | User says "plan {feature}" — Codex adopts the role personas |
68
+
69
+ Same artifacts (`.planr/specs/SPEC-NNN-{slug}/`). Same `.pipeline-shipped` proof markers. Cross-runtime spec portability works out of the box. See the [compatibility matrix](https://github.com/openplanr/openplanr-pipeline/blob/main/docs/compatibility-matrix.md) for per-capability parity.
87
70
 
88
- ## Supported AI Targets
71
+ ---
89
72
 
90
- | Target | Generated File(s) | Used By |
91
- | ------ | --------------------- | ---------------- |
92
- | Cursor | `.cursor/rules/*.mdc` | Cursor IDE |
93
- | Claude | `CLAUDE.md` | Claude Code CLI |
94
- | Codex | `AGENTS.md` | OpenAI Codex CLI |
73
+ ## Quick start
74
+
75
+ ### Install
95
76
 
96
77
  ```bash
97
- planr rules generate # all targets
98
- planr rules generate --target cursor # cursor only
99
- planr rules generate --dry-run # preview
78
+ npm install -g openplanr
100
79
  ```
101
80
 
102
- ## Commands
81
+ ### Initialise a project
103
82
 
104
- ### Backlog & Sprint
83
+ ```bash
84
+ cd my-project
85
+ planr init
86
+ # Interactive: pick AI provider, pick coding agent, generate rules → done
87
+ ```
105
88
 
106
- | Command | Description |
107
- | ----------------------------------------------------- | ------------------------------------------- |
108
- | `planr backlog add "desc" --priority high --tag bug` | Capture a backlog item |
109
- | `planr backlog list --tag bug --priority high` | List/filter backlog items |
110
- | `planr backlog prioritize` | AI sorts open items by impact and effort |
111
- | `planr backlog promote BL-001 --quick` | Promote to quick task or story |
112
- | `planr backlog close BL-001` | Close/archive an item |
113
- | `planr sprint create --name "Sprint 1" --duration 2w` | Create a time-boxed sprint |
114
- | `planr sprint add TASK-001 QT-001` | Assign tasks to active sprint |
115
- | `planr sprint add --auto` | AI selects tasks by priority and velocity |
116
- | `planr sprint status` | Progress dashboard with completion % |
117
- | `planr sprint close` | Archive sprint, carry over incomplete tasks |
118
- | `planr sprint list` | List all sprints |
119
- | `planr sprint history` | Velocity chart across past sprints |
120
-
121
- ### Agile Hierarchy
122
-
123
- | Command | Description |
124
- | ----------------------------------- | ----------------------------------------------------- |
125
- | `planr epic create` | Create a new epic (supports `--file <path>` for PRDs) |
126
- | `planr epic list` | List all epics |
127
- | `planr feature create --epic <ID>` | Create features from an epic |
128
- | `planr feature list` | List all features |
129
- | `planr story create --feature <ID>` | Create user stories from a feature |
130
- | `planr story create --epic <ID>` | Batch-generate stories for all features under an epic |
131
- | `planr story list` | List all user stories |
132
- | `planr task create --story <ID>` | AI task list from one story |
133
- | `planr task create --feature <ID>` | AI task list from all stories under a feature |
134
- | `planr task list` | List all task lists |
135
- ### Quick Tasks & Templates
136
-
137
- | Command | Description |
138
- | ----------------------------------------------------- | ---------------------------------- |
139
- | `planr quick create "description"` | AI-generated standalone task list |
140
- | `planr quick create --file spec.md` | Task list from a PRD or spec file |
141
- | `planr quick promote <ID> --story US-001` | Move into agile hierarchy |
142
- | `planr template list` | List built-in and custom templates |
143
- | `planr template use rest-endpoint --title "User API"` | Generate tasks from a template |
144
- | `planr template save TASK-001 --name my-pattern` | Save existing tasks as template |
145
- | `planr template show rest-endpoint` | Preview template contents |
146
-
147
- ### Spec-Driven Mode (planning *for* AI agents)
148
-
149
- Third planning posture alongside agile + QT. Specs decompose into User Stories
150
- and Tasks with the **same artifact contract as the
151
- [openplanr-pipeline](https://github.com/openplanr/openplanr-pipeline)** Claude
152
- Code plugin — file Create/Modify/Preserve lists, Type=UI|Tech, agent
153
- assignment, DoD with build/test commands. Plan in `planr`, ship in the pipeline.
154
- See [`docs/proposals/spec-driven-mode.md`](docs/proposals/spec-driven-mode.md).
155
-
156
- | Command | Description |
157
- | ------------------------------------------------------- | ------------------------------------------------- |
158
- | `planr spec init` | Activate spec-driven mode (creates `.planr/specs/`) |
159
- | `planr spec create "Auth flow"` | Create a self-contained `SPEC-NNN-{slug}/` directory |
160
- | `planr spec shape <SPEC-id>` | Interactive 4-question authoring (Context, Functional Reqs, Business Rules, Acceptance) |
161
- | `planr spec decompose <SPEC-id>` | AI-driven decomposition into User Stories + Tasks (matches openplanr-pipeline schema) |
162
- | `planr spec sync [<SPEC-id>]` | Validate integrity (orphaned tasks, missing `specId`, schema drift); auto-fixes safe issues |
163
- | `planr spec list` | List all specs with status + decomposition counts |
164
- | `planr spec show <SPEC-id>` | Print a spec + its US/Task tree |
165
- | `planr spec status [<SPEC-id>]` | Decomposition state across one/all specs |
166
- | `planr spec destroy <SPEC-id>` | Remove a spec entirely (clean `rm -rf`) |
167
- | `planr spec attach-design <SPEC-id> --files <png>...` | Attach UI mockups for the pipeline's designer-agent |
168
- | `planr spec promote <SPEC-id>` | Validate + print the `/openplanr-pipeline:plan {slug}` handoff |
169
-
170
- ### Planning Tools
171
-
172
- | Command | Description |
173
- | ---------------------- | --------------------------------------------------------- |
174
- | `planr plan` | Full automated flow: Epic -> Features -> Stories -> Tasks |
175
- | `planr estimate <ID>` | AI effort estimation (story points, hours, complexity) |
176
- | `planr refine <ID>` | AI-powered review and improvements (prose polish) |
177
- | `planr revise <ID>` | AI-driven *alignment* of planning artifacts with codebase |
178
- | `planr search <query>` | Full-text search across all artifacts |
179
- | `planr sync` | Validate and fix cross-references |
180
- | `planr status` | Planning progress with tree view and metrics |
181
-
182
- #### `planr revise` — align planning with reality
183
-
184
- `refine` improves prose; `revise` actively rewrites planning artifacts so they match the codebase, sibling artifacts, and declared sources. Four-layer safety pipeline:
185
-
186
- 1. **Clean-tree gate** — git working tree must be clean (override with `--allow-dirty`)
187
- 2. **Agent decision** — zod-validated `revise` / `skip` / `flag` per artifact
188
- 3. **Evidence verification** — agent must cite typed, verifiable evidence (file existence, grep matches, sibling artifacts…); unverifiable citations are dropped, and a `revise` that loses all support is demoted to `flag`
189
- 4. **Diff preview + confirmation** — per-artifact `[a]pply / [s]kip / [e]dit / [d]iff / [q]uit`; writes are atomic with sidecar backups; full audit log emitted on every run (dry-run included)
89
+ Non-interactive variants:
190
90
 
191
91
  ```bash
192
- # Single artifact, interactive
193
- planr revise TASK-007
92
+ planr init --yes # accept all defaults (AI on, all rules)
93
+ planr init --no-ai --yes # skip AI provider setup
94
+ planr init --no-pipeline-rules --yes # agile rules only (skip pipeline workflow)
95
+ ```
194
96
 
195
- # Cascade top-down (epic features → stories → tasks)
196
- planr revise EPIC-003 --cascade
97
+ ### Pick a posture and start
197
98
 
198
- # Revise everything in the project (content-hash cache skips unchanged artifacts)
199
- planr revise --all --dry-run # preview every revision
200
- planr revise --all --yes # type YES once; then non-interactive apply
99
+ **Agile:**
201
100
 
202
- # CI mode — dry-run + JSON audit + non-zero exit on flagged findings
203
- planr revise EPIC-003 --cascade --dry-run --audit-format json --audit ./revise.json
101
+ ```bash
102
+ planr epic create
103
+ planr feature create --epic EPIC-001
104
+ planr story create --feature FEAT-001
105
+ planr task create --feature FEAT-001
106
+ # Or one-shot:
107
+ planr plan --epic EPIC-001
204
108
  ```
205
109
 
206
- After a successful apply, revise prints a suggested commit:
110
+ **Quick task:**
207
111
 
208
- ```
209
- git commit -am "chore(plan): revise EPIC-003 against codebase"
112
+ ```bash
113
+ planr quick create "add OAuth login"
210
114
  ```
211
115
 
212
- Post-flight graph-integrity check runs after every non-dry-run revise. If the writes leave parent/child links broken, revise automatically rolls back via `git checkout` (which is why clean-tree is required by default). Full design in [.planr/EPIC-REVISE-COMMAND.md](.planr/EPIC-REVISE-COMMAND.md).
116
+ **Spec-driven (with the pipeline plugin):**
213
117
 
214
- ### GitHub, Linear & export
118
+ ```bash
119
+ planr spec create "Auth flow" --slug auth
120
+ planr spec shape SPEC-001 # 4 questions, no $EDITOR
121
+ # Then in Claude Code / Cursor / Codex:
122
+ # /openplanr-pipeline:plan auth → human review → /openplanr-pipeline:ship auth
123
+ ```
215
124
 
216
- | Command | Description |
217
- | ---------------------------- | ------------------------------------------------ |
218
- | `planr linear init` | Save Linear team + token (PAT) for API access |
219
- | `planr linear sync` | Pull Linear workflow state into Feature/Story `status` (one-way) |
220
- | `planr linear push <epicId>` | Epic → Linear project, features → issues, stories and task lists → sub-issues |
221
- | `planr github push [ID]` | Push artifacts to GitHub Issues |
222
- | `planr github sync` | Bi-directional status sync with GitHub |
223
- | `planr github status` | Show sync status of linked artifacts |
224
- | `planr export --format html` | Export planning report (markdown, JSON, or HTML) |
125
+ ---
225
126
 
226
- ### Stakeholder reporting
127
+ ## Commands
227
128
 
228
- Generate evidence-linked status reports from your `.planr/` artifacts and (optionally) GitHub activity. See [docs/EPIC-PM-REPORTING-LAYER.md](docs/EPIC-PM-REPORTING-LAYER.md) for the full design and what is shipped vs deferred.
129
+ ### Spec-driven mode
130
+
131
+ Third planning posture — designed for handing features to AI coding agents. Specs decompose into User Stories and Tasks with explicit file Create / Modify / Preserve lists, `Type: UI | Tech`, agent assignment, and DoD with build / test commands. Schema matches [OpenPlanr Protocol v1.0.0](https://github.com/openplanr/openplanr-pipeline/tree/main/docs/protocol).
132
+
133
+ | Command | Description |
134
+ |---|---|
135
+ | `planr spec init` | Activate spec-driven mode (creates `.planr/specs/`) |
136
+ | `planr spec create "Auth flow"` | Create a self-contained `SPEC-NNN-{slug}/` directory |
137
+ | `planr spec shape <id>` | Interactive 4-question authoring (Context, Functional Reqs, Business Rules, Acceptance) |
138
+ | `planr spec decompose <id>` | AI-driven decomposition into US + Tasks |
139
+ | `planr spec sync [<id>]` | Validate integrity (orphans, missing `specId`, schema drift); auto-fixes safe issues |
140
+ | `planr spec list` | List all specs with status + decomposition counts |
141
+ | `planr spec show <id>` | Print a spec + its US/Task tree |
142
+ | `planr spec status [<id>]` | Decomposition state across one/all specs |
143
+ | `planr spec destroy <id>` | Remove a spec entirely |
144
+ | `planr spec attach-design <id> --files <png>...` | Attach UI mockups for the designer-agent |
145
+ | `planr spec promote <id>` | Validate + print the pipeline handoff command |
146
+
147
+ ### Agile hierarchy
148
+
149
+ | Command | Description |
150
+ |---|---|
151
+ | `planr epic create` | Create a new epic (supports `--file <path>` for PRDs) |
152
+ | `planr feature create --epic <ID>` | Create features from an epic |
153
+ | `planr story create --feature <ID>` | Create user stories from a feature |
154
+ | `planr story create --epic <ID>` | Batch-generate stories for all features under an epic |
155
+ | `planr task create --story <ID>` | AI task list from one story |
156
+ | `planr task create --feature <ID>` | AI task list from all stories under a feature |
157
+ | `planr plan` | Full automated flow: Epic → Features → Stories → Tasks |
158
+ | `planr epic list` / `planr feature list` / `planr story list` / `planr task list` | List artifacts |
159
+
160
+ ### Quick tasks & templates
161
+
162
+ | Command | Description |
163
+ |---|---|
164
+ | `planr quick create "description"` | AI-generated standalone task list |
165
+ | `planr quick create --file spec.md` | Task list from a PRD or spec file |
166
+ | `planr quick promote <ID> --story US-001` | Move into agile hierarchy |
167
+ | `planr template list` | List built-in and custom templates |
168
+ | `planr template use rest-endpoint --title "User API"` | Generate tasks from a template |
169
+ | `planr template save TASK-001 --name my-pattern` | Save existing tasks as template |
170
+
171
+ Built-in templates: `rest-endpoint`, `react-component`, `database-migration`, `api-integration`, `auth-flow`.
229
172
 
230
- | Command | Description |
231
- | -------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
232
- | `planr report <type>` | Generate a report (`sprint`, `weekly`, `executive`, `standup`, `retro`, `release`) |
233
- | `planr report weekly --lint` | Generate and run the report quality linter before saving |
234
- | `planr report sprint --push slack --dry-run` | Show what would be posted to Slack (no webhook required for dry runs) |
235
- | `planr report-linter [file]` | Lint an existing markdown report (vague language, evidence density, required sections) |
236
- | `planr context --report-type weekly` | Print the report context pack (artifacts + GitHub + evidence) as JSON for piping |
237
- | `planr voice standup --file transcript.txt --lint` | Convert a transcript into a structured standup, optionally linted, edited, or appended to a story |
238
- | `planr story standup --story US-001 --file t.txt` | Append linted standup notes from a transcript onto an existing user story |
173
+ ### Backlog & Sprint
239
174
 
240
- **Output:** Markdown + HTML, written to `.planr/reports/<type>-<timestamp>.{md,html}` (override with `--output`). PDF rendering is intentionally out of scope for v1; `--format pdf` exits with a clear message.
175
+ | Command | Description |
176
+ |---|---|
177
+ | `planr backlog add "desc" --priority high --tag bug` | Capture a backlog item |
178
+ | `planr backlog list` / `prioritize` / `promote <id>` / `close <id>` | Manage backlog |
179
+ | `planr sprint create --name "Sprint 1" --duration 2w` | Create a time-boxed sprint |
180
+ | `planr sprint add TASK-001 QT-001` | Assign tasks (or `--auto` for AI) |
181
+ | `planr sprint status` / `list` / `close` / `history` | Track sprint progress + velocity |
182
+
183
+ ### Planning tools
184
+
185
+ | Command | Description |
186
+ |---|---|
187
+ | `planr estimate <ID>` | AI effort estimation (story points, hours, complexity) |
188
+ | `planr refine <ID>` | AI-powered review and prose polish |
189
+ | `planr revise <ID>` | AI-driven *alignment* of planning artifacts with codebase (with diff preview) |
190
+ | `planr search <query>` | Full-text search across all artifacts |
191
+ | `planr sync` | Validate and fix cross-references |
192
+ | `planr status` | Tree view of all planning progress |
193
+
194
+ ### AI agent rules
195
+
196
+ | Command | Description |
197
+ |---|---|
198
+ | `planr rules generate` | Generate rule files for all configured runtimes (default scope: agile) |
199
+ | `planr rules generate --target cursor --scope pipeline` | Cursor + pipeline workflow rules |
200
+ | `planr rules generate --target all --scope all` | Everything for every runtime |
201
+ | `planr rules generate --dry-run` | Preview without writing |
202
+
203
+ `--scope agile` (default) writes the agile workflow rules. `--scope pipeline` writes the rule files that drive the [openplanr-pipeline](https://github.com/openplanr/openplanr-pipeline) two-phase spec-driven flow on the chosen runtime. `--scope all` produces both. `planr init` auto-runs `--scope all` by default — opt out with `planr init --no-pipeline-rules`.
204
+
205
+ ### Integrations
206
+
207
+ | Command | Description |
208
+ |---|---|
209
+ | `planr github push [ID]` | Push artifacts to GitHub Issues |
210
+ | `planr github sync` | Bi-directional status sync with GitHub |
211
+ | `planr github status` | Show sync status of linked artifacts |
212
+ | `planr linear init` | Configure Linear (team + token) |
213
+ | `planr linear push <id>` | Epic → Linear project; features / stories / tasks → issues |
214
+ | `planr linear sync` | Pull Linear workflow state into artifact `status` |
215
+ | `planr export --format html` | Export planning report (markdown / JSON / HTML) |
216
+
217
+ ### Stakeholder reports
218
+
219
+ | Command | Description |
220
+ |---|---|
221
+ | `planr report <type>` | Generate a report (`sprint`, `weekly`, `executive`, `standup`, `retro`, `release`) |
222
+ | `planr report-linter [file]` | Lint a markdown report (vague language, evidence density) |
223
+ | `planr context --report-type weekly` | Print the report context pack as JSON |
224
+ | `planr voice standup --file transcript.txt` | Convert a transcript into a structured standup |
225
+
226
+ Output: Markdown + HTML written to `.planr/reports/`. `--push slack` posts via webhook; `--push github` opens an issue. `--strict-evidence` fails on bullets without URLs / `#issue` refs.
227
+
228
+ ### Setup & config
229
+
230
+ | Command | Description |
231
+ |---|---|
232
+ | `planr init` | Initialise project (creates `.planr/`, generates rules for all runtimes by default) |
233
+ | `planr config show` | Display current configuration + spec-driven readiness |
234
+ | `planr config set-provider` / `set-key` / `set-model` / `set-agent` | Manage AI provider settings |
235
+ | `planr checklist show/toggle/reset` | Agile development checklist |
236
+
237
+ See [docs/CLI.md](docs/CLI.md) for the full reference with every flag.
241
238
 
242
- **Distribution:** `--push slack` posts via an [Incoming Webhook](https://api.slack.com/messaging/webhooks) configured at `distribution.slackWebhookUrl` in `.planr/config.json`. `--push github` opens a `planr:report` issue using the local `gh` CLI.
239
+ ---
243
240
 
244
- **Quality gates:** `--strict-evidence` fails when substantive bullets under `##` sections (except the **Evidence** appendix) are missing URLs or `#issue` refs; full-line italic placeholders like `_Add links…_` are skipped. `--lint` runs configurable rules (extend or override via `reportLinter` in `.planr/config.json`).
241
+ ## Project structure
245
242
 
246
- ### Setup & config commands
243
+ After `planr init` and creating artifacts:
247
244
 
248
- | Command | Description |
249
- | ----------------------------------- | ------------------------------------------------------ |
250
- | `planr init` | Initialize project with config and directory structure |
251
- | `planr config show` | Display current configuration |
252
- | `planr config set-provider` | Set AI provider (anthropic, openai, ollama) |
253
- | `planr config set-key` | Store API key securely |
254
- | `planr config set-model` | Set AI model |
255
- | `planr config set-agent` | Set default coding agent |
256
- | `planr rules generate` | Generate AI agent rule files |
257
- | `planr checklist show/toggle/reset` | Agile development checklist |
245
+ ```text
246
+ my-project/
247
+ ├── .planr/
248
+ │ ├── config.json # Project configuration
249
+ │ ├── epics/ # EPIC-001-*.md
250
+ │ ├── features/ # FEAT-001-*.md
251
+ │ ├── stories/ # US-001-*.md + US-001-gherkin.feature
252
+ │ ├── tasks/ # TASK-001-*.md
253
+ │ ├── quick/ # QT-001-*.md
254
+ │ ├── specs/ # SPEC-NNN-{slug}/ (spec-driven mode)
255
+ │ ├── backlog/ # BL-001-*.md
256
+ │ ├── sprints/ # SPRINT-001-*.md
257
+ │ ├── adrs/ # Architecture Decision Records
258
+ │ ├── reports/ # Stakeholder reports
259
+ │ └── checklists/ # Agile development checklist
260
+ ├── .cursor/rules/
261
+ │ ├── agile-checklist.mdc # Agile workflow rules
262
+ │ ├── openplanr-pipeline.mdc # Pipeline rules (default-on)
263
+ │ └── agents/ # 8 subagent body files
264
+ ├── CLAUDE.md # Claude Code rules
265
+ ├── openplanr-pipeline.md # Pipeline reference card (Claude Code)
266
+ └── AGENTS.md # Codex rules + pipeline orchestration
267
+ ```
258
268
 
259
- See [docs/CLI.md](docs/CLI.md) for the full command reference with all options and flags.
269
+ ---
260
270
 
261
- ## Project Structure
271
+ ## Architecture decision: `planr revise`
262
272
 
263
- After running `planr init` and creating artifacts:
273
+ Most planning tools let plans drift from the codebase. `planr revise` actively rewrites planning artifacts so they match reality, with a four-layer safety pipeline:
264
274
 
265
- ```text
266
- my-project/
267
- ├── .planr/
268
- │ ├── config.json # Project configuration
269
- │ ├── epics/ # EPIC-001-*.md
270
- │ ├── features/ # FEAT-001-*.md
271
- │ ├── stories/ # US-001-*.md + US-001-gherkin.feature
272
- │ ├── tasks/ # TASK-001-*.md
273
- ├── quick/ # QT-001-*.md
274
- │ ├── backlog/ # BL-001-*.md
275
- │ ├── sprints/ # SPRINT-001-*.md
276
- │ ├── templates/ # Custom task templates
277
- │ ├── adrs/ # Architecture Decision Records
278
- │ ├── checklists/ # Agile development checklist
279
- │ └── diagrams/ # UML, C4, sequence diagrams
280
- ├── .cursor/rules/ # Generated Cursor rules
281
- ├── CLAUDE.md # Generated Claude Code rules
282
- └── AGENTS.md # Generated Codex rules
275
+ 1. **Clean-tree gate** — git working tree must be clean (`--allow-dirty` to override)
276
+ 2. **Agent decision** — zod-validated `revise` / `skip` / `flag` per artifact
277
+ 3. **Evidence verification** — agent must cite typed, verifiable evidence (file existence, grep matches, sibling artifacts); unverifiable citations are dropped
278
+ 4. **Diff preview + confirmation** — per-artifact `[a]pply / [s]kip / [e]dit / [d]iff / [q]uit`; writes are atomic with sidecar backups
279
+
280
+ ```bash
281
+ planr revise EPIC-003 --cascade # interactive
282
+ planr revise --all --dry-run # preview every revision
283
+ planr revise EPIC-003 --cascade --dry-run --audit ./revise.json # CI mode
283
284
  ```
284
285
 
286
+ Full design: [.planr/EPIC-REVISE-COMMAND.md](.planr/EPIC-REVISE-COMMAND.md).
287
+
288
+ ---
289
+
285
290
  ## Configuration
286
291
 
287
292
  `.planr/config.json` is created by `planr init`:
@@ -297,62 +302,63 @@ my-project/
297
302
  "codexConfig": "."
298
303
  },
299
304
  "idPrefix": {
300
- "epic": "EPIC",
301
- "feature": "FEAT",
302
- "story": "US",
303
- "task": "TASK",
304
- "quick": "QT",
305
- "backlog": "BL",
306
- "sprint": "SPRINT"
305
+ "epic": "EPIC", "feature": "FEAT", "story": "US",
306
+ "task": "TASK", "quick": "QT", "backlog": "BL",
307
+ "sprint": "SPRINT", "spec": "SPEC"
307
308
  }
308
309
  }
309
310
  ```
310
311
 
311
- ## Built-in Task Templates
312
+ ---
312
313
 
313
- | Template | Description |
314
- | -------------------- | ------------------------------------------------------- |
315
- | `rest-endpoint` | CRUD endpoint with validation, auth, tests, docs |
316
- | `react-component` | Component, stories, tests, types |
317
- | `database-migration` | Schema change, migration, rollback, seed data |
318
- | `api-integration` | External API client, retry logic, error handling, tests |
319
- | `auth-flow` | Authentication flow with login, signup, password reset |
314
+ ## Ecosystem
320
315
 
321
- ```bash
322
- planr template use rest-endpoint --title "User Profile API"
323
- ```
316
+ OpenPlanr is one of four components:
317
+
318
+ | Component | Role | Repo |
319
+ |---|---|---|
320
+ | **`planr` CLI** | Authoring surface — generates `.planr/` artifacts and runtime rule files | this repo |
321
+ | **`openplanr-pipeline`** | Claude Code plugin — canonical executor (8 subagents, manifest-enforced tool restrictions) | [openplanr/openplanr-pipeline](https://github.com/openplanr/openplanr-pipeline) |
322
+ | **`openplanr` skill** | Routing playbook — teaches Claude when to use which surface | [openplanr/skills](https://github.com/openplanr/skills) |
323
+ | **`openplanr/marketplace`** | Distribution — Claude Code plugin registry | [openplanr/marketplace](https://github.com/openplanr/marketplace) |
324
+
325
+ planr CLI is the only piece you need to install for Cursor and Codex. Add the marketplace + pipeline plugin for the full Claude Code experience.
326
+
327
+ ---
324
328
 
325
329
  ## Development
326
330
 
327
331
  ```bash
328
- # Clone and install
329
332
  git clone https://github.com/openplanr/OpenPlanr.git
330
- cd openplanr
333
+ cd OpenPlanr
331
334
  npm install
332
335
 
333
336
  # Run from source
334
337
  npx tsx src/cli/index.ts init
335
338
 
336
- # Build
339
+ # Build / test / lint
337
340
  npm run build
338
-
339
- # Run tests
340
341
  npm test
342
+ npx biome check src/ tests/
341
343
 
342
344
  # Link globally for development
343
345
  npm install -g .
344
346
  ```
345
347
 
348
+ ---
349
+
346
350
  ## Contributing
347
351
 
348
- Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
352
+ Contributions welcome. See [CONTRIBUTING.md](CONTRIBUTING.md).
349
353
 
350
354
  1. Fork the repository
351
355
  2. Create your feature branch (`git checkout -b feat/amazing-feature`)
352
- 3. Commit your changes (`git commit -m 'Add amazing feature'`)
353
- 4. Push to the branch (`git push origin feat/amazing-feature`)
356
+ 3. Commit your changes
357
+ 4. Push to the branch
354
358
  5. Open a Pull Request
355
359
 
360
+ ---
361
+
356
362
  ## License
357
363
 
358
364
  [MIT](LICENSE)
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QAsKnD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,QA6LnD"}