@zalom/plastic 2.0.0-alpha.9 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/PLASTIC.md +13 -136
  2. package/README.md +357 -133
  3. package/agents/plastic-enforcer.md +20 -15
  4. package/agents/plastic-executor.md +15 -4
  5. package/agents/plastic-node-research.md +30 -0
  6. package/agents/plastic-node-verify.md +28 -0
  7. package/agents/plastic-node-work.md +33 -0
  8. package/agents/{plastic-advisor.md → plastic-primary-advisor.md} +7 -9
  9. package/agents/{plastic-faux-advisor.md → plastic-secondary-advisor.md} +9 -12
  10. package/assets/plastic-logo.svg +1 -0
  11. package/bin/crap +4 -0
  12. package/bin/lib/context_budget.rb +43 -6
  13. package/bin/lib/skill_census.rb +839 -0
  14. package/bin/plastic +6 -0
  15. package/bin/plastic-skill-census +114 -0
  16. package/bin/test +24 -4
  17. package/bin/verify-change +345 -0
  18. package/config_asks.yml +4 -4
  19. package/deprecations.yml +1 -1
  20. package/{skills/agent-advisor/references → docs/help}/advisor-protocol.md +19 -24
  21. package/{skills/auto/references → docs/help}/agent-architecture.md +16 -14
  22. package/{skills/conventions/references → docs/help}/completion-and-done.md +15 -16
  23. package/docs/help/human-report-contract.md +152 -0
  24. package/{skills/conventions/references → docs/help}/knowledge-graph.md +9 -0
  25. package/{skills/conventions/references → docs/help}/locks-and-worktrees.md +11 -13
  26. package/{skills/conventions/references → docs/help}/maintenance-and-revisions.md +1 -1
  27. package/{skills/conventions/references → docs/help}/roadmaps.md +2 -2
  28. package/{skills/tutorial/references → docs/help}/track-1-guided.md +28 -47
  29. package/{skills/tutorial/references → docs/help}/track-2-auto.md +8 -8
  30. package/{skills/tutorial/references → docs/help}/track-3-projects-and-roadmaps.md +24 -17
  31. package/hooks/call-budget +4 -0
  32. package/hooks/hooks.json +24 -0
  33. package/hooks/message-display +55 -2
  34. package/hooks/session-start +5 -1
  35. package/hooks/statusline +32 -27
  36. package/hooks/stop +5 -0
  37. package/package.json +5 -3
  38. package/scripts/append-ledger +2 -1
  39. package/scripts/dashboard.rb +267 -16
  40. package/scripts/day-summary +2 -1
  41. package/scripts/doctor.rb +680 -39
  42. package/scripts/end-intent +153 -30
  43. package/scripts/exec-worktree +5 -5
  44. package/scripts/file-session-intent +2 -1
  45. package/scripts/graph-measure +249 -0
  46. package/scripts/hook-call-budget +222 -0
  47. package/scripts/hook-capture +24 -123
  48. package/scripts/hook-close +2 -1
  49. package/scripts/hook-message-display +7 -0
  50. package/scripts/hook-record +24 -16
  51. package/scripts/hook-savepoint +27 -3
  52. package/scripts/hook-session-start +359 -321
  53. package/scripts/hook-stop +58 -0
  54. package/scripts/index-projection +74 -0
  55. package/scripts/insight-append +17 -4
  56. package/scripts/install.rb +9 -7
  57. package/scripts/lib/action_graph_shim.rb +279 -0
  58. package/scripts/lib/active_delivery.rb +105 -0
  59. package/scripts/lib/agent_models.rb +63 -25
  60. package/scripts/lib/arm.rb +48 -83
  61. package/scripts/lib/atomic_write.rb +31 -0
  62. package/scripts/lib/backup.rb +65 -0
  63. package/scripts/lib/cli/command.rb +92 -0
  64. package/scripts/lib/cli/commands/auto.rb +18 -0
  65. package/scripts/lib/cli/commands/auto_brief.rb +44 -0
  66. package/scripts/lib/cli/commands/auto_lock.rb +99 -0
  67. package/scripts/lib/cli/commands/auto_report.rb +50 -0
  68. package/scripts/lib/cli/commands/auto_take.rb +31 -0
  69. package/scripts/lib/cli/commands/backup.rb +43 -0
  70. package/scripts/lib/cli/commands/checkout.rb +25 -0
  71. package/scripts/lib/cli/commands/continue.rb +66 -0
  72. package/scripts/lib/cli/commands/doctor.rb +81 -0
  73. package/scripts/lib/cli/commands/feedback.rb +40 -0
  74. package/scripts/lib/cli/commands/help.rb +69 -0
  75. package/scripts/lib/cli/commands/hook.rb +32 -0
  76. package/scripts/lib/cli/commands/index.rb +23 -0
  77. package/scripts/lib/cli/commands/install.rb +21 -0
  78. package/scripts/lib/cli/commands/installer_verb.rb +37 -0
  79. package/scripts/lib/cli/commands/intent.rb +19 -0
  80. package/scripts/lib/cli/commands/intent_answer.rb +37 -0
  81. package/scripts/lib/cli/commands/intent_command.rb +53 -0
  82. package/scripts/lib/cli/commands/intent_end.rb +62 -0
  83. package/scripts/lib/cli/commands/intent_new.rb +62 -0
  84. package/scripts/lib/cli/commands/intent_note.rb +43 -0
  85. package/scripts/lib/cli/commands/intent_rule.rb +36 -0
  86. package/scripts/lib/cli/commands/intent_show.rb +32 -0
  87. package/scripts/lib/cli/commands/intent_spec.rb +44 -0
  88. package/scripts/lib/cli/commands/intent_step.rb +71 -0
  89. package/scripts/lib/cli/commands/intent_verify.rb +26 -0
  90. package/scripts/lib/cli/commands/migrate.rb +16 -0
  91. package/scripts/lib/cli/commands/migrate_stores.rb +31 -0
  92. package/scripts/lib/cli/commands/next.rb +54 -0
  93. package/scripts/lib/cli/commands/project.rb +19 -0
  94. package/scripts/lib/cli/commands/project_links.rb +42 -0
  95. package/scripts/lib/cli/commands/project_list.rb +20 -0
  96. package/scripts/lib/cli/commands/project_new.rb +72 -0
  97. package/scripts/lib/cli/commands/query.rb +31 -0
  98. package/scripts/lib/cli/commands/render.rb +33 -0
  99. package/scripts/lib/cli/commands/roadmap.rb +19 -0
  100. package/scripts/lib/cli/commands/roadmap_check.rb +54 -0
  101. package/scripts/lib/cli/commands/roadmap_log.rb +54 -0
  102. package/scripts/lib/cli/commands/roadmap_migrate.rb +53 -0
  103. package/scripts/lib/cli/commands/roadmap_next.rb +70 -0
  104. package/scripts/lib/cli/commands/roadmap_show.rb +45 -0
  105. package/scripts/lib/cli/commands/rollback.rb +20 -0
  106. package/scripts/lib/cli/commands/search.rb +60 -0
  107. package/scripts/lib/cli/commands/session.rb +18 -0
  108. package/scripts/lib/cli/commands/session_commit.rb +42 -0
  109. package/scripts/lib/cli/commands/session_handoff.rb +34 -0
  110. package/scripts/lib/cli/commands/session_summary.rb +35 -0
  111. package/scripts/lib/cli/commands/status.rb +68 -0
  112. package/scripts/lib/cli/commands/subcommand_list.rb +36 -0
  113. package/scripts/lib/cli/commands/sync.rb +46 -0
  114. package/scripts/lib/cli/commands/uninstall.rb +20 -0
  115. package/scripts/lib/cli/commands/update.rb +20 -0
  116. package/scripts/lib/cli/commands/version.rb +53 -0
  117. package/scripts/lib/cli/frontier.rb +86 -0
  118. package/scripts/lib/cli/intent_progress.rb +36 -0
  119. package/scripts/lib/cli/legacy.rb +80 -0
  120. package/scripts/lib/cli/output.rb +137 -0
  121. package/scripts/lib/cli/scope.rb +134 -0
  122. package/scripts/lib/cli/table.rb +65 -0
  123. package/scripts/lib/cli.rb +94 -0
  124. package/scripts/lib/codex_adapter.rb +198 -0
  125. package/scripts/lib/compact_instructions.rb +13 -5
  126. package/scripts/lib/core_integrity.rb +71 -0
  127. package/scripts/lib/dashboard_screen.rb +40 -0
  128. package/scripts/lib/data_boundary.rb +132 -0
  129. package/scripts/lib/day_summary.rb +23 -14
  130. package/scripts/lib/doctor_core.rb +114 -38
  131. package/scripts/lib/doctor_session_ledger.rb +5 -53
  132. package/scripts/lib/engine_permissions.rb +88 -0
  133. package/scripts/lib/exec_worktree.rb +24 -21
  134. package/scripts/lib/feedback_report.rb +1 -1
  135. package/scripts/lib/graph_edges.rb +137 -0
  136. package/scripts/lib/graph_file.rb +246 -0
  137. package/scripts/lib/graph_measure.rb +645 -0
  138. package/scripts/lib/graph_measure_budget.rb +409 -0
  139. package/scripts/lib/graph_measure_cohorts.rb +487 -0
  140. package/scripts/lib/graph_measure_models.rb +413 -0
  141. package/scripts/lib/graph_measure_report.rb +532 -0
  142. package/scripts/lib/graph_tree.rb +98 -0
  143. package/scripts/lib/guarded_append.rb +155 -0
  144. package/scripts/lib/handoff.rb +40 -13
  145. package/scripts/lib/harness_adapter.rb +184 -0
  146. package/scripts/lib/hook_registry.rb +27 -3
  147. package/scripts/lib/hook_replay.rb +229 -0
  148. package/scripts/lib/index_entry.rb +62 -0
  149. package/scripts/lib/index_projection.rb +201 -0
  150. package/scripts/lib/insights.rb +1 -1
  151. package/scripts/lib/installer_core.rb +531 -71
  152. package/scripts/lib/intent_screen.rb +4 -4
  153. package/scripts/lib/intent_screen_ansi.rb +73 -12
  154. package/scripts/lib/intent_validator.rb +2 -2
  155. package/scripts/lib/lock.rb +10 -11
  156. package/scripts/lib/message_display.rb +350 -54
  157. package/scripts/lib/meter_watch.rb +185 -0
  158. package/scripts/lib/node_file.rb +234 -0
  159. package/scripts/lib/node_ids.rb +99 -0
  160. package/scripts/lib/node_input.rb +913 -0
  161. package/scripts/lib/node_input_compatibility.rb +62 -0
  162. package/scripts/lib/node_ledger.rb +386 -0
  163. package/scripts/lib/node_progress.rb +153 -0
  164. package/scripts/lib/node_return.rb +204 -0
  165. package/scripts/lib/node_worktree.rb +337 -0
  166. package/scripts/lib/outcome_report.rb +440 -0
  167. package/scripts/lib/preflight.rb +4 -6
  168. package/scripts/lib/project_config.rb +46 -0
  169. package/scripts/lib/project_validator.rb +3 -2
  170. package/scripts/lib/qmd_sync.rb +8 -7
  171. package/scripts/lib/ready_set.rb +462 -0
  172. package/scripts/lib/reference_archive.rb +45 -0
  173. package/scripts/lib/release_guard.rb +18 -0
  174. package/scripts/lib/report_screen.rb +1371 -47
  175. package/scripts/lib/rlm/corpus.rb +13 -0
  176. package/scripts/lib/rlm/probe.rb +29 -0
  177. package/scripts/lib/rlm/query.rb +22 -0
  178. package/scripts/lib/roadmap_graph.rb +210 -0
  179. package/scripts/lib/roadmap_migration.rb +95 -0
  180. package/scripts/lib/roadmap_queue.rb +158 -8
  181. package/scripts/lib/roadmap_render.rb +150 -0
  182. package/scripts/lib/roadmap_savepoint.rb +64 -14
  183. package/scripts/lib/runner_absorb.rb +703 -0
  184. package/scripts/lib/runner_answer.rb +206 -0
  185. package/scripts/lib/runner_core.rb +194 -0
  186. package/scripts/lib/runner_dispatch.rb +525 -0
  187. package/scripts/lib/runner_policy.rb +191 -0
  188. package/scripts/lib/runner_proposals.rb +275 -0
  189. package/scripts/lib/runner_rewind.rb +201 -0
  190. package/scripts/lib/runner_sweep.rb +231 -0
  191. package/scripts/lib/runner_until_empty.rb +252 -0
  192. package/scripts/lib/runner_watch.rb +389 -0
  193. package/scripts/lib/savepoint.rb +141 -19
  194. package/scripts/lib/scaffold_intent.rb +6 -3
  195. package/scripts/lib/screen_paint.rb +365 -28
  196. package/scripts/lib/screens/dashboard.rb +20 -0
  197. package/scripts/lib/screens/plan.rb +18 -0
  198. package/scripts/lib/screens/roadmap.rb +15 -0
  199. package/scripts/lib/search_index.rb +55 -0
  200. package/scripts/lib/session_close.rb +30 -28
  201. package/scripts/lib/session_git.rb +25 -18
  202. package/scripts/lib/session_ledger.rb +48 -4
  203. package/scripts/lib/session_usage.rb +190 -0
  204. package/scripts/lib/sqlite.rb +22 -0
  205. package/scripts/lib/stop_gate.rb +95 -0
  206. package/scripts/lib/store_discovery.rb +7 -6
  207. package/scripts/lib/store_layout.rb +54 -0
  208. package/scripts/lib/store_provisioning.rb +2 -1
  209. package/scripts/lib/store_sync.rb +85 -0
  210. package/scripts/lib/stores_move.rb +93 -0
  211. package/scripts/lib/verify_intent.rb +36 -8
  212. package/scripts/lib/version_number.rb +48 -0
  213. package/scripts/lib/work_graph.rb +59 -0
  214. package/scripts/lib/work_graph_validator.rb +201 -0
  215. package/scripts/lib/worktree.rb +27 -32
  216. package/scripts/lib/worktree_sweep.rb +6 -5
  217. package/scripts/link-suggest +2 -1
  218. package/scripts/meter-watch +57 -0
  219. package/scripts/migrate-to-global +1 -1
  220. package/scripts/new-intent +4 -13
  221. package/scripts/node-input +92 -0
  222. package/scripts/node-run +225 -0
  223. package/scripts/node-transition +291 -0
  224. package/scripts/outcome-report +74 -0
  225. package/scripts/plastic-lock +42 -33
  226. package/scripts/promote-session-item +3 -2
  227. package/scripts/read-config +53 -9
  228. package/scripts/ready-set +126 -0
  229. package/scripts/release-check +123 -0
  230. package/scripts/report-screen +177 -16
  231. package/scripts/roadmap-graph +119 -0
  232. package/scripts/roadmap-savepoint +7 -0
  233. package/scripts/runner +581 -0
  234. package/scripts/savepoint-note +11 -9
  235. package/scripts/session-commit +2 -1
  236. package/scripts/session-usage +56 -0
  237. package/scripts/skill-lint +115 -6
  238. package/scripts/spawn-preamble +2 -2
  239. package/scripts/update.rb +25 -4
  240. package/scripts/validate-work-graph +39 -0
  241. package/scripts/verify-intent +3 -2
  242. package/scripts/write-handoff +2 -1
  243. package/templates/agents.md +7 -7
  244. package/templates/config.yml +16 -9
  245. package/templates/dashboard-screen.md +22 -0
  246. package/templates/display-fixture.md +21 -0
  247. package/templates/graph.md +16 -0
  248. package/templates/index.md +1 -1
  249. package/templates/intent-screen.md +1 -1
  250. package/templates/node-decision.md +11 -0
  251. package/templates/node-research.md +13 -0
  252. package/templates/node-verify.md +13 -0
  253. package/templates/node-work.md +22 -0
  254. package/templates/outcome.md +8 -3
  255. package/templates/project.yml +1 -1
  256. package/templates/render.css +10 -0
  257. package/templates/report-plan.md +15 -0
  258. package/templates/report-roadmap-delivered.md +10 -0
  259. package/templates/report-roadmap-plan.md +9 -0
  260. package/templates/report-roadmap-state.md +9 -0
  261. package/templates/report-state.md +1 -1
  262. package/templates/roadmap.md +13 -0
  263. package/bin/plastic.js +0 -70
  264. package/scripts/lib/bridge.rb +0 -116
  265. package/skills/agent-advisor/SKILL.md +0 -92
  266. package/skills/auto/SKILL.md +0 -296
  267. package/skills/auto/evals/evals.json +0 -255
  268. package/skills/auto/references/end-tail.md +0 -66
  269. package/skills/auto/references/human-report-contract.md +0 -78
  270. package/skills/conventions/SKILL.md +0 -29
  271. package/skills/dashboard/SKILL.md +0 -169
  272. package/skills/dashboard/evals/evals.json +0 -38
  273. package/skills/dashboard/references/classification.md +0 -22
  274. package/skills/dashboard/templates/dashboard-global.md +0 -20
  275. package/skills/dashboard/templates/dashboard-project.md +0 -19
  276. package/skills/direct/SKILL.md +0 -66
  277. package/skills/direct/references/request-signals.md +0 -59
  278. package/skills/doctor/SKILL.md +0 -299
  279. package/skills/doctor/report.md +0 -102
  280. package/skills/feedback/SKILL.md +0 -98
  281. package/skills/feedback/references/transport-and-privacy.md +0 -65
  282. package/skills/feedback/report.md +0 -36
  283. package/skills/install/SKILL.md +0 -217
  284. package/skills/intent-continuing/SKILL.md +0 -154
  285. package/skills/intent-continuing/references/board-fill.md +0 -43
  286. package/skills/intent-continuing/references/boarding-matrix.md +0 -34
  287. package/skills/intent-continuing/references/context-management.md +0 -28
  288. package/skills/intent-continuing/references/liveness-ranking.md +0 -57
  289. package/skills/intent-creating/SKILL.md +0 -164
  290. package/skills/intent-creating/evals/evals.json +0 -72
  291. package/skills/intent-creating/references/lifecycle.md +0 -81
  292. package/skills/intent-creating/references/wikilinks.md +0 -8
  293. package/skills/intent-ending/SKILL.md +0 -176
  294. package/skills/intent-ending/evals/evals.json +0 -74
  295. package/skills/intent-executing/SKILL.md +0 -170
  296. package/skills/intent-executing/evals/evals.json +0 -66
  297. package/skills/intent-executing/implementer-prompt.md +0 -42
  298. package/skills/intent-executing/spec-reviewer-prompt.md +0 -27
  299. package/skills/intent-speccing/SKILL.md +0 -130
  300. package/skills/intent-speccing/evals/evals.json +0 -126
  301. package/skills/intent-speccing/references/design-principles.md +0 -44
  302. package/skills/intent-speccing/references/per-section-fill-rules.md +0 -92
  303. package/skills/intent-speccing/references/self-verify-checklist.md +0 -37
  304. package/skills/project-creating/SKILL.md +0 -162
  305. package/skills/project-creating/references/hubs-projects.md +0 -55
  306. package/skills/project-creating/references/project-scaffolding.md +0 -97
  307. package/skills/releasing/SKILL.md +0 -337
  308. package/skills/releasing/references/deprecations.md +0 -60
  309. package/skills/releasing/references/promotion-and-tagging.md +0 -66
  310. package/skills/releasing/references/release-lines.md +0 -105
  311. package/skills/roadmap/SKILL.md +0 -64
  312. package/skills/roadmap/references/file-format.md +0 -124
  313. package/skills/roadmap/references/operations.md +0 -112
  314. package/skills/rollback/SKILL.md +0 -91
  315. package/skills/tutorial/SKILL.md +0 -65
  316. package/skills/tutorial/evals/evals.json +0 -186
  317. package/skills/uninstall/SKILL.md +0 -75
  318. package/skills/update/SKILL.md +0 -126
  319. /package/{skills/auto/references → docs/help}/agent-report-contract.md +0 -0
  320. /package/{skills/intent-executing → docs/help}/code-quality-reviewer-prompt.md +0 -0
  321. /package/{skills/conventions/references → docs/help}/lifecycle-and-savepoints.md +0 -0
  322. /package/{skills/intent-executing → docs/help}/plan-reviewer-prompt.md +0 -0
@@ -1,28 +0,0 @@
1
- # Context Management (Save, then resume-flow debugging)
2
-
3
- ## Save Point
4
- Triggered by PreCompact hook or manually:
5
- 1. Find active intent(s) from `~/.plastic/INDEX.md`
6
- 2. Update active intent's `checklist.md` (check off completed items)
7
- 3. Update active intent's `savepoint.md` (in-progress, next steps, blockers, discoveries)
8
- 4. Add observations to `## Insights`
9
- 5. Update INDEX.md
10
- 6. Commit: `cd ~/.plastic && git add . && git commit -m "chore: savepoint - [intent name]"`
11
- 7. Notify user to `/clear`
12
-
13
- ## Debugging the resume flow
14
-
15
- When a resume looks wrong (the announced stage does not match what is on disk, or the next
16
- step looks stale):
17
-
18
- 1. Read `savepoint.md`'s last line directly; that line alone is the source of truth for stage
19
- (see `SKILL.md`'s `## Conditional Ledger-Resume` for the full state table).
20
- 2. Confirm the artifact that line implies (`plan.md`, `checklist.md`, `outcome.md`, ...) is
21
- present and non-empty on disk.
22
- 3. If the two disagree, the ledger is stale: rebuild it rather than hand-editing:
23
- `ruby -r ~/.plastic/scripts/lib/savepoint -e 'Savepoint.rebuild_savepoint("<intent_dir>")'`
24
- 4. Re-read the rebuilt last line and re-derive the next step from `checklist.md`'s first
25
- unchecked item.
26
-
27
- The general "land on the board / priority order / stale future intents" flow now lives in
28
- `plastic-intent-continuing`; this file no longer duplicates it.
@@ -1,57 +0,0 @@
1
- # Liveness Ranking (read time, no new field)
2
-
3
- Depth reference for "Find the mid-flight roadmap" in `SKILL.md`. This is the full algorithm the
4
- body summarizes. Since intent 148, this algorithm is IMPLEMENTED in
5
- `scripts/lib/roadmap_queue.rb` behind the `scripts/roadmap-next` CLI; it is no longer a by-eye
6
- procedure. This page documents what that reader does, and is the specification the reader
7
- satisfies.
8
-
9
- ## Why read-time, not a stored field
10
-
11
- INDEX.md stays the sole writer of intent status; the roadmap file mirrors it (see
12
- `plastic-roadmap`'s `references/file-format.md`). Adding a "mid-flight" flag to the roadmap
13
- file or to INDEX.md would create a second thing to keep in sync for a question that is cheap to
14
- answer by reading what is already there. So liveness is computed fresh, every call, from the
15
- tier's live `roadmaps/*.md` files (excluding `roadmaps/archived/`), by `RoadmapQueue` (intent
16
- 148) rather than by eye.
17
-
18
- ## The algorithm
19
-
20
- 1. **Enumerate.** List every `roadmaps/*.md` at the tier (project or global), skipping
21
- `roadmaps/archived/`.
22
- 2. **Delivering/blocked wins outright.** If any candidate roadmap has at least one grouping-section
23
- entry (`## Batches`, or legacy `## Waves`) whose mirrored status token is `delivering` or
24
- `blocked`, it is in flight right now.
25
- That candidate wins the ranking immediately; skip the rest of the ranking for it.
26
- 3. **Otherwise, newest `## Log` entry wins.** Among the remaining candidates (none have a
27
- `delivering`/`blocked` entry), read each file's last `## Log` line (append-only, newest at
28
- the bottom) and rank by that line's `YYYY-MM-DD HH:MM UTC` timestamp. The most recent wins.
29
- When a candidate's paired `roadmaps/<slug>.savepoint.md` (intent 134) is present, its last
30
- line is a cheaper, machine-timestamped read of the same fact (the ledger is derived from `##
31
- Log`, so the two should already agree); reading it first is an optimization, not a second
32
- source of truth, so a missing or stale ledger never blocks falling back to `## Log` itself.
33
- 4. **Genuine tie -> present, do not silently pick.** If two or more candidates are equally live
34
- (for example two roadmaps both idle with `## Log` entries on the same timestamp, or two both
35
- showing `delivering` entries with no other signal to separate them), do not choose for the
36
- user. Present both/all tied candidates' state side by side, then let the single "auto or
37
- guided?" ask (asked once regardless of how many candidates were presented) double as the
38
- resolution: the user's answer implicitly picks by naming which roadmap to continue, or the
39
- agent asks a short one-line disambiguation immediately before that same single ask, never a
40
- second separate prompt.
41
-
42
- ## What this closes
43
-
44
- Before this skill existed, nothing resumed a mid-flight roadmap automatically. The `171`
45
- (consistency-dividend) roadmap handoff had to be resumed by hand: a free-prose "SESSION
46
- HANDOFF" note written into `171`'s own `## Insights`, because nothing read the grouping section
47
- (`## Batches`/legacy `## Waves`) + `## Log` and reconstructed where the batch stood. This ranking, now a deterministic reader
48
- rather than a by-eye judgment, is the mechanism that replaces that hand-carried note.
49
-
50
- ## Grammar pointer (do not duplicate)
51
-
52
- The roadmap file's four sections, entry line shape, and status vocabulary
53
- (`queued|delivering|delivered|abandoned|blocked`) are owned by `plastic-roadmap`:
54
- `skills/roadmap/references/file-format.md` for the shape, and
55
- `skills/roadmap/references/operations.md#read--consume` for how a reader (human or
56
- coordinator) is meant to walk `## Batches` (or legacy `## Waves`) and `## Log`. This page assumes that grammar and adds
57
- only the liveness-ranking judgment on top of it.
@@ -1,164 +0,0 @@
1
- ---
2
- name: plastic-intent-creating
3
- description: Use when new work begins, the user expresses a new goal, says "new intent", or no active intent exists for the current task. Creates intents in the global store (~/.plastic/store/) or in a project's store (~/.plastic/projects/{slug}/store/) depending on context.
4
- user-invocable: true
5
- ---
6
-
7
- # Creating an Intent
8
-
9
- ## When to Use
10
- - User starts new work ("build X", "fix Y", "research Z")
11
- - No active intent matches the current task
12
- - User explicitly says "new intent" or "create intent"
13
- - An agent discovers work needed during implementation
14
-
15
- ## Determine the store
16
-
17
- **Global intent** (strategic): created when working outside a registered project, or when the user expresses a high-level goal. Stored in `~/.plastic/store/`.
18
-
19
- **Project intent** (tactical): created when working inside a registered project directory. Stored in `~/.plastic/projects/{slug}/store/`. Automatically linked to the project's governing intent.
20
-
21
- ### Detection logic:
22
- 1. Read `~/.plastic/projects.yml`
23
- 2. **CWD match:** Match CWD against registered project paths
24
- - If CWD is inside a registered project → **project intent (tactical)**
25
- 3. **Explicit mention:** User mentions an existing project by name ("add this to reddit-kb", "new intent for plastic")
26
- - Look up project in `projects.yml` by slug
27
- - If found → **project intent (tactical)** in that project's store at `~/.plastic/projects/{slug}/store/`
28
- - Agent changes working directory to the project path for execution
29
- 4. **No match:** CWD is not in a project AND no project mentioned
30
- - → **global intent (strategic)** in `~/.plastic/store/`
31
-
32
- When creating a tactical intent in a project store:
33
- - Read the project's `AGENTS.md` for project context and decisions
34
- - Link back to the project's governing intent (from `projects.yml` `parent` field) via `sources` (the project genuinely is formed from its founding intent, a true formative edge, reciprocated on the founding intent's `chain`)
35
- - Add `[[global:<parent_ID>]]` backlink in `## Links`
36
- - The intent's Folgezettel ID is scoped to the project store (run `folgezettel-id` against the project's store at `~/.plastic/projects/{slug}/store/`)
37
-
38
- ## Workflow
39
-
40
- ### 1. Determine Store Location
41
-
42
- - **Global:** `~/.plastic/store/`
43
- - **Project:** `~/.plastic/projects/{slug}/store/`
44
-
45
- ### 2. Check for a Duplicate or Predecessor (QMD-first)
46
-
47
- QMD-first (when available): before scanning the store with grep/Read, run
48
- `ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or duplicate
49
- intents, then open the authoritative intent file for any hit you act on. The command is a no-op
50
- when QMD is absent, so fall back to the existing INDEX.md / file scan. Do this before allocating
51
- the id so a near-duplicate can be reused and a true predecessor can be set in `--sources`.
52
-
53
- ### 3. Decide Branch vs Root
54
-
55
- Decide this BEFORE scaffolding, because it sets whether you pass `--parent`.
56
- Having a "parent" in mind does NOT automatically mean branch. Choose by meaning:
57
-
58
- - **Branch (`14a`, `14b`)**: a sub-task, refinement, or direct continuation. It only
59
- makes sense as part of the parent's work. Pass `--parent <parent_id>`.
60
- - **Root (`15`, `16`)**: an independent thought. Two cases, decided by ORIGIN:
61
- - **Created from another intent** (it emerged from that intent's lifecycle): make it a
62
- root and set `--sources <ascendant_id>`. `sources` is reserved for true created-from /
63
- direct-ascendant provenance (D1).
64
- - **Merely related to / inspired by another intent** (it did NOT come out of that
65
- intent's lifecycle): carry NO `--sources`. Record the relation on the PREDECESSOR's
66
- `chain` instead (the related-but-not-spawned rule); the `## Links` section follows
67
- from that edge, you do not write it by hand.
68
- - **Rule of thumb:** if the intent could exist without its parent, make it a root; only set
69
- `--sources` when it was genuinely created from / emerged from that intent's lifecycle.
70
- Topic similarity alone is not a `sources` edge.
71
-
72
- When a branch intent exists because a late ruling arrived AFTER its parent was already
73
- completed (the owner's late-ruling rule), the parent is restored to v1 via
74
- `scripts/restore-intent-v1`, never by a hand-run `git checkout`/revert. See
75
- `plastic-conventions > references/maintenance-and-revisions.md`, WORK vs MAINTENANCE, for the
76
- rule and the tool.
77
-
78
- `## Links` is a DERIVED view of `sources`/`chain`. Never hand-write a `## Links` line; add the
79
- frontmatter edge and reproject. Links are decided by context influence (a `chain` edge has a high
80
- bar: the candidate's context must materially help deliver this intent), not by shared files or a
81
- similarity score. To gather candidates with their context and record an edge, use the
82
- `scripts/link-suggest` and `scripts/project-links`.
83
-
84
- Read `../plastic-conventions/references/knowledge-graph.md` for the full linking doctrine: the
85
- tiers of influence, sources versus chain, and how the `## Links` projection is derived. This path
86
- resolves relative to this skill's own installed directory.
87
-
88
- ### 4. Determine Intent Properties
89
-
90
- Ask or infer from context:
91
- - **intent**: one-line description
92
- - **slug**: short hyphenated handle for the directory name
93
- - **author**: `human` | `claude-code` | other agent name
94
- - **sources**: the direct ascendant(s) this intent was created from / emerged from the
95
- lifecycle of (formation, not topic similarity), e.g., `4a1`. For a project intent,
96
- include the governing intent's id. A branch's structural parent is ALSO recorded in
97
- `sources` (the ID carries it for the human/paper tree, `sources` carries it for
98
- software), which `new-intent` does automatically (see `new-intent:126`).
99
- - **tags**: freeform list (use `project-<name>` for project membership)
100
-
101
- `chain` carries what this intent spawns AND related-but-not-spawned successors it leads to;
102
- it starts empty and is populated later. See
103
- [`how-plastic-sources-and-chains-intents.md`](https://github.com/zalom/plastic/blob/main/docs/concepts/how-plastic-sources-and-chains-intents.md) for the full model.
104
- Place the intent in `## Active` or `## Future` in INDEX.md (status is
105
- convention-derived, not a frontmatter field).
106
-
107
- ### 5. Scaffold via new-intent (single call)
108
-
109
- Delegate id allocation, directory and file creation, the born-complete intent
110
- file, the sentinel placeholder lifecycle files, the reciprocal file links, and
111
- self-validation to one `new-intent` invocation. Do NOT hand-author any of these
112
- files.
113
-
114
- ```bash
115
- ruby ~/.plastic/scripts/new-intent \
116
- --store "<STORE>" --intent "<one-line>" --slug "<slug>" \
117
- [--parent "<parent_id>"] [--author "<author>"] \
118
- [--sources "id,id"] [--tags "project-<slug>,tag"]
119
- ```
120
-
121
- `new-intent` allocates the Folgezettel id (root, or a branch of `--parent`),
122
- creates `<STORE>/<id>--<slug>/` plus `actions/` and `resources/`, renders the
123
- born-complete `<id>--<slug>.md` from the intent template, writes the sentinel
124
- placeholder `spec.md`/`plan.md`/`checklist.md`/`outcome.md` (each marked
125
- `<!-- plastic:placeholder -->` so no stage detector reads them as reached), wires
126
- the reciprocal `[[id]]` links, and self-validates (frontmatter plus the sanctioned
127
- `##` sections). It prints the created directory path and exits 0.
128
-
129
- It does NOT touch INDEX.md, git, or project creation: those stay in this skill
130
- (steps 6 to 9 below).
131
-
132
- If `new-intent` exits non-zero, read the stderr report and fix the inputs (slug,
133
- intent, sources). Do not commit or announce an intent that did not scaffold
134
- cleanly, and do not work around the failure by hand-writing the files.
135
-
136
- ### 6. If Implementation Intent Spawns a Project
137
-
138
- When the user says "start building" or the plan calls for a new project, invoke the
139
- `plastic-project-creating` skill; it owns project directory creation, AGENTS.md
140
- population, projects.yml registration, store provisioning, and the auto-commit of
141
- both stores. Add `project-<slug>` to this intent's `tags` array either before
142
- invoking it or as part of that skill's handoff.
143
-
144
- ### 7. Update INDEX.md
145
-
146
- - **Global intents:** update `~/.plastic/INDEX.md`
147
- - **Project intents:** no global INDEX.md change (tactical intents are project-scoped)
148
-
149
- Add to `## Active` (or `## Future`) and appropriate cluster.
150
-
151
- ### 8. Auto-commit
152
-
153
- ```bash
154
- cd <store-root> && git add . && git commit -m "feat: create intent ID - [name]"
155
- ```
156
-
157
- ### 9. Announce
158
-
159
- "Created intent ID - [name]. Placed in: [Active|Future]. Store: [global|project:<slug>|local]."
160
-
161
- ## References
162
-
163
- - Read `references/lifecycle.md` for the full What→Why→How→Exec stage detail, filesystem-as-schema conventions, and creating-intent step-by-step
164
- - Read `references/wikilinks.md` for the wikilink syntax table when adding `## Links` to intents
@@ -1,72 +0,0 @@
1
- {
2
- "skill_name": "plastic-intent-creating",
3
- "notes": "Intent 68. Scope: output-quality for the sources-vs-chain construction rules (D1/D2). Asserts the related-but-not-spawned case produces NO sources plus a predecessor chain link and a ## Links mirror, contrasted with the created-from case (true ascendant -> --sources set, reciprocal chain). The machine-checkable half lives in test/new_intent_test.rb (test_sources_path_gets_child_in_chain_frontmatter); this file documents the agent-facing scenario for skill evaluation and is NOT run by bin/test.",
4
- "evals": [
5
- {
6
- "id": 1,
7
- "scope": "behavior",
8
- "set": "train",
9
- "prompt": "Create an intent for adding a retry policy to the uploader. It's related to intent 41 (the upload pipeline work) but it's independent: it did not come out of intent 41's lifecycle.",
10
- "expected_output": "A new root intent is created with EMPTY sources (it was not created from 41). The relation is recorded on the PREDECESSOR: intent 41 gains the new intent's id in its frontmatter chain, and a [[<new-id>]] wikilink is added to intent 41's ## Links. The new intent is NOT given 41 in --sources (the related-but-not-spawned rule). No false symmetry: 41 keeps the new id on chain with no reciprocal sources.",
11
- "files": [],
12
- "assertions": [
13
- {
14
- "type": "code",
15
- "check": "new intent sources is empty",
16
- "observed": "sources: []",
17
- "result": "pass"
18
- },
19
- {
20
- "type": "code",
21
- "check": "predecessor 41 chain includes new id",
22
- "observed": "41.chain includes <new-id>",
23
- "result": "pass"
24
- },
25
- {
26
- "type": "code",
27
- "check": "predecessor 41 ## Links has [[<new-id>]] mirror",
28
- "observed": "[[<new-id>]] present in 41 ## Links",
29
- "result": "pass"
30
- }
31
- ]
32
- },
33
- {
34
- "id": 2,
35
- "scope": "behavior",
36
- "set": "validation",
37
- "prompt": "Create an intent that is the direct continuation of intent 41: it emerged from intent 41's lifecycle and could not exist without it.",
38
- "expected_output": "Because the new intent was genuinely CREATED FROM 41 (D1), it carries 41 in --sources (or branches from 41, which folds 41 into sources via the redundant-explicit rule). The reciprocal I1 backlink lands: intent 41's frontmatter chain gains the new intent's id. This is the created-from case, contrasted with the related-but-not-spawned case in eval 1.",
39
- "files": [],
40
- "assertions": [
41
- {
42
- "type": "code",
43
- "check": "new intent sources includes 41",
44
- "observed": "sources includes 41",
45
- "result": "pass"
46
- },
47
- {
48
- "type": "code",
49
- "check": "predecessor 41 chain includes new id (I1 reciprocity)",
50
- "observed": "41.chain includes <new-id>",
51
- "result": "pass"
52
- }
53
- ]
54
- },
55
- {
56
- "id": 3,
57
- "scope": "behavior",
58
- "set": "validation",
59
- "prompt": "QMD is present. The user says: create an intent to add retry to the uploader.",
60
- "expected_output": "Before allocating the id / scaffolding, runs `ruby ~/.plastic/scripts/qmd-sync search \"add retry to the uploader\"` to surface a near-duplicate or true predecessor, then opens the authoritative intent file for any hit (reusing a near-duplicate or setting a real predecessor in --sources). No-op fallback to INDEX.md / file scan when QMD is absent.",
61
- "files": [],
62
- "assertions": [
63
- {
64
- "type": "human",
65
- "check": "qmd-sync search is run before id allocation; authoritative file opened for any hit; informs reuse / --sources",
66
- "observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
67
- "result": "pass"
68
- }
69
- ]
70
- }
71
- ]
72
- }
@@ -1,81 +0,0 @@
1
- # Building an Intent — Full Lifecycle Detail
2
-
3
- ## What → `## Intent` section
4
-
5
- The desire. One paragraph. What the human or agent wants.
6
- This exists from the moment the intent is created.
7
-
8
- **Deliverable:** `{ID}--{slug}.md`
9
-
10
- ## Why → `## Context` + `### Decisions` sections
11
-
12
- Why this intent exists. Grows over time through brainstorming and exploration.
13
-
14
- - **Context** — what we knew going in + what we decided along the way
15
- - **Decisions** — main premises derived from Context plus decisions from brainstorming/grilling
16
- - Decisions are Why-level: "status belongs on actions because multiple workstreams", not How-level: "use ACTION_N.md files"
17
-
18
- **Deliverable:** `spec.md` (consolidated specification from Context + Decisions + brainstorming)
19
-
20
- ## How → Planning and preparation
21
-
22
- Research decisions, create the implementation plan, define actions.
23
-
24
- **Deliverable:** `plan.md` + `actions/` + `checklist.md` (execution registry with checkboxes covering all actions)
25
-
26
- ## Exec → Execute actions
27
-
28
- Execute actions from the plan, track progress via checklist.
29
-
30
- **Deliverable:** `outcome.md` (detailed result). `## Outcome` in intent.md = short summary written as last step.
31
-
32
- ## `## Insights` — Append-only work log
33
-
34
- Captured throughout ALL stages. One-liner bullet points.
35
- Never modified, only appended.
36
-
37
- Tracks: stage transitions, decisions, shifts, blocks, cancellations, material for future intents.
38
- This is how execution is tracked. When this intent completes, Insights
39
- is where to look for what comes next. New intents spawned from this one,
40
- plus related-but-not-spawned successors it leads to, appear in the `chain`
41
- field.
42
-
43
- ## `## Links`
44
-
45
- The human-readable projection of the local knowledge graph, mirroring the
46
- frontmatter exactly. Each entry is `- [[id--slug|<target's full intent: text>]]`,
47
- a clickable `id--slug` wikilink target with the target intent's full `intent:`
48
- text as the label (cross-store targets render
49
- `- [[store:id--slug|<target's full intent: text>]]`). Ordering is mandatory: all
50
- `sources` first (top), then all `chain`, frontmatter order preserved within each
51
- group. Sources never appear at the end. No source/chain tags, no sub-grouping. An
52
- intent with empty `sources` and `chain` carries the empty-state comment. Counterpart
53
- to the frontmatter `sources` / `chain` edges, for Obsidian graph navigation.
54
-
55
- ## Conventions — Filesystem as Schema
56
-
57
- State is derived from what exists, not from what's declared.
58
-
59
- | Convention | Signal |
60
- |---|---|
61
- | No `## Context` | Intent is fleeting (quick capture, non-actionable) |
62
- | `## Context` has content | Intent is permanent (developed, actionable) |
63
- | `## Outcome` has content | Intent is done |
64
- | `## Insights` has `(autonomous)` entries | Intent is/was being delivered autonomously |
65
-
66
- ### Transitions
67
-
68
- - Fleeting → permanent: add `## Context` (one-way, also makes it actionable)
69
- - There is no separate "non-actionable → actionable" transition — permanence implies actionability
70
- - Even research intents are actionable: the research itself is the action, the conclusion is the outcome
71
-
72
- ## Creating an Intent — Full Steps
73
-
74
- 1. Determine the target store: `~/.plastic/store/` for global intents (default), `~/.plastic/projects/{slug}/store/` for project intents
75
- 2. Decide branch vs root (this sets whether you pass `--parent`)
76
- 3. Scaffold with one call: `ruby ~/.plastic/scripts/new-intent --store <store> --intent "<one-line>" --slug <slug> [--parent <id>] [--sources id,id] [--tags ...]`. This allocates the id, creates the directory plus `actions/` and `resources/`, renders the born-complete intent file (frontmatter plus `## Intent`, `## Context`, `## Outcome`, `## Insights`, `## Links`), writes the sentinel placeholder lifecycle files, wires the reciprocal links, and self-validates.
77
- 4. Update the appropriate `INDEX.md` — add to Active section and appropriate cluster
78
-
79
- The intent file is born complete with all five sanctioned `##` sections; the lifecycle files (`spec.md`/`plan.md`/`checklist.md`/`outcome.md`) are sentinel placeholders that read as "stage not reached" until an agent fills them and deletes the `<!-- plastic:placeholder -->` first line.
80
-
81
- Always scaffold through `new-intent` (or this skill). Never hand-author intent files: `new-intent` validates the file it writes (`scripts/validate-intent`) and `end-intent` checks it again at close, and hand-authoring is the bypass this contract is designed to remove.
@@ -1,8 +0,0 @@
1
- # Wikilink Conventions
2
-
3
- | Syntax | Meaning |
4
- |--------|---------|
5
- | `[[ID]]` | Link to intent in same store (e.g., `[[1a1]]`) |
6
- | `[[ID\|display text]]` | Link with human-readable label |
7
- | `[[global:ID]]` | Link to intent in `~/.plastic/store/` |
8
- | `[[project-slug:ID]]` | Link to intent in `~/.plastic/projects/{slug}/store/` |
@@ -1,176 +0,0 @@
1
- ---
2
- name: plastic-intent-ending
3
- description: >
4
- Wrap, finish, close, or mark an intent Done, delivered or abandoned. Use
5
- when completing or abandoning an intent, when a checklist reaches 100
6
- percent and Exec is finished, or when asked to "wrap this up".
7
- user-invocable: true
8
- ---
9
-
10
- # Intent Ending
11
-
12
- The one procedure every terminal transition routes through. Auto mode, the
13
- curator path, and releasing all call this skill (or its backing script,
14
- `scripts/end-intent`) for the mechanical close instead of restating the same
15
- prose three times. `abandoned` is the SAME procedure as `delivered`, not a
16
- failure branch: only outcome.md content and the INDEX section differ.
17
-
18
- Read `../plastic-conventions/references/completion-and-done.md` for what "intent done" means and
19
- the End-stage tail behind the steps below. This path resolves relative to this skill's own
20
- installed directory.
21
-
22
- ## The 8 steps (0-7)
23
-
24
- | # | Step | Who does it |
25
- |---|---|---|
26
- | 0 | Precondition check | You, before touching outcome.md |
27
- | 1 | backfill spec/plan/action/outcome from the record, self-check, intent-file `## Outcome` summary | `scripts/end-intent` |
28
- | 2 | INDEX.md terminal move (Active -> Completed/Abandoned) | `scripts/end-intent` |
29
- | 3 | savepoint `Done` bookend | `scripts/end-intent` |
30
- | 4 | store auto-commit | `scripts/end-intent` |
31
- | 5 | disarm (worktree + lock) | `scripts/end-intent` (intent 188) |
32
- | 6 | QMD reindex, async, LAST | You |
33
- | 7 | EM-to-CTO report | You |
34
-
35
- Steps 1-5 are ONE callable script call, not several separate one-liners: this
36
- is exactly what the failure mode this intent fixes looked like (releasing hand
37
- authored the close in prose and dropped the savepoint bookend for two real
38
- deliveries; separately, one session delivered four intents back to back and
39
- never ran the old step-5 one-liner at all, intent 188). Never restate
40
- outcome/INDEX/savepoint/disarm prose inline again; call `scripts/end-intent`.
41
-
42
- ### Step 0. Precondition (the record is what gets backfilled)
43
-
44
- Nothing refuses the close any more (the 1.x write-time gate and `end-intent`'s
45
- exit-6 structure gate were retired in 2.0, intents 302 and 308). What you leave
46
- on disk is what the record becomes, so before the call:
47
-
48
- 1. Read checklist.md. Tick every item as it is actually performed, including
49
- an item that describes the close itself: running this very procedure IS
50
- what that item describes. An unchecked box is not a refusal, it is a
51
- reported gap that lands verbatim in the backfilled `## Follow-ups`.
52
- 2. Confirm every acceptance criterion in spec.md is verifiable (tests pass,
53
- or the manual check described in its HOW line was actually run).
54
- 3. Decide what you have to say. A spec.md, plan.md, action file, or outcome.md
55
- left as the scaffold placeholder is written from the record by
56
- `scripts/end-intent` (the intent file's `## Intent`, `### Decisions`, and
57
- `## Insights`, the checklist, the diff on the intent's own worktree). A
58
- file you wrote, even under a still-present sentinel, is never touched.
59
- Write outcome.md yourself when the summary deserves more than the
60
- `--outcome-summary` line; otherwise let the backfill carry it.
61
-
62
- ### Step 1-5. Run `scripts/end-intent`
63
-
64
- Author outcome.md yourself when it deserves prose: copy `templates/outcome.md`,
65
- set the frontmatter to `disposition: delivered` or `disposition: abandoned`, and
66
- fill `## Summary`, `## Delivered`, `## Verification`, `## Follow-ups`. `## Delivered` is a
67
- `| Row | What |` table: one row per thing delivered, in plain wording a reader
68
- recognizes, not a method name or an implementation summary (that detail
69
- belongs in `## Summary`). Each row's label must appear as a standalone token
70
- in an action-file heading (`### S1 - ...` proves row S1); that heading's
71
- matrix rows become the row's Proven-by cell on `report-screen delivered`'s
72
- post-delivery screen. `## Needs you` is the literal None or a
73
- `| N | What | Why |` table. On abandon, `## Summary` states the abandonment reason and the trail (see Pivot
74
- below). A placeholder outcome.md is backfilled from the record instead, with the
75
- close's disposition and the `--outcome-summary` line as its summary. Also author
76
- the rich INDEX entry note now (a short line in the store's existing
77
- Completed/Abandoned convention: mode, what shipped or why it was
78
- abandoned, suite result, merge/spawn notes); content authoring stays with
79
- you, `--index-note` only appends what you write.
80
-
81
- Then call the script once:
82
-
83
- ```bash
84
- ruby ~/.plastic/scripts/end-intent \
85
- --store <store_path> --id <intent_id> --disposition delivered|abandoned \
86
- --session "$CLAUDE_CODE_SESSION_ID" \
87
- --outcome-summary "<one-line ## Outcome summary for the intent file>" \
88
- --index-note "<rich Completed/Abandoned entry description>"
89
- ```
90
-
91
- This does all of steps 1-5 in order: backfills every missing or placeholder
92
- spec.md, plan.md, action file, and outcome.md from the record (never a file
93
- you wrote), runs doctor's per-intent structure check and the outcome guard as
94
- a self-check that reports on stderr and proceeds (an unchecked box, a
95
- malformed intent file, a wrong-disposition outcome.md you wrote), stamps the
96
- intent file's `## Outcome` section, moves the INDEX.md
97
- line from `## Active` to `## Completed` or `## Abandoned` (dated today,
98
- idempotent, accepting either a real em dash or a plain hyphen as the id/
99
- title separator on read while always emitting the real em dash on write)
100
- with the `--index-note` text appended after the date so the entry stays
101
- rich, appends the savepoint `Done` bookend, commits the store repo, and
102
- disarms (releases the code worktree and clears `delivery.lock`, verified
103
- against the durable lock file on disk, never merely trusted). Omit
104
- `--index-note` for a thin id+date entry, add `--no-commit` when a separate
105
- commit step already covers the store (this never skips disarm), and
106
- `--dry-run` to preview steps 1-5 with no writes.
107
-
108
- A pre-flight lock guard runs before anything is written: it resolves the
109
- calling session (`--session`, else `CLAUDE_CODE_SESSION_ID`, else the
110
- existing lock's own recorded owner, else a no-op) and checks it against any
111
- existing `delivery.lock`. A live foreign session refuses the whole run
112
- (exit 4, nothing written); a stale foreign lock is reclaimed automatically
113
- (audited to savepoint.md) and the run proceeds as the new owner. Before
114
- removing the worktree, step 5 also refuses on an unexpectedly dirty code
115
- worktree (exit 5, naming the worktree path) rather than force-discarding
116
- uncommitted changes; pass `--discard-worktree-changes` only when you mean
117
- to override that deliberately.
118
-
119
- On the auto mode / curator path (no release), this single call performs the
120
- FULL disarm (plain worktree remove, since the branch survives for later
121
- reclaim). On a release-shipped path, `skills/releasing/SKILL.md` merges and
122
- removes the worktree FIRST (its own step 8, merge-then-remove) before ever
123
- calling this script, so by the time this call's step 5 runs, the worktree is
124
- already gone (a harmless no-op) and only the lock is left to clear,
125
- correctly, for the first time on that path (D7).
126
-
127
- Exit codes: 0 success (the intent is closed AND its delivery lock is gone);
128
- 1 a usage or resolution failure, OR an INDEX id that resolves to neither
129
- `## Active` nor the terminal section; 3 steps 1-4 already committed
130
- but disarm could not verify the lock is gone afterward (run `/plastic-doctor
131
- check the lock status`); 4 a live foreign session holds the lock (back off);
132
- 5 the code worktree is dirty (commit/stash first, or pass
133
- `--discard-worktree-changes` deliberately).
134
-
135
- ### Step 6. QMD reindex, LAST
136
-
137
- Only after step 5 has released the worktrees and cleared the lock, so the
138
- index never references state about to disappear:
139
-
140
- ```bash
141
- ruby ~/.plastic/scripts/qmd-sync reindex --store <store-root> --async
142
- ```
143
-
144
- No-op when QMD is absent. Runs in the background so it never blocks the
145
- turn.
146
-
147
- ### Step 7. EM-to-CTO report
148
-
149
- Brief the human like an engineering manager to a CTO: impact and risk first,
150
- in plain language, the decision left to them (merge, release, or accept).
151
- See `outcome.md` for the details; do not restate it verbatim.
152
-
153
- ## Abandoned is the same procedure
154
-
155
- `disposition: abandoned` runs the identical steps 0-7. The only differences
156
- are outcome.md content (Summary states why this was abandoned, not what was
157
- delivered) and the INDEX target section (`## Abandoned` instead of
158
- `## Completed`). Never branch the mechanical steps by disposition; the
159
- script already does that internally.
160
-
161
- ## Mid-flight pivot
162
-
163
- When the work that shipped differs from what spec.md or plan.md originally
164
- called for, do not retcon those documents. Record the decision once in
165
- `## Insights`, then let outcome.md carry the truth of what actually
166
- happened, including the abandoned trail when part of the work was dropped
167
- mid-flight. outcome.md is truth of delivery; spec and plan stay the
168
- historical record of what was planned.
169
-
170
- ## Routing
171
-
172
- `plastic-releasing`, `plastic-auto`, and `plastic-intent-executing` all delegate their mechanical
173
- close to this skill (or call `scripts/end-intent` directly for steps 1-5).
174
- None of them restate the outcome/INDEX/savepoint/disarm prose inline any
175
- more; if you find one that does, that surface has drifted and should route
176
- here instead.