@zalom/plastic 1.0.0-beta.9 → 1.0.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 (107) hide show
  1. package/PLASTIC-reference.md +133 -0
  2. package/PLASTIC.md +398 -82
  3. package/README.md +99 -82
  4. package/agents/plastic-brainstorming.md +12 -9
  5. package/agents/plastic-enforcer.md +52 -12
  6. package/agents/plastic-executor.md +10 -10
  7. package/agents/plastic-future-intent-researcher.md +4 -8
  8. package/agents/plastic-intent-curator.md +12 -14
  9. package/agents/plastic-intent-discovery.md +35 -0
  10. package/agents/plastic-planner.md +15 -10
  11. package/agents/plastic-spec-specialist.md +15 -10
  12. package/bin/plastic.js +7 -3
  13. package/hooks/code-gate +10 -1
  14. package/hooks/hooks.json +28 -3
  15. package/hooks/lock-gate +21 -0
  16. package/hooks/retrieval-gate +10 -0
  17. package/hooks/savepoint-pre +10 -0
  18. package/hooks/statusline +48 -6
  19. package/package.json +2 -1
  20. package/scripts/agent-report +21 -0
  21. package/scripts/dashboard.rb +98 -23
  22. package/scripts/doctor.rb +232 -5
  23. package/scripts/hook-auto-arm +1 -1
  24. package/scripts/hook-bash-gate +22 -4
  25. package/scripts/hook-code-gate +11 -6
  26. package/scripts/hook-continue +17 -0
  27. package/scripts/hook-create-gate +45 -9
  28. package/scripts/hook-gate-check +24 -23
  29. package/scripts/hook-lock-gate +83 -0
  30. package/scripts/hook-retrieval-gate +148 -0
  31. package/scripts/hook-savepoint-pre +32 -0
  32. package/scripts/hook-session-start +1 -1
  33. package/scripts/insight-append +51 -0
  34. package/scripts/install.rb +44 -7
  35. package/scripts/lib/agent_models.rb +43 -0
  36. package/scripts/lib/bridge.rb +924 -84
  37. package/scripts/lib/dashboard_banner.rb +42 -0
  38. package/scripts/lib/hook_registry.rb +95 -0
  39. package/scripts/lib/insights.rb +86 -0
  40. package/scripts/lib/installer_core.rb +100 -60
  41. package/scripts/lib/link_suggestions.rb +319 -0
  42. package/scripts/lib/lock.rb +375 -0
  43. package/scripts/lib/power_tools.rb +22 -21
  44. package/scripts/lib/preflight.rb +79 -0
  45. package/scripts/lib/qmd_sync.rb +15 -0
  46. package/scripts/lib/retrieval_gate.rb +211 -0
  47. package/scripts/lib/worktree.rb +384 -0
  48. package/scripts/link-suggest +213 -0
  49. package/scripts/new-intent +9 -1
  50. package/scripts/plastic-lock +164 -0
  51. package/scripts/read-config +4 -0
  52. package/scripts/spawn-preamble +11 -3
  53. package/scripts/update.rb +16 -7
  54. package/skills/auto/SKILL.md +126 -19
  55. package/skills/auto/references/agent-architecture.md +7 -4
  56. package/skills/auto/references/agent-report-contract.md +36 -1
  57. package/skills/auto/references/end-tail.md +56 -0
  58. package/skills/auto/references/human-report-contract.md +55 -0
  59. package/skills/auto/references/tiers.md +77 -0
  60. package/skills/brainstorming/SKILL.md +7 -34
  61. package/skills/brainstorming/references/design-principles.md +49 -0
  62. package/skills/continuing/SKILL.md +26 -7
  63. package/skills/creating-intent/SKILL.md +13 -28
  64. package/skills/creating-project/SKILL.md +11 -74
  65. package/skills/creating-project/references/project-scaffolding.md +97 -0
  66. package/skills/creating-skills/SKILL.md +65 -0
  67. package/skills/creating-skills/evals/evals.json +108 -0
  68. package/skills/creating-skills/references/agents.md +168 -0
  69. package/skills/creating-skills/references/evals.md +41 -0
  70. package/skills/creating-skills/references/hooks.md +248 -0
  71. package/skills/creating-skills/references/progressive-disclosure.md +176 -0
  72. package/skills/creating-skills/references/scripts.md +166 -0
  73. package/skills/creating-skills/references/skills.md +165 -0
  74. package/skills/creating-skills/scripts/scaffold.rb +313 -0
  75. package/skills/dashboard/SKILL.md +13 -11
  76. package/skills/dashboard/references/classification.md +22 -0
  77. package/skills/doctor/SKILL.md +10 -7
  78. package/skills/executing-plan/SKILL.md +4 -4
  79. package/skills/humanizer/SKILL.md +39 -0
  80. package/skills/humanizer/evals/evals.json +70 -0
  81. package/skills/humanizer/references/always-on-snippet.md +9 -0
  82. package/skills/humanizer/references/examples.md +48 -0
  83. package/skills/install/SKILL.md +75 -84
  84. package/skills/intent-curator/SKILL.md +5 -1
  85. package/skills/intent-discovery/SKILL.md +47 -0
  86. package/skills/intent-starting/SKILL.md +130 -0
  87. package/skills/intent-starting/evals/evals.json +117 -0
  88. package/skills/intent-starting/references/boarding-matrix.md +35 -0
  89. package/skills/linking-intents/SKILL.md +48 -12
  90. package/skills/lock/SKILL.md +41 -0
  91. package/skills/managing-index/SKILL.md +6 -0
  92. package/skills/releasing/SKILL.md +44 -29
  93. package/skills/releasing/references/promotion-and-tagging.md +60 -0
  94. package/skills/roadmap/SKILL.md +51 -0
  95. package/skills/roadmap/references/file-format.md +91 -0
  96. package/skills/roadmap/references/operations.md +78 -0
  97. package/skills/uninstall/SKILL.md +29 -11
  98. package/skills/update/SKILL.md +34 -23
  99. package/skills/versions/SKILL.md +27 -12
  100. package/skills/writing-plans/SKILL.md +10 -88
  101. package/skills/writing-plans/references/plan-format.md +102 -0
  102. package/templates/config.yml +8 -0
  103. package/templates/outcome.md +3 -0
  104. package/templates/revisions.md +58 -0
  105. package/templates/roadmap.md +30 -0
  106. package/skills/writing-instructions/SKILL.md +0 -159
  107. package/skills/writing-instructions/references/agentskills-spec.md +0 -135
@@ -0,0 +1,56 @@
1
+ # End-Tail Mechanics: resolve_session and Disarm Ordering
2
+
3
+ Deep WHY/mechanics detail behind two spots in `SKILL.md`: how `arm_auto` resolves a
4
+ session id when arming the gate, and why the End-tail steps in Completion (release
5
+ worktrees, clear the lock, purge the bridge, reindex) run in that exact order.
6
+
7
+ ## Table of Contents
8
+
9
+ - [resolve_session fallback internals](#resolve_session-fallback-internals)
10
+ - [Disarm ordering and worktree cleanup rationale](#disarm-ordering-and-worktree-cleanup-rationale)
11
+ - [QMD reindex ordering rationale](#qmd-reindex-ordering-rationale)
12
+
13
+ ## resolve_session fallback internals
14
+
15
+ `arm_auto` calls `resolve_session`, which picks the first non-empty of: the explicit
16
+ id you pass -> `CLAUDE_CODE_SESSION_ID` -> a deterministic derived key (a hash of the
17
+ store and intent id). It never returns nil, so the gate engages even when every
18
+ session env var is empty; the call never needs a non-empty session env var to
19
+ function. Arming prints a one-line notice to stderr when it falls through to the
20
+ derived key.
21
+
22
+ Arming acquires the durable `delivery.lock` in the intent dir, keyed by that resolved
23
+ session. Ownership is session-keyed, not process-keyed, so the arm one-liner exiting
24
+ immediately is fine by construction: the lock stays yours for every later tool call in
25
+ this session. A failed arm raises with a message naming the resolving `plastic-lock`
26
+ verb.
27
+
28
+ ## Disarm ordering and worktree cleanup rationale
29
+
30
+ Disarm runs the ordered End tail: it releases the worktrees first, then clears the
31
+ intent's `delivery.lock` (and the bridge's lock cache), and only then is the bridge
32
+ purge-eligible. Disarming also purges stale bridge files from the temp directory
33
+ automatically (it keeps the current bridge, any live run, and any bridge whose intent
34
+ still holds a delivery lock), so no manual `/tmp` cleanup is needed.
35
+
36
+ **Worktree cleanup (mandatory, intent 73c3).** Disarming performs the worktree release:
37
+ `disarm_auto` calls `Worktree.release`, which removes both per-intent worktrees (the code
38
+ worktree under `<repo>/.claude/worktrees/{id}--{slug}` and the paired store worktree under
39
+ `<plastic_home>/.worktrees/{id}--{slug}`), prunes both repos, and clears the worktree block
40
+ from the bridge. This is the plain remove path: the disarm route does NOT merge, so use it
41
+ only when no release merges the branch (the branch survives and can be reclaimed).
42
+
43
+ When the work is being shipped through a release, do NOT rely on this plain remove. The
44
+ release path (Completion step 4, via `plastic-releasing`) is responsible for merging the
45
+ intent's code branch (`plastic/{id}--{slug}`) back to the repo's default branch BEFORE the
46
+ worktree is removed, so the integrated work is not lost. It does this with
47
+ `Worktree.finish(bridge_data, merge: true)` (merge-then-remove). Never leave an orphaned
48
+ worktree, and run `git worktree prune` if you hit a stale reference.
49
+
50
+ ## QMD reindex ordering rationale
51
+
52
+ Completion is the lifecycle event that keeps the search index fresh. `<store-root>` is
53
+ the store that holds this intent (the global store or the project store). The reindex is
54
+ the LAST End-tail step, run after purge, so the index never references a bridge or lock
55
+ that is about to disappear (see PLASTIC.md `## Delivery Isolation and the Single-Owner
56
+ Lock`).
@@ -0,0 +1,55 @@
1
+ # Human Report Contract (per-stage EM-to-CTO briefing)
2
+
3
+ This doc defines how the orchestrator briefs the human at each of the five stage boundaries
4
+ (What, Why, How, Exec, Done) in auto mode. It is the outward, human-facing counterpart to the
5
+ internal report contract in `references/agent-report-contract.md`. Voice: an engineering
6
+ manager briefing a CTO. Lead with impact, name the risk, leave the decision.
7
+
8
+ ## The skeleton
9
+
10
+ One fixed 3-line shape, reused at every stage:
11
+
12
+ 1. **State**: what happened and what it means, impact first, one line.
13
+ 2. **Risk**: the one thing that could bite, or "nothing flagged."
14
+ 3. **Call**: the decision left to you, or the go-ahead I am taking.
15
+
16
+ This is a shape, not a rigid template. Keep the order (State, then Risk, then Call) and keep it
17
+ short. The words can flex to fit the stage.
18
+
19
+ ## Per-stage content
20
+
21
+ - **What**: State = the work I picked up and why it matters now. Risk = scope uncertainty.
22
+ Call = confirm this is worth doing, or I proceed.
23
+ - **Why**: State = the approach I chose, one line. Risk = the main trade-off. Call = the one
24
+ decision I need (approve, or pick an option).
25
+ - **How**: State = the plan shape (task count and what it builds). Risk = the riskiest task or
26
+ dependency. Call = approve the plan to build.
27
+ - **Exec**: State = what got built and the test result. Risk = residual failures or deviations.
28
+ Call = go to review, or done.
29
+ - **Done**: State = the delivered impact. Risk = residual risk. Call = the decision left to you
30
+ (merge, release, accept).
31
+
32
+ ## Boundary vs intent 74
33
+
34
+ Intent 74's report contract (`references/agent-report-contract.md`) is the INTERNAL,
35
+ machine-checked handoff from a dispatched specialist back to the orchestrator: a structured
36
+ envelope plus a per-role payload. This contract is the OUTWARD human briefing, orchestrator to
37
+ user, in prose. Different direction, different audience, different form. The orchestrator
38
+ CONSUMES the intent 74 report to WRITE the human briefing defined here. The two never merge.
39
+
40
+ ## Brevity: point, don't repeat
41
+
42
+ Surface rules (no em-dashes, plain words, no filler openers, and so on) are owned by the
43
+ shipped `plastic-humanizer` skill and the always-on plain-language layer. This contract does not
44
+ re-list that catalog. It restates only the hard bans as one line: no em-dashes, no "not X but Y",
45
+ no rule of three, no hype words, no sycophancy, no over-bolding. Apply `plastic-humanizer` and the
46
+ always-on layer for everything else.
47
+
48
+ ## Emission: guided vs auto
49
+
50
+ In guided mode, the briefing lands at each stage boundary and the human acts on the Call line
51
+ before the next stage starts.
52
+
53
+ In auto mode, the orchestrator still emits the briefing at each boundary, as a running EM-to-CTO
54
+ account. The Call line becomes the go-ahead the orchestrator takes itself and moves on, except at
55
+ the existing hard stops (destructive action without a safe alternative, project-path confirm).
@@ -0,0 +1,77 @@
1
+ # Tiers — Extended Walkthrough
2
+
3
+ This is the detail behind `## Tiers` in SKILL.md. The five points there (sizing rule, two
4
+ levers, per-tier topology, never-cut list, tier record) are the authoritative contract;
5
+ this file only expands on them with examples and rationale.
6
+
7
+ ## Why sizing exists
8
+
9
+ Auto mode used to run every intent through the same full-ceremony team: brainstorming,
10
+ spec-specialist, planner, executor, and an independent reviewer, each a separate agent
11
+ booting a fresh context. For a large or novel intent that ceremony earns its cost. For a
12
+ small intent (one file, one mechanism, an hour of real work) the ceremony dominates:
13
+ overhead runs about 3 to 4 times the actual work time, roughly flat regardless of size, so
14
+ it hurts small intents the most. Sizing at Why and matching the topology to that size drops
15
+ small-intent ceremony toward about 1.5x work time, without touching structure, gates, or
16
+ the savepoint ledger.
17
+
18
+ ## Sizing rule, worked examples
19
+
20
+ - S: fixing one script's argument parsing, adding one skill section, a single bug fix
21
+ confined to one file. Hours of work.
22
+ - M: adding a new agent role file end to end, a subsystem with a handful of touched files
23
+ and one clear seam. About a day.
24
+ - L: cross-cutting prose or code that spans the skill contract plus multiple agent role
25
+ files (like this intent, 130), or any genuinely novel design with no established pattern
26
+ to follow.
27
+
28
+ ## S/M collapsed topology, in detail
29
+
30
+ One thinker agent boots ONCE and stays in a single context for two stations:
31
+
32
+ 1. Station 1 — writes `spec.md` (collapsed sections allowed, one line each is valid).
33
+ 2. Station 2 — writes `plan.md` + `checklist.md` in the SAME context (no reboot). plan.md
34
+ carries the checklist rationale inline instead of separate `actions/ACTION_N.md` files.
35
+ `actions/` is not created for S/M.
36
+
37
+ Then a sonnet executor (a fresh dispatch, this is the one topology split that always
38
+ happens) implements from plan.md + checklist.md, checks off items, appends `## Insights`,
39
+ and drives the suite green, exactly as it does for L.
40
+
41
+ The independent reviewer still runs at the final gate for S/M, in its own fresh context,
42
+ never the maker. This is on the never-cut list; it does not collapse.
43
+
44
+ S may skip the QMD discovery deposit (normally a `plastic-intent-discovery` pass before
45
+ Why) when the intent's `chain` and `sources` are both empty in frontmatter. With no graph
46
+ edges there is nothing to discover, so the deposit is pure overhead; a one-line context
47
+ note ("no chain/sources, discovery skipped") takes its place.
48
+
49
+ ## L topology, unchanged
50
+
51
+ L keeps today's full multi-agent team as described in `## Team Spin-Up`: brainstorming,
52
+ spec-specialist, planner, executor, each a separate agent in its own fresh context, plus
53
+ the independent reviewer at the final gate. Cross-cutting or novel work benefits from the
54
+ separate perspectives and the handoff discipline; the ceremony is not waste at this size.
55
+
56
+ ## Same-structure invariant, why it is non-negotiable
57
+
58
+ The file set, stage order, gates, and savepoint ledger never change by tier. Renaming or
59
+ skipping files to save time would require new gate logic per tier and would break state
60
+ derivability (the gates and the savepoint rebuild depend on a fixed file set at fixed
61
+ paths). So the only two levers are content depth and agent topology; structure is the
62
+ constant that keeps every tier auditable the same way.
63
+
64
+ ## Tier record, mechanics
65
+
66
+ The tier is recorded as a `Tier: S|M|L` line at the very top of spec.md, above the `#
67
+ Spec:` heading. It is convention-only: the orchestrator reads it to pick topology, and
68
+ nothing else depends on it. No frontmatter schema change, no new file, no doctor rule, no
69
+ gate check. If a later intent wants doctor or a gate to validate the line, that is a
70
+ separate, explicit follow-up; this system deliberately adds no new operational surface.
71
+
72
+ ## Never-cut list, the safety floor
73
+
74
+ At any tier or mode: the independent reviewer (separate agent, fresh context, never the
75
+ maker), `outcome.md` as the truth of delivery, the delivery lock, worktree isolation,
76
+ intent creation via skill, INDEX as status truth, the QMD reindex at End. These are
77
+ predictability and safety guarantees, not ceremony, and lightness never touches them.
@@ -44,30 +44,8 @@ You MUST create a task for each of these items and complete them in order:
44
44
 
45
45
  ## Process Flow
46
46
 
47
- ```dot
48
- digraph brainstorming {
49
- "Explore project context" [shape=box];
50
- "Ask clarifying questions" [shape=box];
51
- "Propose 2-3 approaches" [shape=box];
52
- "Present design sections" [shape=box];
53
- "User approves design?" [shape=diamond];
54
- "Write spec" [shape=box];
55
- "Spec self-review\n(fix inline)" [shape=box];
56
- "User reviews spec?" [shape=diamond];
57
- "Invoke plastic-writing-plans" [shape=doublecircle];
58
-
59
- "Explore project context" -> "Ask clarifying questions";
60
- "Ask clarifying questions" -> "Propose 2-3 approaches";
61
- "Propose 2-3 approaches" -> "Present design sections";
62
- "Present design sections" -> "User approves design?";
63
- "User approves design?" -> "Present design sections" [label="no, revise"];
64
- "User approves design?" -> "Write spec" [label="yes"];
65
- "Write spec" -> "Spec self-review\n(fix inline)";
66
- "Spec self-review\n(fix inline)" -> "User reviews spec?";
67
- "User reviews spec?" -> "Write spec" [label="changes requested"];
68
- "User reviews spec?" -> "Invoke plastic-writing-plans" [label="approved"];
69
- }
70
- ```
47
+ The Checklist above states the ordered flow (steps 1-8). For the same flow as a
48
+ diagram, read `references/design-principles.md`.
71
49
 
72
50
  **The terminal state is invoking `plastic-writing-plans`.** Do NOT invoke any other implementation skill. The ONLY skill you invoke after brainstorming is `plastic-writing-plans`.
73
51
 
@@ -95,16 +73,11 @@ digraph brainstorming {
95
73
  - Cover: architecture, components, data flow, error handling, testing
96
74
  - Be ready to go back and clarify if something doesn't make sense
97
75
 
98
- **Design for isolation and clarity:**
99
- - Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
100
- - For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
101
- - Can someone understand what a unit does without reading its internals? Can you change the internals without breaking consumers? If not, the boundaries need work.
102
- - Smaller, well-bounded units are also easier for you to work with - you reason better about code you can hold in context at once, and your edits are more reliable when files are focused. When a file grows large, that's often a signal that it's doing too much.
103
-
104
- **Working in existing codebases:**
105
- - Explore the current structure before proposing changes. Follow existing patterns.
106
- - Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
107
- - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
76
+ **Design for isolation and clarity, and working in existing codebases:** before
77
+ proposing a design, read `references/design-principles.md` for unit-boundary
78
+ guidance (what makes a good interface, when a file has grown too large) and
79
+ existing-codebase guidance (follow established patterns, fold in targeted
80
+ improvements without unrelated refactoring).
108
81
 
109
82
  ## After the Design
110
83
  **Documentation:**
@@ -0,0 +1,49 @@
1
+ # Design Principles: Unit Boundaries and Existing Codebases
2
+
3
+ General good-developer guidance behind two parts of the Process: how to design for
4
+ isolation and clarity, and how to behave in an existing codebase. Also holds the
5
+ Process Flow diagram (the same ordered flow the Checklist already states as numbered
6
+ steps).
7
+
8
+ ## Design for isolation and clarity
9
+
10
+ - Break the system into smaller units that each have one clear purpose, communicate through well-defined interfaces, and can be understood and tested independently
11
+ - For each unit, you should be able to answer: what does it do, how do you use it, and what does it depend on?
12
+ - Can someone understand what a unit does without reading its internals? Can you change the internals without breaking consumers? If not, the boundaries need work.
13
+ - Smaller, well-bounded units are also easier for you to work with - you reason better about code you can hold in context at once, and your edits are more reliable when files are focused. When a file grows large, that's often a signal that it's doing too much.
14
+
15
+ ## Working in existing codebases
16
+
17
+ - Explore the current structure before proposing changes. Follow existing patterns.
18
+ - Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
19
+ - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
20
+
21
+ ## Process Flow (diagram)
22
+
23
+ The Checklist above already states this ordered flow as numbered steps 1-8; this
24
+ diagram is the same flow in a visual form.
25
+
26
+ ```dot
27
+ digraph brainstorming {
28
+ "Explore project context" [shape=box];
29
+ "Ask clarifying questions" [shape=box];
30
+ "Propose 2-3 approaches" [shape=box];
31
+ "Present design sections" [shape=box];
32
+ "User approves design?" [shape=diamond];
33
+ "Write spec" [shape=box];
34
+ "Spec self-review\n(fix inline)" [shape=box];
35
+ "User reviews spec?" [shape=diamond];
36
+ "Invoke plastic-writing-plans" [shape=doublecircle];
37
+
38
+ "Explore project context" -> "Ask clarifying questions";
39
+ "Ask clarifying questions" -> "Propose 2-3 approaches";
40
+ "Propose 2-3 approaches" -> "Present design sections";
41
+ "Present design sections" -> "User approves design?";
42
+ "User approves design?" -> "Present design sections" [label="no, revise"];
43
+ "User approves design?" -> "Write spec" [label="yes"];
44
+ "Write spec" -> "Spec self-review\n(fix inline)";
45
+ "Spec self-review\n(fix inline)" -> "User reviews spec?";
46
+ "User reviews spec?" -> "Write spec" [label="changes requested"];
47
+ "User reviews spec?" -> "Invoke plastic-writing-plans" [label="approved"];
48
+ }
49
+ ```
@@ -38,7 +38,11 @@ here — run the data payload and fill + present the matching template:
38
38
  - Otherwise → `ruby ~/.plastic/scripts/dashboard.rb continue --data`
39
39
 
40
40
  Fill the matching template from this skill's `templates/` and **present the filled Markdown
41
- in your reply** (every time). See `plastic-dashboard` for the fill rules and entry flow.
41
+ in your reply** (every time, non-optional). If the reply does not contain the filled Markdown,
42
+ the user sees nothing — tool-call stdout and hook `additionalContext` are both invisible to
43
+ them. `hook-continue` also emits a one-line `systemMessage` summary as a hook-owned fallback;
44
+ treat it as a floor only, never as a substitute for presenting the full board here. See
45
+ `plastic-dashboard` for the fill rules and entry flow.
42
46
 
43
47
  The board load runs the scoped store check on every load (`doctor --store <scope>`): the
44
48
  global board runs `--store global` and a project board runs `--store <slug>`. The result
@@ -63,13 +67,28 @@ command is a no-op when QMD is absent, so fall back to the existing INDEX.md / f
63
67
 
64
68
  For that intent's directory:
65
69
 
66
- 1. **Read `savepoint.md`.** It is a deterministic, append-only stage ledger (one line per
67
- milestone, newest at the bottom): `{utc-iso8601} {Stage} {milestone}`. The **last line =
68
- current stage**.
69
- 2. **Verify the stage file.** Confirm the file the ledger names exists and is non-empty
70
- (ledger `How plan.md created` → `plan.md` must be present and non-empty).
70
+ 1. **Read `savepoint.md` FIRST (intent 81).** It is a deterministic, append-only ledger
71
+ (one line per event, newest at the bottom): `{utc-iso8601} {Stage} {milestone}`. Classify
72
+ the state from the **last line** alone, then verify ONLY that line's artifact. The bookends
73
+ are fixed: first line `What created`, last line either a cycle position or
74
+ `Done delivered|abandoned`.
75
+
76
+ | Last line | State | Verify only |
77
+ |---|---|---|
78
+ | `What {id}--{slug}.md` | born / parked | intent file exists |
79
+ | `Why started` | Why entered, no spec yet | spec.md not yet real; continue Why |
80
+ | `Why spec.md created` | Why done | spec.md present; continue to How |
81
+ | `How started` / `How plan.md created` | How in progress | plan.md; continue How |
82
+ | `How checklist.md created` / `Exec started` | ready for / in Exec | plan.md + checklist.md present; continue Exec |
83
+ | `Exec outcome.md created` | Exec done | outcome.md present; ready to complete |
84
+ | `Done delivered` / `Done abandoned` | terminal | do NOT cycle-resume; INDEX is authoritative |
85
+
86
+ 2. **Verify the stage file.** Confirm only the last line's artifact exists and is non-empty
87
+ (ledger `How plan.md created` → `plan.md` must be present and non-empty). Do not re-probe
88
+ every lifecycle file.
71
89
  3. **Drift handling.** If the ledger's last line disagrees with files-on-disk, rebuild the
72
- ledger from filesystem state and note the correction:
90
+ ledger from filesystem state and note the correction. A rebuilt ledger is the file-landing
91
+ skeleton (no `started`/`Done` lines), which still pins cycle position:
73
92
  ```bash
74
93
  ruby -r ~/.plastic/scripts/lib/bridge -e 'Bridge.rebuild_savepoint("<intent_dir>")'
75
94
  ```
@@ -62,12 +62,18 @@ Having a "parent" in mind does NOT automatically mean branch. Choose by meaning:
62
62
  direct-ascendant provenance (D1).
63
63
  - **Merely related to / inspired by another intent** (it did NOT come out of that
64
64
  intent's lifecycle): carry NO `--sources`. Record the relation on the PREDECESSOR's
65
- `chain` instead, and mirror it as a `[[id]]` wikilink in `## Links` (the
66
- related-but-not-spawned rule).
65
+ `chain` instead (the related-but-not-spawned rule); the `## Links` section follows
66
+ from that edge, you do not write it by hand.
67
67
  - **Rule of thumb:** if the intent could exist without its parent, make it a root; only set
68
68
  `--sources` when it was genuinely created from / emerged from that intent's lifecycle.
69
69
  Topic similarity alone is not a `sources` edge.
70
70
 
71
+ `## Links` is a DERIVED view of `sources`/`chain`. Never hand-write a `## Links` line; add the
72
+ frontmatter edge and reproject. Links are decided by context influence (a `chain` edge has a high
73
+ bar: the candidate's context must materially help deliver this intent), not by shared files or a
74
+ similarity score. To gather candidates with their context and record an edge, use the
75
+ `plastic-linking-intents` skill and `scripts/link-suggest`.
76
+
71
77
  ### 3. Determine Intent Properties
72
78
 
73
79
  Ask or infer from context:
@@ -118,32 +124,11 @@ cleanly, and do not work around the failure by hand-writing the files.
118
124
 
119
125
  ### 6. If Implementation Intent Spawns a Project
120
126
 
121
- When the user says "start building" or the plan calls for a new project:
122
-
123
- 1. Determine project slug from intent name
124
- 2. Create project directory in first `project_roots` path (from `~/.plastic/config.yml`):
125
- ```bash
126
- mkdir -p <project_root>/<slug>
127
- cd <project_root>/<slug>
128
- git init
129
- ```
130
- 3. Copy `AGENTS.md` template from `${CLAUDE_PLUGIN_ROOT}/templates/agents.md`
131
- 4. Register in `~/.plastic/projects.yml`:
132
- ```yaml
133
- <slug>:
134
- path: <full-path>
135
- parent: "ID"
136
- registered: <today>
137
- status: active
138
- ```
139
- 5. Provision the project store (the single source of truth for store creation;
140
- runs after step 4 because the provisioner requires the project to be
141
- registered):
142
- ```bash
143
- ruby ~/.plastic/scripts/provision-project-store <slug>
144
- ```
145
- 6. Add `project-<slug>` to the intent's `tags` array
146
- 7. Auto-commit in both `~/.plastic/` and the new project
127
+ When the user says "start building" or the plan calls for a new project, invoke the
128
+ `plastic-creating-project` skill; it owns project directory creation, AGENTS.md
129
+ population, projects.yml registration, store provisioning, and the auto-commit of
130
+ both stores. Add `project-<slug>` to this intent's `tags` array either before
131
+ invoking it or as part of that skill's handoff.
147
132
 
148
133
  ### 7. Update INDEX.md
149
134
 
@@ -43,89 +43,25 @@ Invoke `plastic-install --local` in the project directory. This creates:
43
43
 
44
44
  ### 4. Populate AGENTS.md
45
45
 
46
- Create `AGENTS.md` in the project root with:
47
-
48
- ```markdown
49
- # <Project Name> — Agent Instructions
50
-
51
- Read `PLASTIC.md` in `~/.plastic/`. It contains all Plastic conventions.
52
- Follow it exactly.
53
-
54
- This file is the operating contract for this project. Any agent entering
55
- this project reads this file first.
56
-
57
- ## Global Store
58
-
59
- Location: `~/.plastic/`
60
- Governing intent(s): <list of founding intent IDs with descriptions>
61
-
62
- ## Decisions
63
-
64
- <Copy ALL decisions from founding intent(s)' `## Context > ### Decisions`>
65
-
66
- Each decision should include:
67
- - The decision itself
68
- - The rationale (why this choice)
69
- - Date decided
70
-
71
- ## Project-Specific Rules
72
-
73
- <Any rules derived from the decisions — e.g., "Use Minitest, not RSpec",
74
- "37signals methodology", "sqlite-vec for vector storage">
75
- ```
46
+ Create `AGENTS.md` in the project root from the skeleton in
47
+ `references/project-scaffolding.md` ("AGENTS.md skeleton"): read it now and fill in
48
+ the project name, governing intent IDs, decisions, and project-specific rules.
76
49
 
77
50
  ### 5. Create Tactical Mirror
78
51
 
79
- Create the first intent in the project's store at `~/.plastic/projects/{slug}/store/`:
52
+ Create the first intent in the project's store at `~/.plastic/projects/{slug}/store/`
53
+ using the frontmatter, sections, and INDEX.md line in `references/project-scaffolding.md`
54
+ ("Tactical mirror intent"), including the Hub multi-intent variant if there is more
55
+ than one founding intent.
80
56
 
81
57
  **Directory:** `~/.plastic/projects/{slug}/store/1--{slug}/`
82
58
  **File:** `~/.plastic/projects/{slug}/store/1--{slug}/1--{slug}.md`
83
59
 
84
- ```yaml
85
- ---
86
- id: '1'
87
- intent: "<same description as founding intent>"
88
- sources: ["global:<founding_intent_ID>"]
89
- chain: []
90
- created: <today>
91
- author: <same as founding intent author>
92
- tags: [<relevant tags>]
93
- ---
94
- ```
95
-
96
- Sections:
97
- - `## Intent` — same as founding intent
98
- - `## Context` — carry forward relevant Context and Decisions
99
- - `## Outcome` — (pending)
100
- - `## Insights` — empty
101
- - `## Links` — `[[global:<founding_intent_ID>|<founding intent name>]]`
102
-
103
- Update the project's `~/.plastic/projects/{slug}/INDEX.md`:
104
- ```markdown
105
- # Index
106
-
107
- ## Active
108
- - [1 — <intent name>](store/1--<slug>/1.md) — implementation, from: global:<ID>
109
- ```
110
-
111
- **For multi-intent spawning (Hub):**
112
- - `sources`: `["global:<id1>", "global:<id2>", ...]` — all founding intents
113
- - All founding intents' decisions merge into AGENTS.md
114
- - Context carries forward from all founding intents
115
-
116
60
  ### 6. Register in projects.yml
117
61
 
118
- Read `~/.plastic/projects.yml` and add:
119
-
120
- ```yaml
121
- <slug>:
122
- path: <full-path>
123
- parent: "<founding_intent_ID>"
124
- registered: <today>
125
- status: active
126
- ```
127
-
128
- For Hub-spawned projects, `parent` references the primary founding intent.
62
+ Read `~/.plastic/projects.yml` and add the entry shown in
63
+ `references/project-scaffolding.md` ("projects.yml registration block"). For
64
+ Hub-spawned projects, `parent` references the primary founding intent.
129
65
 
130
66
  ### 7. Provision the Project Store
131
67
 
@@ -195,4 +131,5 @@ Announce to user:
195
131
 
196
132
  ## References
197
133
 
134
+ - Read `references/project-scaffolding.md` before steps 4-6, for the AGENTS.md skeleton, the tactical mirror intent format, and the projects.yml registration block
198
135
  - Read `references/hubs-projects.md` for the full hub/project relationship model, project creation flow, and cross-linking conventions
@@ -0,0 +1,97 @@
1
+ # Project Scaffolding Templates
2
+
3
+ Full templates for the artifacts created while spawning a project: the AGENTS.md
4
+ skeleton (Workflow step 4), the tactical mirror intent (step 5), and the
5
+ projects.yml registration block (step 6).
6
+
7
+ ## Table of Contents
8
+
9
+ - [AGENTS.md skeleton (step 4)](#agentsmd-skeleton-step-4)
10
+ - [Tactical mirror intent (step 5)](#tactical-mirror-intent-step-5)
11
+ - [projects.yml registration block (step 6)](#projectsyml-registration-block-step-6)
12
+
13
+ ## AGENTS.md skeleton (step 4)
14
+
15
+ Create `AGENTS.md` in the project root with:
16
+
17
+ ```markdown
18
+ # <Project Name> — Agent Instructions
19
+
20
+ Read `PLASTIC.md` in `~/.plastic/`. It contains all Plastic conventions.
21
+ Follow it exactly.
22
+
23
+ This file is the operating contract for this project. Any agent entering
24
+ this project reads this file first.
25
+
26
+ ## Global Store
27
+
28
+ Location: `~/.plastic/`
29
+ Governing intent(s): <list of founding intent IDs with descriptions>
30
+
31
+ ## Decisions
32
+
33
+ <Copy ALL decisions from founding intent(s)' `## Context > ### Decisions`>
34
+
35
+ Each decision should include:
36
+ - The decision itself
37
+ - The rationale (why this choice)
38
+ - Date decided
39
+
40
+ ## Project-Specific Rules
41
+
42
+ <Any rules derived from the decisions — e.g., "Use Minitest, not RSpec",
43
+ "37signals methodology", "sqlite-vec for vector storage">
44
+ ```
45
+
46
+ ## Tactical mirror intent (step 5)
47
+
48
+ Create the first intent in the project's store at `~/.plastic/projects/{slug}/store/`:
49
+
50
+ **Directory:** `~/.plastic/projects/{slug}/store/1--{slug}/`
51
+ **File:** `~/.plastic/projects/{slug}/store/1--{slug}/1--{slug}.md`
52
+
53
+ ```yaml
54
+ ---
55
+ id: '1'
56
+ intent: "<same description as founding intent>"
57
+ sources: ["global:<founding_intent_ID>"]
58
+ chain: []
59
+ created: <today>
60
+ author: <same as founding intent author>
61
+ tags: [<relevant tags>]
62
+ ---
63
+ ```
64
+
65
+ Sections:
66
+ - `## Intent` — same as founding intent
67
+ - `## Context` — carry forward relevant Context and Decisions
68
+ - `## Outcome` — (pending)
69
+ - `## Insights` — empty
70
+ - `## Links` — `[[global:<founding_intent_ID>|<founding intent name>]]`
71
+
72
+ Update the project's `~/.plastic/projects/{slug}/INDEX.md`:
73
+ ```markdown
74
+ # Index
75
+
76
+ ## Active
77
+ - [1 — <intent name>](store/1--<slug>/1.md) — implementation, from: global:<ID>
78
+ ```
79
+
80
+ **For multi-intent spawning (Hub):**
81
+ - `sources`: `["global:<id1>", "global:<id2>", ...]` — all founding intents
82
+ - All founding intents' decisions merge into AGENTS.md
83
+ - Context carries forward from all founding intents
84
+
85
+ ## projects.yml registration block (step 6)
86
+
87
+ Read `~/.plastic/projects.yml` and add:
88
+
89
+ ```yaml
90
+ <slug>:
91
+ path: <full-path>
92
+ parent: "<founding_intent_ID>"
93
+ registered: <today>
94
+ status: active
95
+ ```
96
+
97
+ For Hub-spawned projects, `parent` references the primary founding intent.