openplanr 2.1.0 → 2.2.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 (89) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cli/commands/planning-artifacts.d.ts.map +1 -1
  3. package/dist/cli/commands/planning-artifacts.js +6 -18
  4. package/dist/cli/commands/planning-artifacts.js.map +1 -1
  5. package/dist/cli/commands/sprint-refinement.d.ts +5 -0
  6. package/dist/cli/commands/sprint-refinement.d.ts.map +1 -0
  7. package/dist/cli/commands/sprint-refinement.js +141 -0
  8. package/dist/cli/commands/sprint-refinement.js.map +1 -0
  9. package/dist/cli/commands/status.d.ts.map +1 -1
  10. package/dist/cli/commands/status.js +4 -2
  11. package/dist/cli/commands/status.js.map +1 -1
  12. package/dist/cli/commands/update.d.ts.map +1 -1
  13. package/dist/cli/commands/update.js +5 -8
  14. package/dist/cli/commands/update.js.map +1 -1
  15. package/dist/dashboard/.vite/manifest.json +1 -1
  16. package/dist/dashboard/assets/{index-BCvntXFj.js → index-B74ddyXA.js} +2 -2
  17. package/dist/dashboard/assets/{index-BCvntXFj.js.map → index-B74ddyXA.js.map} +1 -1
  18. package/dist/dashboard/dashboard-manifest.json +8 -8
  19. package/dist/dashboard/index.html +1 -1
  20. package/dist/models/sprint-refinement-schema.d.ts +122 -0
  21. package/dist/models/sprint-refinement-schema.d.ts.map +1 -0
  22. package/dist/models/sprint-refinement-schema.js +147 -0
  23. package/dist/models/sprint-refinement-schema.js.map +1 -0
  24. package/dist/models/types.d.ts +8 -0
  25. package/dist/models/types.d.ts.map +1 -1
  26. package/dist/services/delivery-status-service.d.ts +6 -1
  27. package/dist/services/delivery-status-service.d.ts.map +1 -1
  28. package/dist/services/delivery-status-service.js +28 -1
  29. package/dist/services/delivery-status-service.js.map +1 -1
  30. package/dist/services/git-service.d.ts +19 -0
  31. package/dist/services/git-service.d.ts.map +1 -1
  32. package/dist/services/git-service.js +41 -0
  33. package/dist/services/git-service.js.map +1 -1
  34. package/dist/services/graph-service.d.ts.map +1 -1
  35. package/dist/services/graph-service.js +3 -1
  36. package/dist/services/graph-service.js.map +1 -1
  37. package/dist/services/sprint-refinement-service.d.ts +162 -0
  38. package/dist/services/sprint-refinement-service.d.ts.map +1 -0
  39. package/dist/services/sprint-refinement-service.js +645 -0
  40. package/dist/services/sprint-refinement-service.js.map +1 -0
  41. package/dist/services/upgrade-service.d.ts +1 -1
  42. package/dist/services/upgrade-service.d.ts.map +1 -1
  43. package/dist/services/upgrade-service.js +4 -3
  44. package/dist/services/upgrade-service.js.map +1 -1
  45. package/dist/templates/sprints/refinement.md.hbs +94 -0
  46. package/dist/templates/sprints/sprint-tasks.md.hbs +16 -0
  47. package/dist/templates/sprints/sprint.md.hbs +17 -12
  48. package/dist/utils/constants.d.ts +2 -0
  49. package/dist/utils/constants.d.ts.map +1 -1
  50. package/dist/utils/constants.js +6 -1
  51. package/dist/utils/constants.js.map +1 -1
  52. package/docs/CLI.md +26 -2
  53. package/lib/host-packages/adapter-registry.json +1 -1
  54. package/lib/host-packages/capability-map.json +16 -0
  55. package/lib/host-packages/claude/openplanr/.openplanr-content.json +27 -7
  56. package/lib/host-packages/claude/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +1 -1
  57. package/lib/host-packages/claude/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +1 -1
  58. package/lib/host-packages/claude/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +1 -1
  59. package/lib/host-packages/claude/openplanr/skills/openplanr/SKILL.md +1 -0
  60. package/lib/host-packages/claude/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +1 -1
  61. package/lib/host-packages/claude/openplanr/skills/sprint/SKILL.md +181 -0
  62. package/lib/host-packages/claude/openplanr/skills/sprint/openplanr.skill.json +59 -0
  63. package/lib/host-packages/claude/openplanr/skills/sprint/references/refinement-contract.md +154 -0
  64. package/lib/host-packages/claude/openplanr/skills/sprint/references/sprint-formats.md +146 -0
  65. package/lib/host-packages/claude/openplanr/skills/sprint/schemas/refinement.schema.json +140 -0
  66. package/lib/host-packages/cursor/openplanr/.openplanr-content.json +24 -8
  67. package/lib/host-packages/cursor/openplanr/manifest.json +2 -1
  68. package/lib/host-packages/cursor/openplanr/rules/planr-design/scripts/runtime/packages/protocol/package.json +1 -1
  69. package/lib/host-packages/cursor/openplanr/rules/planr-design-loop/scripts/runtime/packages/protocol/package.json +1 -1
  70. package/lib/host-packages/cursor/openplanr/rules/planr-design-review/scripts/runtime/packages/protocol/package.json +1 -1
  71. package/lib/host-packages/cursor/openplanr/rules/planr-openplanr.mdc +1 -0
  72. package/lib/host-packages/cursor/openplanr/rules/planr-plan/scripts/runtime/packages/protocol/package.json +1 -1
  73. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/refinement-contract.md +154 -0
  74. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/references/sprint-formats.md +146 -0
  75. package/lib/host-packages/cursor/openplanr/rules/planr-sprint/schemas/refinement.schema.json +140 -0
  76. package/lib/host-packages/cursor/openplanr/rules/planr-sprint.mdc +180 -0
  77. package/lib/host-packages/openai/openplanr/.openplanr-content.json +31 -7
  78. package/lib/host-packages/openai/openplanr/skills/design/scripts/runtime/packages/protocol/package.json +1 -1
  79. package/lib/host-packages/openai/openplanr/skills/design-loop/scripts/runtime/packages/protocol/package.json +1 -1
  80. package/lib/host-packages/openai/openplanr/skills/design-review/scripts/runtime/packages/protocol/package.json +1 -1
  81. package/lib/host-packages/openai/openplanr/skills/openplanr/SKILL.md +1 -0
  82. package/lib/host-packages/openai/openplanr/skills/plan/scripts/runtime/packages/protocol/package.json +1 -1
  83. package/lib/host-packages/openai/openplanr/skills/sprint/SKILL.md +181 -0
  84. package/lib/host-packages/openai/openplanr/skills/sprint/agents/openai.yaml +6 -0
  85. package/lib/host-packages/openai/openplanr/skills/sprint/openplanr.skill.json +59 -0
  86. package/lib/host-packages/openai/openplanr/skills/sprint/references/refinement-contract.md +154 -0
  87. package/lib/host-packages/openai/openplanr/skills/sprint/references/sprint-formats.md +146 -0
  88. package/lib/host-packages/openai/openplanr/skills/sprint/schemas/refinement.schema.json +140 -0
  89. package/package.json +2 -2
@@ -0,0 +1,181 @@
1
+ ---
2
+ name: sprint
3
+ description: Refine every open backlog item against the code and the calendar, refute the picks, and select a sprint that fits capacity and the release cut. Use before a cut or sprint; not for decomposing one specification or reporting status.
4
+ license: MIT
5
+ ---
6
+
7
+ # Planr Sprint
8
+
9
+ Backlog refinement followed by sprint selection. **Refine** reads every open
10
+ item in full and judges it against the default branch and the calendar.
11
+ **Select** fits the surviving items to the stated capacity and the next release
12
+ cut, refutes the picks with three independent lenses, and writes the sprint.
13
+ Perform the reasoning in this session; never delegate it to a model subprocess.
14
+ The CLI (`planr sprint …`) stores what this skill decides. It is optional: when
15
+ it is unavailable, write the same files by hand in the shapes given in
16
+ [sprint formats](references/sprint-formats.md).
17
+
18
+ Use `planr-plan` to decompose one specification, `planr-status` to report
19
+ without judging, and `planr-operate` for an executive decision queue. This skill
20
+ never implements work and never chains into `planr-ship`.
21
+
22
+ `--refine-only` runs the refine phase (steps 1 to 4 for the blocked and
23
+ close-or-demote buckets) and writes the refinement note without creating a
24
+ sprint. Any run can be repeated and diffed against the previous one.
25
+
26
+ ## Inputs are tiers, not gates
27
+
28
+ Every input except the backlog is optional. A missing tier removes one
29
+ capability; it never blocks the run. Name every degraded input in `Issues`.
30
+
31
+ | Input | If present | If absent |
32
+ | --- | --- | --- |
33
+ | Open backlog and quick tasks (`.planr/backlog/`, `.planr/quick/`, open spec tasks) | The core: read, score, bucket | The only hard requirement; zero items means "nothing to refine" |
34
+ | Git history and the code paths items cite | Evidence lens: stale, already fixed, premise false | Buckets rest on the items' own dates; say "not verified against code" |
35
+ | Release profile (`.release/profile.md`: cut date, cadence, freezes) | Size the In-progress bucket to the cut; the sprint gets `releaseCut` | Ask once for a horizon; default to a two-week sprint from today |
36
+ | Capacity (engineers × working days) | Fit the list and name the overflow | Ask once; default 1 engineer × 10 days, stated in the return |
37
+ | Previous sprint or refinement note (`.planr/sprints/SPRINT-NNN/refinement.json`) | Carry `leftovers`; `planr sprint diff` is possible | First run, no diff |
38
+ | Last Operate cycle | Rank its unfinished actions alongside | Skipped silently |
39
+ | Linear or GitHub connector | Push statuses on approval, read PR state | Local files only; report the external step as not run |
40
+
41
+ ## Step 0: Frame the run
42
+
43
+ Before reading the backlog, ask through the host's structured question surface
44
+ (Claude Code `AskUserQuestion`, the Codex equivalent), never through free text
45
+ when a structured surface exists.
46
+
47
+ - One call, at most three questions, each with mutually exclusive options and
48
+ a recommended default; the user can always answer "Other".
49
+ - Ask only what the repository cannot answer: capacity and horizon when no
50
+ profile and no argument supplies them; a focus (one product or area, or
51
+ everything); what to do with items judged dead (close, demote, or list only);
52
+ refine only, or refine and select.
53
+ - Never ask about facts derivable from files (the cut date in the profile, the
54
+ last sprint, the open item count). Never ask mid-run.
55
+ - With `--yes` or no structured surface, take the defaults and list the ones
56
+ taken in `Issues`.
57
+
58
+ The only other question is the approval at the end (step 6).
59
+
60
+ ## Step 1: Read the calendar and capacity
61
+
62
+ Next cut and freezes from `.release/profile.md`; capacity from the framing
63
+ question or argument; `leftovers` from the previous sprint's `refinement.json`;
64
+ unfinished actions from the last Operate cycle. Record the git revision the run
65
+ judges against (`git rev-parse --short HEAD` on the default branch).
66
+
67
+ ## Step 2: Read every open item in full
68
+
69
+ Backlog items, quick tasks and open spec tasks: the whole file, not the title.
70
+ For each item record the fields in the
71
+ [refinement contract](references/refinement-contract.md): what it claims, the
72
+ latest dated evidence, the code path it names and whether that path still
73
+ exists on the default branch as described, what blocks it (partner, team
74
+ decision, another item, nothing), an effort class (`hours`, `day`, `days`,
75
+ `week+`), and a score: production impact this month × tractability now.
76
+
77
+ Read the code an item names before believing its claim. `git log -S`, `git
78
+ log -- <path>` and the merged pull requests since the item's evidence date are
79
+ the cheapest refutations.
80
+
81
+ ## Step 3: Rank into four buckets
82
+
83
+ - **In progress now**: fits capacity to the cut, in execution order, grouped
84
+ into PR batches by product or into sessions. Each batch carries a title and
85
+ an effort in days.
86
+ - **Plan next**: real, but after the cut.
87
+ - **Blocked**: the named blocker and the one question that unblocks it.
88
+ - **Close or demote**: with the evidence (`file:line`, PR number or date) and
89
+ the target status or priority in the repository's own vocabulary.
90
+
91
+ Carry the previous Operate cycle's unfinished actions explicitly. Include the
92
+ release cut itself as work; when it has no artifact yet, file it with
93
+ `planr quick create "Release cut <date>"` so the sprint contains only artifact
94
+ ids.
95
+
96
+ ## Step 4: Refute the In-progress bucket
97
+
98
+ Before the bucket is shown, run three independent lenses over every pick:
99
+
100
+ 1. **Evidence**: still real on the default branch; premise not false; not
101
+ already fixed.
102
+ 2. **Capacity and sequencing**: fits the days; migrations, partner
103
+ dependencies, PR batching and CI cost per PR are accounted for.
104
+ 3. **User impact**: who is hit this month if it is not done, and which
105
+ higher-impact item was omitted for it.
106
+
107
+ A pick that fails moves or drops, and the reason is kept in `refuted[]` with its
108
+ lens. The list must fit the stated capacity; when it does not, say what was cut.
109
+
110
+ ## Step 5: Write the sprint, the note and the JSON, then stop
111
+
112
+ Write the three durable outputs (formats in
113
+ [sprint formats](references/sprint-formats.md)); the chat return is a view of
114
+ them.
115
+
116
+ ```bash
117
+ planr sprint create --data sprint.json --json # name, releaseCut, capacityDays, startDate
118
+ planr sprint refinement SPRINT-NNN --data refinement.json --json # validates, stores the note and JSON, fills the sprint body
119
+ planr sprint diff SPRINT-MMM SPRINT-NNN # when a previous run exists
120
+ ```
121
+
122
+ `refinement.json` must satisfy [the schema](schemas/refinement.schema.json); the
123
+ CLI rejects an inconsistent document with `$`-rooted diagnostics. Fix the
124
+ document, never the validation. With `--refine-only`, skip `sprint create` and
125
+ record the refinement against the current active sprint, or write only the note
126
+ and JSON when none exists.
127
+
128
+ Then stop. Ask the approval question through the structured surface: apply the
129
+ write-back, or leave the proposal as written.
130
+
131
+ ## Step 6: On approval, apply
132
+
133
+ ```bash
134
+ planr sprint apply SPRINT-NNN --dry-run # show the status and priority changes
135
+ planr sprint apply SPRINT-NNN --yes --commit # one commit: chore(planr): refine backlog for SPRINT-NNN
136
+ ```
137
+
138
+ Where a connector is configured, push each changed item afterwards
139
+ (`planr linear push <id>`, `planr github push <id>`) and report the ones that
140
+ were not pushed. When the CLI is unavailable, apply the same status changes with
141
+ the repository's own vocabulary and commit them with the same message.
142
+
143
+ Close a finished sprint with `planr sprint close SPRINT-NNN`; it records the
144
+ leftovers the next run carries.
145
+
146
+ ## Rules from production use
147
+
148
+ - Never move an item to In progress on its own priority label; a months-old P0
149
+ or P1 is often dead. Evidence date beats label.
150
+ - Never accept an item's claim of impact without reading the code path it names.
151
+ - Items blocked on a partner or a team decision are never In progress; they get
152
+ the question that unblocks them.
153
+ - The list must fit the stated capacity; if it does not, say what was cut.
154
+ - No new migration in a hand deploy unless the sprint says so explicitly.
155
+ - Use the repository's own status vocabulary (`planr update --help` lists it);
156
+ never introduce a second one.
157
+ - The note and the JSON are the durable output; the chat return is a view of
158
+ them. That is what keeps the third run from re-arguing the first two.
159
+
160
+ ## Return
161
+
162
+ - **Outcome:** `proposed` (sprint written, nothing else changed) or `applied`
163
+ (status changes written on approval), plus capacity used vs available in
164
+ engineer-days.
165
+ - **Sprint:** the sprint id and path, and the cut it targets.
166
+ - **Buckets:** four lists, one line per row: `ID · title · effort · why`.
167
+ In-progress rows sit under their batch heading in execution order. Blocked
168
+ rows carry the blocker and the unblocking question. Close-or-demote rows carry
169
+ the evidence.
170
+ - **Refuted:** every pick a refuter changed, with the lens and the change.
171
+ - **Issues:** degraded inputs, items that could not be read or judged, defaults
172
+ taken, or `none`.
173
+
174
+ `planr status` shows the active sprint with its cut and progress; the dashboard
175
+ (`planr-dashboard`) renders the sprint from the same frontmatter and checkboxes.
176
+
177
+ ## Reference files
178
+
179
+ - [Refinement contract](references/refinement-contract.md): item record, scoring, effort classes, buckets, refuter lenses, `refinement.json` fields
180
+ - [Sprint formats](references/sprint-formats.md): sprint artifact, refinement note, chat return, hand-written fallback
181
+ - [Refinement schema](schemas/refinement.schema.json): the JSON Schema the CLI validates against
@@ -0,0 +1,59 @@
1
+ {
2
+ "kind": "openplanr-skill-package",
3
+ "schemaVersion": "1.0.0",
4
+ "protocolVersion": "1.8.0",
5
+ "skillId": "planr-sprint",
6
+ "skillVersion": "1.0.0",
7
+ "entrypoint": "SKILL.md",
8
+ "hosts": [
9
+ "claude-code",
10
+ "codex",
11
+ "chatgpt",
12
+ "cursor"
13
+ ],
14
+ "execution": "host-agent",
15
+ "resources": [
16
+ {
17
+ "path": "agents/openai.yaml",
18
+ "kind": "agent-metadata",
19
+ "hosts": [
20
+ "codex",
21
+ "chatgpt"
22
+ ],
23
+ "executable": false
24
+ },
25
+ {
26
+ "path": "references/refinement-contract.md",
27
+ "kind": "reference",
28
+ "hosts": [
29
+ "claude-code",
30
+ "codex",
31
+ "chatgpt",
32
+ "cursor"
33
+ ],
34
+ "executable": false
35
+ },
36
+ {
37
+ "path": "references/sprint-formats.md",
38
+ "kind": "reference",
39
+ "hosts": [
40
+ "claude-code",
41
+ "codex",
42
+ "chatgpt",
43
+ "cursor"
44
+ ],
45
+ "executable": false
46
+ },
47
+ {
48
+ "path": "schemas/refinement.schema.json",
49
+ "kind": "schema",
50
+ "hosts": [
51
+ "claude-code",
52
+ "codex",
53
+ "chatgpt",
54
+ "cursor"
55
+ ],
56
+ "executable": false
57
+ }
58
+ ]
59
+ }
@@ -0,0 +1,154 @@
1
+ # Refinement contract
2
+
3
+ The refinement document is the durable record of one run: what was read, how
4
+ each item was judged, what was selected and what the refuters changed. The CLI
5
+ validates it (`planr sprint refinement <id> --data`), stores it as
6
+ `.planr/sprints/SPRINT-NNN/refinement.json`, renders `refinement.md` from it
7
+ and fills the sprint body from its batches. `planr sprint diff`, `planr sprint
8
+ close` and `planr sprint apply` read it back.
9
+
10
+ ## Item record
11
+
12
+ One entry per open item, whether or not it is selected.
13
+
14
+ | Field | Meaning |
15
+ | --- | --- |
16
+ | `id` | Artifact id (`BL-012`, `QT-034`, `TASK-007`). Only artifacts; file non-artifact work as a quick task first. |
17
+ | `title` | The item's title as written. |
18
+ | `claim` | What the item says is wrong or wanted, in one sentence. |
19
+ | `evidenceDate` | The latest dated evidence for the claim (`YYYY-MM-DD`), or `null` when none exists. |
20
+ | `codePath` / `codePathExists` | The code path the item names and whether it still exists on the default branch as described. `null` when the item names none. |
21
+ | `stale` | `true` when the evidence is older than the cadence allows or the code has moved on. |
22
+ | `blockedBy` | The named blockers: `partner: …`, `team decision: …`, `BL-045`. Empty when nothing blocks it. |
23
+ | `unblockQuestion` | The one question whose answer unblocks the item. |
24
+ | `effort` | `hours`, `day`, `days` or `week+`. |
25
+ | `score` | Production impact this month × tractability now. Any consistent scale; only the order matters. |
26
+ | `bucket` | `inProgress`, `planNext`, `blocked` or `closeOrDemote`. |
27
+ | `reason` | One clause: why the item sits in that bucket. |
28
+ | `evidence` | For close-or-demote rows: `file:line`, PR number or date. |
29
+ | `targetStatus` / `targetPriority` | What `planr sprint apply` writes, in the repository's own vocabulary (`planr update --help`). Priority applies to backlog items only. |
30
+
31
+ ## Scoring
32
+
33
+ Score = production impact this month × tractability now.
34
+
35
+ - Impact counts users hit, money or compliance at stake, and whether the
36
+ release cut depends on it. An item nobody is hit by this month scores low
37
+ regardless of its label.
38
+ - Tractability counts whether the fix is known, whether the code path exists,
39
+ whether a migration or a partner is needed, and whether the item is already
40
+ half done.
41
+ - Evidence date beats priority label. A P0 from months ago with no fresh
42
+ evidence is a candidate for close-or-demote, not for in progress.
43
+
44
+ ## Buckets
45
+
46
+ | Bucket | Rule |
47
+ | --- | --- |
48
+ | `inProgress` | Fits the stated capacity to the cut. Ordered for execution and grouped into `batches` (PR batches by product, or sessions). Includes the release cut itself as work. |
49
+ | `planNext` | Real and tractable, but after the cut. |
50
+ | `blocked` | Blocked on a partner, a team decision or another item. Never in progress. Carries `blockedBy` and `unblockQuestion`. |
51
+ | `closeOrDemote` | Dead, duplicated, overtaken or already delivered. Carries `evidence` and the `targetStatus` or `targetPriority` the write-back applies. |
52
+
53
+ Every item is in exactly one bucket; `buckets.<name>` lists the ids and each
54
+ item's `bucket` field agrees. `batches[].itemIds` partition `buckets.inProgress`
55
+ exactly.
56
+
57
+ ## Refuter lenses
58
+
59
+ Run all three over every in-progress pick before the buckets are shown.
60
+
61
+ | Lens | Question | Typical corrections |
62
+ | --- | --- | --- |
63
+ | `evidence` | Is it still real on the default branch? Is the premise true? Was it already fixed? | Dropped picks, moves to close-or-demote |
64
+ | `capacity` | Does the list fit the days? Are migrations, partner dependencies, PR batching and CI cost per PR accounted for? | Splits, reorders, moves to plan-next |
65
+ | `impact` | Who is hit this month if it is not done? Which higher-impact item was omitted for it? | Swaps, moves to plan-next |
66
+
67
+ A pick that fails a lens moves or drops, and the correction is recorded in
68
+ `refuted[]` as `{ itemId, lens, change, from, to }`. Nothing is deleted from
69
+ `items[]`; the item keeps its new bucket and reason.
70
+
71
+ ## `refinement.json`
72
+
73
+ ```json
74
+ {
75
+ "schemaVersion": 1,
76
+ "sprintId": "SPRINT-004",
77
+ "refinedAt": "2026-09-17",
78
+ "inputs": {
79
+ "capacityDays": 6,
80
+ "releaseCut": "2026-09-25",
81
+ "gitRevision": "a1b2c3d",
82
+ "previousSprintId": "SPRINT-003",
83
+ "operateCycleId": "OP-2026-09-A",
84
+ "sources": ["backlog", "quick", "git", "release-profile"],
85
+ "defaulted": ["capacity"],
86
+ "notes": "Connector not configured; statuses stay local."
87
+ },
88
+ "items": [
89
+ {
90
+ "id": "BL-345",
91
+ "title": "CRM callback silent since 10 Sep",
92
+ "claim": "Callbacks from the CRM stopped landing on 10 Sep",
93
+ "evidenceDate": "2026-09-16",
94
+ "codePath": "apps/apply/src/crm/callback.ts",
95
+ "codePathExists": true,
96
+ "stale": false,
97
+ "blockedBy": [],
98
+ "effort": "hours",
99
+ "score": 9.5,
100
+ "bucket": "inProgress",
101
+ "reason": "39 applications stuck at Received"
102
+ },
103
+ {
104
+ "id": "BL-295",
105
+ "title": "Importer drops trailing rows",
106
+ "evidenceDate": "2026-05-02",
107
+ "stale": true,
108
+ "blockedBy": [],
109
+ "effort": "days",
110
+ "score": 0.5,
111
+ "bucket": "closeOrDemote",
112
+ "reason": "delivered by #569",
113
+ "evidence": "PR #569 merged 2026-09-08",
114
+ "targetStatus": "closed"
115
+ },
116
+ {
117
+ "id": "BL-167",
118
+ "title": "Dynamics id for the Austrian Matura",
119
+ "evidenceDate": "2026-08-30",
120
+ "stale": false,
121
+ "blockedBy": ["partner: Dynamics team"],
122
+ "unblockQuestion": "Which Dynamics id represents the Austrian Matura?",
123
+ "effort": "day",
124
+ "score": 4,
125
+ "bucket": "blocked",
126
+ "reason": "needs the partner mapping"
127
+ }
128
+ ],
129
+ "buckets": {
130
+ "inProgress": ["BL-345"],
131
+ "planNext": [],
132
+ "blocked": ["BL-167"],
133
+ "closeOrDemote": ["BL-295"]
134
+ },
135
+ "batches": [
136
+ { "title": "VM read session", "effortDays": 0.5, "itemIds": ["BL-345"] }
137
+ ],
138
+ "refuted": [
139
+ {
140
+ "itemId": "BL-295",
141
+ "lens": "evidence",
142
+ "change": "delivered 8 Sep, moved to close",
143
+ "from": "inProgress",
144
+ "to": "closeOrDemote"
145
+ }
146
+ ]
147
+ }
148
+ ```
149
+
150
+ `inputs.sources` names what was read; `inputs.defaulted` names every value
151
+ taken from a default instead of the repository or the user. The CLI adds
152
+ `leftovers[]` on `planr sprint close` and `applied` on `planr sprint apply`;
153
+ never write those yourself. Unknown fields are rejected, so keep notes in
154
+ `inputs.notes` or in the item's `reason`.
@@ -0,0 +1,146 @@
1
+ # Sprint formats
2
+
3
+ Three durable outputs and one chat return. The CLI writes the first three from
4
+ the two JSON inputs below; when it is unavailable, write the same files by hand.
5
+
6
+ ## `sprint.json` (input to `planr sprint create --data`)
7
+
8
+ ```json
9
+ {
10
+ "title": "Cut 25 Sep 2026",
11
+ "startDate": "2026-09-17",
12
+ "releaseCut": "2026-09-25",
13
+ "capacityDays": 6,
14
+ "goals": ["Unblock stuck applications", "Ship the cut"]
15
+ }
16
+ ```
17
+
18
+ `endDate` defaults to `releaseCut`, or to `startDate` plus the duration when no
19
+ cut is known. `status` may be `planned` or `active` (default). Omit `taskIds`
20
+ and `batches`; `planr sprint refinement` fills them from the refinement
21
+ document.
22
+
23
+ ## Sprint artifact
24
+
25
+ `.planr/sprints/SPRINT-NNN-<slug>.md`: the existing frontmatter plus three
26
+ fields, and the In-progress bucket as checkboxes grouped by batch.
27
+
28
+ ```markdown
29
+ ---
30
+ id: "SPRINT-004"
31
+ name: "Cut 25 Sep 2026"
32
+ startDate: "2026-09-17"
33
+ endDate: "2026-09-25"
34
+ duration: "8d"
35
+ status: "active"
36
+ releaseCut: "2026-09-25"
37
+ capacityDays: 6
38
+ created: "2026-09-17"
39
+ updated: "2026-09-17"
40
+ taskIds: ["BL-345", "BL-348", "QT-194"]
41
+ refinedAt: "2026-09-17"
42
+ ---
43
+
44
+ # SPRINT-004: Cut 25 Sep 2026
45
+
46
+ ## Sprint Details
47
+
48
+ - **Duration:** 8d
49
+ - **Start:** 2026-09-17
50
+ - **End:** 2026-09-25
51
+ - **Status:** ACTIVE
52
+ - **Release cut:** 2026-09-25
53
+ - **Capacity:** 6 engineer-days
54
+
55
+ ## Tasks
56
+
57
+ ### VM read session · 0.5d
58
+
59
+ - [ ] **BL-345** CRM callback silent since 10 Sep · hours · [view](../backlog/BL-345-crm-callback-silent.md)
60
+
61
+ ### PR 1 · MUVi Apply · 1d
62
+
63
+ - [ ] **BL-348** rag-api cannot reach the department API · day · [view](../backlog/BL-348-rag-api.md)
64
+ - [ ] **QT-194** Release cut 25 Sep · hours · [view](../quick/QT-194-release-cut-25-sep.md)
65
+
66
+ ## Retrospective
67
+ _Complete this section when closing the sprint with `planr sprint close SPRINT-004`._
68
+ ```
69
+
70
+ Each task line is `- [ ] **ID** title · effort · [view](relative path)`.
71
+ `planr status`, `planr sprint close` and the dashboard read these lines; tick a
72
+ box when the item ships. `releaseCut` is absent when no release profile exists;
73
+ `capacityDays` and `refinedAt` are absent until a refinement is recorded.
74
+
75
+ ## Refinement note
76
+
77
+ `.planr/sprints/SPRINT-NNN/refinement.md`, rendered from the JSON so the next
78
+ run can diff against it:
79
+
80
+ - **Inputs**: capacity, release cut, git revision, previous sprint, Operate
81
+ cycle, sources read, values defaulted.
82
+ - **Items**: one table row per open item: `ID · score · evidence date · stale?
83
+ · blocked by · effort · bucket`.
84
+ - **Refuter verdicts**: every correction verbatim, with its lens.
85
+ - **In progress** by batch, then **Plan next**, **Blocked** and **Close or
86
+ demote** in full, since only In progress goes into the sprint.
87
+ - **Leftovers** (after `planr sprint close`) and **Applied** (after
88
+ `planr sprint apply`).
89
+
90
+ ## Machine-readable copy
91
+
92
+ `.planr/sprints/SPRINT-NNN/refinement.json`: the document described in
93
+ [the refinement contract](refinement-contract.md), validated against the JSON
94
+ Schema packaged as `schemas/refinement.schema.json` (linked from the skill
95
+ entrypoint). The dashboard, `planr sprint diff` and `planr sprint apply` consume
96
+ it.
97
+
98
+ ## Status write-back
99
+
100
+ Only on approval through the structured question. `planr sprint apply
101
+ SPRINT-NNN --yes --commit` writes each close, demote or blocked row's
102
+ `targetStatus`, `targetPriority` and `blockedBy` to the artifacts and commits the
103
+ sprint, the note, the JSON and the changed artifacts as one commit:
104
+
105
+ ```
106
+ chore(planr): refine backlog for SPRINT-NNN
107
+ ```
108
+
109
+ ## Example chat return
110
+
111
+ ```
112
+ Outcome: proposed · 5.8 of 6 engineer-days used · SPRINT-004 (cut 25 Sep)
113
+ Sprint: .planr/sprints/SPRINT-004-cut-25-sep-2026.md
114
+
115
+ In progress (execution order)
116
+ VM read session · 0.5d
117
+ BL-345 CRM callback silent since 10 Sep, 39 applications stuck at Received
118
+ BL-348 rag-api cannot reach the department API (+ missing api key)
119
+ PR 1 · MUVi Apply · 1d
120
+ BL-282 self-healing where clause
121
+ BL-229 write-side GUID check only (rest 9 Oct)
122
+ PR 2 · Connect residuals · 0.75d
123
+ BL-360, BL-364, BL-368, BL-056 (D3 only)
124
+ Ops readiness · 1.5d · QT-194 the cut · 0.5d
125
+
126
+ Plan next (9 Oct) BL-224, BL-043, BL-283, BL-014, BL-349 code, … (14 items)
127
+ Blocked BL-167 partner: Dynamics id for Austrian Matura?
128
+ BL-272 team: which English tests carry a score? (31 items)
129
+ Close or demote BL-295 done by #569 · BL-327 done by #590 · BL-197 P1 dead 14 Sep … (42 items)
130
+
131
+ Refuted BL-342 evidence: no server actions in muvi-apply, dropped
132
+ BL-229 impact: no applicant hit this month, split
133
+ BL-295 evidence: delivered 8 Sep, moved to close
134
+ Issues none
135
+ Next approve write-back: planr sprint apply SPRINT-004 --yes --commit
136
+ ```
137
+
138
+ ## Hand-written fallback
139
+
140
+ Without the CLI, create the three files above yourself: allocate the next
141
+ `SPRINT-NNN`, write the frontmatter and the batched checkboxes exactly as shown,
142
+ write `refinement.json` to the schema and `refinement.md` from it, and apply the
143
+ status changes with the repository's own vocabulary in one commit with the same
144
+ message. Never store notes as `.planr/sprints/SPRINT-NNN-*.md` siblings; graph
145
+ readers treat every `.md` in `sprints/` as a sprint and skip only the
146
+ `SPRINT-NNN/` directory.
@@ -0,0 +1,140 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://openplanr.dev/schemas/skills/planr-sprint/refinement.schema.json",
4
+ "title": "OpenPlanr sprint refinement document",
5
+ "description": "One backlog refinement run: inputs, every open item's judgement, the four buckets, the in-progress batches and the refuter corrections. Written by the planr-sprint skill and validated by planr sprint refinement.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "sprintId", "refinedAt", "inputs", "items", "buckets"],
9
+ "$defs": {
10
+ "isoDate": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
11
+ "artifactId": { "type": "string", "pattern": "^[A-Z]+-\\d+$" },
12
+ "sprintId": { "type": "string", "pattern": "^SPRINT-\\d+$" },
13
+ "text": { "type": "string", "minLength": 1 },
14
+ "bucket": { "enum": ["inProgress", "planNext", "blocked", "closeOrDemote"] },
15
+ "effort": { "enum": ["hours", "day", "days", "week+"] },
16
+ "lens": { "enum": ["evidence", "capacity", "impact"] },
17
+ "idList": { "type": "array", "items": { "$ref": "#/$defs/artifactId" } }
18
+ },
19
+ "properties": {
20
+ "schemaVersion": { "const": 1 },
21
+ "sprintId": { "$ref": "#/$defs/sprintId" },
22
+ "refinedAt": { "$ref": "#/$defs/isoDate" },
23
+ "inputs": {
24
+ "type": "object",
25
+ "additionalProperties": false,
26
+ "properties": {
27
+ "capacityDays": { "type": "number", "exclusiveMinimum": 0 },
28
+ "releaseCut": { "$ref": "#/$defs/isoDate" },
29
+ "gitRevision": { "$ref": "#/$defs/text" },
30
+ "previousSprintId": { "$ref": "#/$defs/sprintId" },
31
+ "operateCycleId": { "$ref": "#/$defs/text" },
32
+ "sources": { "type": "array", "items": { "$ref": "#/$defs/text" }, "default": [] },
33
+ "defaulted": { "type": "array", "items": { "$ref": "#/$defs/text" }, "default": [] },
34
+ "notes": { "$ref": "#/$defs/text" }
35
+ }
36
+ },
37
+ "items": {
38
+ "type": "array",
39
+ "items": {
40
+ "type": "object",
41
+ "additionalProperties": false,
42
+ "required": ["id", "title", "effort", "score", "bucket", "reason"],
43
+ "properties": {
44
+ "id": { "$ref": "#/$defs/artifactId" },
45
+ "title": { "$ref": "#/$defs/text" },
46
+ "claim": { "$ref": "#/$defs/text" },
47
+ "evidenceDate": { "oneOf": [{ "$ref": "#/$defs/isoDate" }, { "type": "null" }], "default": null },
48
+ "codePath": { "oneOf": [{ "$ref": "#/$defs/text" }, { "type": "null" }] },
49
+ "codePathExists": { "type": ["boolean", "null"] },
50
+ "stale": { "type": "boolean", "default": false },
51
+ "blockedBy": { "type": "array", "items": { "$ref": "#/$defs/text" }, "default": [] },
52
+ "unblockQuestion": { "$ref": "#/$defs/text" },
53
+ "effort": { "$ref": "#/$defs/effort" },
54
+ "score": { "type": "number" },
55
+ "bucket": { "$ref": "#/$defs/bucket" },
56
+ "reason": { "$ref": "#/$defs/text" },
57
+ "evidence": { "$ref": "#/$defs/text" },
58
+ "targetStatus": { "$ref": "#/$defs/text" },
59
+ "targetPriority": { "$ref": "#/$defs/text" }
60
+ }
61
+ }
62
+ },
63
+ "buckets": {
64
+ "type": "object",
65
+ "additionalProperties": false,
66
+ "required": ["inProgress", "planNext", "blocked", "closeOrDemote"],
67
+ "properties": {
68
+ "inProgress": { "$ref": "#/$defs/idList" },
69
+ "planNext": { "$ref": "#/$defs/idList" },
70
+ "blocked": { "$ref": "#/$defs/idList" },
71
+ "closeOrDemote": { "$ref": "#/$defs/idList" }
72
+ }
73
+ },
74
+ "batches": {
75
+ "type": "array",
76
+ "default": [],
77
+ "items": {
78
+ "type": "object",
79
+ "additionalProperties": false,
80
+ "required": ["title", "itemIds"],
81
+ "properties": {
82
+ "title": { "$ref": "#/$defs/text" },
83
+ "effortDays": { "type": "number", "exclusiveMinimum": 0 },
84
+ "itemIds": { "type": "array", "minItems": 1, "items": { "$ref": "#/$defs/artifactId" } }
85
+ }
86
+ }
87
+ },
88
+ "refuted": {
89
+ "type": "array",
90
+ "default": [],
91
+ "items": {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "required": ["itemId", "lens", "change"],
95
+ "properties": {
96
+ "itemId": { "$ref": "#/$defs/artifactId" },
97
+ "lens": { "$ref": "#/$defs/lens" },
98
+ "change": { "$ref": "#/$defs/text" },
99
+ "from": { "$ref": "#/$defs/bucket" },
100
+ "to": { "enum": ["inProgress", "planNext", "blocked", "closeOrDemote", "dropped"] }
101
+ }
102
+ }
103
+ },
104
+ "leftovers": {
105
+ "description": "Written by planr sprint close.",
106
+ "type": "array",
107
+ "items": {
108
+ "type": "object",
109
+ "additionalProperties": false,
110
+ "required": ["id", "reason"],
111
+ "properties": {
112
+ "id": { "$ref": "#/$defs/artifactId" },
113
+ "reason": { "enum": ["unchecked", "not-done"] }
114
+ }
115
+ }
116
+ },
117
+ "applied": {
118
+ "description": "Written by planr sprint apply.",
119
+ "type": "object",
120
+ "additionalProperties": false,
121
+ "required": ["at", "updates"],
122
+ "properties": {
123
+ "at": { "$ref": "#/$defs/text" },
124
+ "updates": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "object",
128
+ "additionalProperties": false,
129
+ "required": ["id", "type", "fields"],
130
+ "properties": {
131
+ "id": { "$ref": "#/$defs/artifactId" },
132
+ "type": { "$ref": "#/$defs/text" },
133
+ "fields": { "type": "object", "additionalProperties": { "type": "string" } }
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+ }