@zalom/plastic 1.14.0 → 2.0.0-alpha.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.
- package/PLASTIC.md +101 -294
- package/README.md +5 -6
- package/agents/plastic-advisor.md +18 -17
- package/agents/plastic-enforcer.md +57 -69
- package/agents/plastic-executor.md +34 -20
- package/agents/plastic-faux-advisor.md +18 -18
- package/config_asks.yml +38 -0
- package/hooks/capture +4 -0
- package/hooks/check-update +12 -3
- package/hooks/close +5 -0
- package/hooks/hooks.json +9 -49
- package/hooks/record +4 -0
- package/package.json +3 -2
- package/scripts/agent-report +8 -9
- package/scripts/append-ledger +195 -0
- package/scripts/codex-hook +101 -95
- package/scripts/dashboard.rb +4 -4
- package/scripts/doctor.rb +106 -43
- package/scripts/end-intent +77 -76
- package/scripts/exec-worktree +11 -20
- package/scripts/file-session-intent +61 -0
- package/scripts/hook-capture +242 -0
- package/scripts/hook-close +34 -0
- package/scripts/hook-record +149 -0
- package/scripts/hook-session-start +95 -12
- package/scripts/install.rb +8 -6
- package/scripts/lib/agent_models.rb +1 -7
- package/scripts/lib/arm.rb +283 -0
- package/scripts/lib/backfill_intent.rb +316 -0
- package/scripts/lib/bridge.rb +24 -1597
- package/scripts/lib/doctor_core.rb +17 -88
- package/scripts/lib/doctor_session_ledger.rb +106 -0
- package/scripts/lib/exec_worktree.rb +14 -60
- package/scripts/lib/harness_text.rb +5 -4
- package/scripts/lib/hook_registry.rb +44 -107
- package/scripts/lib/insights.rb +3 -4
- package/scripts/lib/installer_core.rb +19 -30
- package/scripts/lib/lock.rb +6 -26
- package/scripts/lib/outcome_guard.rb +7 -5
- package/scripts/lib/project_validator.rb +30 -1
- package/scripts/lib/roadmap_queue.rb +3 -3
- package/scripts/lib/roadmap_savepoint.rb +1 -1
- package/scripts/lib/rule_catalog.rb +6 -3
- package/scripts/lib/savepoint.rb +320 -0
- package/scripts/lib/scaffold_intent.rb +13 -179
- package/scripts/lib/session_backfill.rb +184 -0
- package/scripts/lib/session_close.rb +84 -0
- package/scripts/lib/session_git.rb +469 -0
- package/scripts/lib/session_ledger.rb +497 -0
- package/scripts/lib/store_discovery.rb +1 -1
- package/scripts/lib/store_provisioning.rb +1 -1
- package/scripts/maintenance-run +7 -7
- package/scripts/new-intent +63 -4
- package/scripts/plastic-lock +94 -41
- package/scripts/promote-session-item +150 -0
- package/scripts/rebuild-graph +1 -1
- package/scripts/roadmap-next +2 -2
- package/scripts/rollback.rb +42 -3
- package/scripts/scaffold-intent +37 -63
- package/scripts/session-commit +116 -0
- package/scripts/spawn-preamble +5 -5
- package/scripts/update.rb +7 -3
- package/skills/agent-advisor/SKILL.md +3 -3
- package/skills/agent-advisor/references/advisor-protocol.md +20 -20
- package/skills/auto/SKILL.md +218 -317
- package/skills/auto/evals/evals.json +10 -10
- package/skills/auto/references/agent-architecture.md +102 -90
- package/skills/auto/references/agent-report-contract.md +4 -21
- package/skills/auto/references/end-tail.md +47 -53
- package/skills/auto/references/human-report-contract.md +8 -8
- package/skills/conventions/SKILL.md +1 -3
- package/skills/conventions/references/lifecycle-and-savepoints.md +35 -1
- package/skills/conventions/references/locks-and-worktrees.md +47 -55
- package/skills/conventions/references/maintenance-and-revisions.md +12 -12
- package/skills/dashboard/SKILL.md +1 -1
- package/skills/direct/SKILL.md +66 -0
- package/skills/direct/references/request-signals.md +59 -0
- package/skills/doctor/SKILL.md +58 -11
- package/skills/doctor/report.md +3 -1
- package/skills/install/SKILL.md +11 -9
- package/skills/intent-continuing/SKILL.md +131 -89
- package/skills/intent-continuing/references/boarding-matrix.md +34 -0
- package/skills/intent-continuing/references/context-management.md +2 -2
- package/skills/intent-creating/SKILL.md +2 -2
- package/skills/intent-creating/references/lifecycle.md +1 -1
- package/skills/intent-ending/SKILL.md +28 -37
- package/skills/intent-ending/evals/evals.json +4 -4
- package/skills/intent-executing/SKILL.md +12 -49
- package/skills/intent-executing/plan-reviewer-prompt.md +39 -0
- package/skills/intent-speccing/SKILL.md +108 -51
- package/skills/intent-speccing/evals/evals.json +5 -5
- package/skills/intent-speccing/references/per-section-fill-rules.md +4 -4
- package/skills/intent-speccing/references/self-verify-checklist.md +1 -2
- package/skills/project-creating/SKILL.md +1 -1
- package/skills/releasing/SKILL.md +7 -8
- package/skills/tutorial/SKILL.md +2 -2
- package/skills/tutorial/references/track-1-guided.md +16 -18
- package/skills/tutorial/references/track-2-auto.md +12 -13
- package/skills/tutorial/references/track-3-projects-and-roadmaps.md +2 -2
- package/templates/agents.md +4 -7
- package/templates/project.yml +7 -0
- package/templates/roadmap.md +1 -1
- package/templates/savepoint.md +2 -2
- package/templates/session-intent.md +29 -0
- package/agents/plastic-brainstorming.md +0 -48
- package/agents/plastic-future-intent-researcher.md +0 -35
- package/agents/plastic-intent-curator.md +0 -47
- package/agents/plastic-intent-discovery.md +0 -43
- package/agents/plastic-planner.md +0 -56
- package/agents/plastic-spec-specialist.md +0 -53
- package/hooks/auto-arm +0 -5
- package/hooks/bash-gate +0 -3
- package/hooks/continue +0 -31
- package/hooks/edit-gates +0 -3
- package/hooks/future-intent-check +0 -25
- package/hooks/gate-check +0 -12
- package/hooks/power-tools +0 -8
- package/scripts/hook-auto-arm +0 -51
- package/scripts/hook-bash-gate +0 -78
- package/scripts/hook-code-gate +0 -38
- package/scripts/hook-continue +0 -48
- package/scripts/hook-create-gate +0 -51
- package/scripts/hook-edit-gates +0 -58
- package/scripts/hook-future-intent-check +0 -90
- package/scripts/hook-gate-check +0 -169
- package/scripts/hook-links-gate +0 -54
- package/scripts/hook-lock-gate +0 -47
- package/scripts/hook-power-tools +0 -38
- package/scripts/hook-savepoint-pre +0 -32
- package/scripts/lib/codex_edit_gates.rb +0 -138
- package/scripts/lib/edit_gates.rb +0 -398
- package/scripts/lib/links_gate.rb +0 -140
- package/scripts/lib/qmd_hook.rb +0 -41
- package/scripts/lib/spec_header.rb +0 -83
- package/scripts/lib/start_intent.rb +0 -296
- package/scripts/start-intent +0 -89
- package/skills/_active-intent-gate.md +0 -26
- package/skills/auto/references/tiers.md +0 -100
- package/skills/continuing/SKILL.md +0 -34
- package/skills/continuing/evals/evals.json +0 -91
- package/skills/conventions/references/gates-and-enforcement.md +0 -53
- package/skills/conventions/references/tiers-and-dispatch.md +0 -135
- package/skills/doctor/references/gates-stuck-detection.md +0 -43
- package/skills/intent-brainstorming/SKILL.md +0 -118
- package/skills/intent-brainstorming/evals/evals.json +0 -67
- package/skills/intent-continuing/evals/evals.json +0 -145
- package/skills/intent-discovering/SKILL.md +0 -56
- package/skills/intent-grilling/SKILL.md +0 -108
- package/skills/intent-linking/SKILL.md +0 -128
- package/skills/intent-linking/evals/evals.json +0 -22
- package/skills/intent-linking/references/zettelkasten.md +0 -45
- package/skills/intent-locking/SKILL.md +0 -64
- package/skills/intent-planning/SKILL.md +0 -145
- package/skills/intent-planning/evals/evals.json +0 -81
- package/skills/intent-planning/references/plan-format.md +0 -130
- package/skills/intent-researching/SKILL.md +0 -123
- package/skills/intent-researching/evals/evals.json +0 -22
- package/skills/intent-savepoint/SKILL.md +0 -83
- package/skills/intent-savepoint/references/context-management.md +0 -32
- package/skills/intent-starting/SKILL.md +0 -151
- package/skills/intent-starting/evals/evals.json +0 -117
- package/skills/intent-starting/references/boarding-matrix.md +0 -35
- package/skills/project-continuing/SKILL.md +0 -119
- package/skills/project-continuing/evals/evals.json +0 -100
- package/skills/roadmap-continuing/SKILL.md +0 -89
- package/skills/roadmap-continuing/evals/evals.json +0 -82
- package/skills/skill-creating/SKILL.md +0 -75
- package/skills/skill-creating/evals/evals.json +0 -108
- package/skills/skill-creating/references/agents.md +0 -168
- package/skills/skill-creating/references/defaults-first.md +0 -23
- package/skills/skill-creating/references/evals.md +0 -41
- package/skills/skill-creating/references/hooks.md +0 -251
- package/skills/skill-creating/references/progressive-disclosure.md +0 -176
- package/skills/skill-creating/references/scripts.md +0 -166
- package/skills/skill-creating/references/skills.md +0 -169
- package/skills/skill-creating/scripts/scaffold.rb +0 -313
- package/skills/skill-evaluating/SKILL.md +0 -141
- package/skills/skill-evaluating/assets/eval-template.json +0 -12
- package/skills/skill-evaluating/evals/evals.json +0 -75
- package/skills/skill-evaluating/references/convention-checks.md +0 -76
- package/skills/skill-evaluating/references/eval-methodology.md +0 -154
- package/skills/store-curating/SKILL.md +0 -64
- package/skills/store-curating/evals/evals.json +0 -38
- package/skills/store-indexing/SKILL.md +0 -93
- package/skills/store-indexing/evals/evals.json +0 -22
- package/skills/store-indexing/references/zettelkasten-linking.md +0 -32
- package/skills/store-provisioning/SKILL.md +0 -55
- /package/skills/{project-continuing → intent-continuing}/references/board-fill.md +0 -0
- /package/skills/{roadmap-continuing → intent-continuing}/references/liveness-ranking.md +0 -0
- /package/skills/{intent-brainstorming → intent-speccing}/references/design-principles.md +0 -0
package/skills/auto/SKILL.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plastic-auto
|
|
3
3
|
description: >-
|
|
4
|
-
Autonomous intent delivery -
|
|
5
|
-
"auto", "take it from here", "deliver this", or when
|
|
6
|
-
and user confirms autonomous execution. Requires an active intent
|
|
4
|
+
Autonomous intent delivery - a background team takes a registered intent from How to Done.
|
|
5
|
+
Use when user says "auto", "take it from here", "deliver this", or when a thinking
|
|
6
|
+
conversation concludes and the user confirms autonomous execution. Requires an active intent
|
|
7
|
+
in INDEX.md.
|
|
7
8
|
user-invocable: true
|
|
8
9
|
---
|
|
9
10
|
|
|
@@ -11,175 +12,128 @@ user-invocable: true
|
|
|
11
12
|
|
|
12
13
|
Announce: "Taking over intent [ID] - [name] for autonomous delivery."
|
|
13
14
|
|
|
14
|
-
**Advisory (not a
|
|
15
|
+
**Advisory (not a rule).** At auto-mode start, recommend once that the user run this
|
|
15
16
|
orchestrating main session on the best available thinking model (Fable, Opus, or whatever
|
|
16
|
-
supersedes them)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
lifecycle stage roles: the never-Fable rule governs stage agents only. Neither is ever
|
|
22
|
-
dispatched by the auto pipeline; they are consultation roles summoned deliberately by the user
|
|
23
|
-
or the main session, and their models are user configuration (fable and opus by default on
|
|
24
|
-
Claude Code).
|
|
17
|
+
supersedes them). This is advice only: it changes no behavior. Dispatched agents keep their
|
|
18
|
+
configured model and never resolve to Fable unless an explicit `agents.models.<name>` config
|
|
19
|
+
override names Fable for that role. The two advisors, `plastic-advisor` and
|
|
20
|
+
`plastic-faux-advisor`, are consultation roles the user or the main session summons
|
|
21
|
+
deliberately; the auto pipeline never dispatches them.
|
|
25
22
|
|
|
26
23
|
## Precondition
|
|
27
24
|
|
|
28
|
-
An active intent MUST exist in INDEX.md. If none exists, refuse: "No active intent found.
|
|
25
|
+
An active intent MUST exist in INDEX.md. If none exists, refuse: "No active intent found.
|
|
26
|
+
Create one first with /plastic-intent-creating."
|
|
29
27
|
|
|
30
|
-
If
|
|
28
|
+
If several active intents exist, ask the user which one to deliver (the one question auto asks
|
|
29
|
+
at boarding, before delivery starts).
|
|
31
30
|
|
|
32
|
-
**Picking work when no intent is specified.** If the user says "auto" without naming an
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
**Picking work when no intent is specified.** If the user says "auto" without naming an intent
|
|
32
|
+
and none is active, consult the roadmap first (the primary planning surface), then fall back to
|
|
33
|
+
the dashboard queue:
|
|
35
34
|
|
|
36
35
|
```bash
|
|
37
36
|
ruby ~/.plastic/scripts/roadmap-next --roadmaps-dir <tier>/roadmaps
|
|
38
37
|
```
|
|
39
38
|
|
|
40
|
-
Branch on `state`:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- `none` or `exhausted`: no roadmap, or nothing left to dispatch. Fall back to the dashboard
|
|
46
|
-
queue below. (The global store has no roadmap, so it always reports `none` and falls back.)
|
|
39
|
+
Branch on `state`: `dispatchable` means work its `dispatchable_queue` in `rank` order (the
|
|
40
|
+
current batch's `queued` intents, parallel-safe within the batch); `in_flight` means the
|
|
41
|
+
frontier batch is still delivering, report it and wait, never dispatch a later batch; `none` or
|
|
42
|
+
`exhausted` means fall back to `ruby ~/.plastic/scripts/dashboard.rb all --json` and work its
|
|
43
|
+
`dispatchable_queue` in `rank` order, leaving `human_only` and `next_big_thing` for the user.
|
|
47
44
|
|
|
48
|
-
|
|
45
|
+
QMD-first (when available): when the user describes the work rather than naming an intent, run
|
|
46
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` before scanning the store, then open the
|
|
47
|
+
authoritative intent file for the hit you take over. The command is a no-op when QMD is absent.
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
ruby ~/.plastic/scripts/dashboard.rb all --json
|
|
52
|
-
```
|
|
49
|
+
## Take the intent (do this FIRST)
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
intent, before scanning the store with grep/Read run
|
|
60
|
-
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or duplicate
|
|
61
|
-
intents, then open the authoritative intent file for the hit you take over. The command is a no-op
|
|
62
|
-
when QMD is absent, so fall back to the existing INDEX.md / file scan. (This is discovery; the
|
|
63
|
-
reindex step under Completion is separate.)
|
|
64
|
-
|
|
65
|
-
## Tiers (proportional auto sizing)
|
|
66
|
-
|
|
67
|
-
Auto mode sizes every intent S/M/L at Why, deterministically, then matches agent topology
|
|
68
|
-
and artifact depth to that size. Extended walkthrough: `references/tiers.md`.
|
|
69
|
-
|
|
70
|
-
1. **Sizing rule.** S = single mechanism or file cluster (hours). M = one subsystem (a
|
|
71
|
-
day). L = cross-cutting or novel design.
|
|
72
|
-
2. **Two levers.** Speed comes only from artifact content DEPTH and agent TOPOLOGY. The
|
|
73
|
-
same-structure invariant (same file set, stage order, gates, savepoint ledger) holds at
|
|
74
|
-
every tier and in both modes. A three-line spec.md is still a spec.md, in the same
|
|
75
|
-
place, under the same gate.
|
|
76
|
-
3. **Per-tier topology.** S/M: one thinker agent, one boot, two stations, sonnet
|
|
77
|
-
executor; the thinker writes at least one real action file (one consolidated
|
|
78
|
-
`actions/ACTION_1.md`), never an empty `actions/`. That executor runs as ONE dispatch
|
|
79
|
-
for the whole consolidated action, with no per-task two-stage review loop
|
|
80
|
-
(`plastic-intent-executing` holds that gate). S cuts two more things: it skips the QMD
|
|
81
|
-
discovery deposit when chain and sources are both empty AND a size of S is already on
|
|
82
|
-
record (a stamped `Tier: S` line in spec.md), which a first activation does not have,
|
|
83
|
-
and it sends ONE mid-flight owner briefing, at How. M and L send all four. L: today's
|
|
84
|
-
full team (`## Team Spin-Up` below), one `actions/ACTION_N.md` per task, and a per-task
|
|
85
|
-
implementer plus two-stage review.
|
|
86
|
-
4. **Never-cut list**, any tier or mode: the independent reviewer (separate agent, fresh
|
|
87
|
-
context, never the maker), `outcome.md` as truth of delivery, the delivery lock,
|
|
88
|
-
worktree isolation, intent creation via skill, INDEX as status truth, the QMD reindex
|
|
89
|
-
at End. Lightness is about ceremony, never about these guarantees.
|
|
90
|
-
5. **Tier record.** `Tier: S|M|L` at the top of spec.md. Convention-only: read by the
|
|
91
|
-
orchestrator, never validated by any gate or by doctor. A separate
|
|
92
|
-
`Settled: yes (<reason>)` line may sit directly beneath the `Tier:` line; an absent
|
|
93
|
-
line means not settled, and settledness is independent of scope.
|
|
94
|
-
|
|
95
|
-
Read `../plastic-conventions/references/tiers-and-dispatch.md` for tier sizing, agent-model
|
|
96
|
-
config, advisor routing, and the auto-mode human report contract behind the sizing above. This
|
|
97
|
-
path resolves relative to this skill's own installed directory.
|
|
98
|
-
|
|
99
|
-
## Arm the Lifecycle Gate (do this FIRST)
|
|
100
|
-
|
|
101
|
-
Immediately after selecting the intent - before any other work - arm auto mode. This
|
|
102
|
-
writes the session bridge that makes the code-edit gate live, so project code cannot be
|
|
103
|
-
edited before the plan exists (the gate applies to YOU, the orchestrator):
|
|
51
|
+
Immediately after selecting the intent, take it for this session. One verb acquires the durable
|
|
52
|
+
`delivery.lock` in the intent directory (stamped `run_mode: auto`), provisions the code worktree
|
|
53
|
+
at `<repo>/.claude/worktrees/{id}--{slug}` on branch `plastic/{id}--{slug}`, and points this
|
|
54
|
+
session at the intent (`~/.plastic/store/.tmp/<session>/current`), so the record hook writes
|
|
55
|
+
savepoint lines and heartbeats for it instead of the day ledger:
|
|
104
56
|
|
|
105
57
|
```bash
|
|
106
|
-
|
|
107
|
-
|
|
58
|
+
codex="${CODEX_THREAD_ID:-}"; claude="${CLAUDE_CODE_SESSION_ID:-}"
|
|
59
|
+
ruby ~/.plastic/scripts/plastic-lock arm --intent-dir "<STORE>/<dir>" --mode auto \
|
|
60
|
+
--agent plastic-enforcer \
|
|
61
|
+
${codex:+--harness codex --session "$codex" --thread "$codex"} \
|
|
62
|
+
${claude:+--harness claude --session "$claude"}
|
|
108
63
|
```
|
|
109
64
|
|
|
110
|
-
Replace `<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- **plastic-
|
|
140
|
-
|
|
141
|
-
- **plastic-
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
65
|
+
Replace `<STORE>` (`~/.plastic/projects/<slug>/store` or `~/.plastic/store`) and `<dir>` (the
|
|
66
|
+
`ID--slug` directory). The snippet trusts a nonblank `CODEX_THREAD_ID` as Codex, otherwise a
|
|
67
|
+
nonblank `CLAUDE_CODE_SESSION_ID` as Claude, otherwise passes no identity and the verb keys the
|
|
68
|
+
lock by a derived session key. Never guess identity from an absent runtime variable; an
|
|
69
|
+
unknown harness or thread stays unknown. Exit 1 means the lock is held, stale, excluded, or
|
|
70
|
+
corrupt; the message names the `plastic-doctor` verb that resolves it. Do not proceed as the
|
|
71
|
+
owner after an exit 1.
|
|
72
|
+
|
|
73
|
+
Read `../plastic-conventions/references/locks-and-worktrees.md` for what the lock and the
|
|
74
|
+
worktree mean and the station table behind them. Code edits happen only inside the worktree.
|
|
75
|
+
|
|
76
|
+
## The shape (five steps, two agent boots)
|
|
77
|
+
|
|
78
|
+
Every auto delivery runs the same shape, ruled by the owner on 2026-08-29. There is no intent
|
|
79
|
+
tier and no stage agent; depth follows the work.
|
|
80
|
+
|
|
81
|
+
| Step | Who | What lands |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| 1. The lead writes How | this session | `plan.md`, at least one `actions/ACTION_N.md` carrying a failure-mode matrix (one row per operation: the failure and the test that catches it), `checklist.md` |
|
|
84
|
+
| 2. Adversarial plan review | boot 1, a fresh agent on `plan-reviewer-prompt.md` | a review file; the lead folds every finding into the spec, the matrix, and the tests |
|
|
85
|
+
| 3. Execute, tests first | boot 2, `plastic-executor` | the red commit (the matrix's tests, failing), then the code, then a green suite |
|
|
86
|
+
| 4. Review by risk | boot 3 only when risk calls for it (below) | a pass or a list of fixes the executor applies |
|
|
87
|
+
| 5. One suite run, then close | this session | `outcome.md`, `end-intent`, the roadmap ledger |
|
|
88
|
+
|
|
89
|
+
Two boots is the normal delivery; the third is the exception the risk rule names. The lead is
|
|
90
|
+
this session (the `plastic-enforcer` role), never a dispatched agent.
|
|
91
|
+
|
|
92
|
+
## Team
|
|
93
|
+
|
|
94
|
+
- **plastic-enforcer**: this session. Writes the Why and How record, dispatches, folds reviews,
|
|
95
|
+
verifies, closes.
|
|
96
|
+
- **plastic-executor**: one dispatch per intent, implements the consolidated action tests first,
|
|
97
|
+
ticks the checklist, appends `## Insights`, drives the suite green.
|
|
98
|
+
- **the plan reviewer**: one dispatch before code, from `plastic-intent-executing`'s
|
|
99
|
+
`plan-reviewer-prompt.md`; a fresh agent, never the lead.
|
|
100
|
+
- **the post-execution reviewer**: dispatched only by the risk rule, from
|
|
101
|
+
`code-quality-reviewer-prompt.md`; a fresh agent, never the maker.
|
|
102
|
+
|
|
103
|
+
Spawn preamble (live-state injection): before dispatching any agent, run
|
|
104
|
+
`scripts/spawn-preamble <intent_dir> --role <role>` and PREPEND its output to the prompt. The
|
|
105
|
+
preamble is a deterministic, filesystem-only snapshot of the intent (id, intent line, current
|
|
106
|
+
stage, the worktree path when it exists) plus the honoring instruction and the report contract.
|
|
107
|
+
|
|
108
|
+
Dispatch-time model contract: resolve each agent's model through the config chain
|
|
109
|
+
(`read-config agents.models.<basename> --project <repo>`: project override, then global, then
|
|
110
|
+
the shipped default) and pass it explicitly at dispatch; never rely on the role's frontmatter
|
|
111
|
+
alone.
|
|
112
|
+
|
|
113
|
+
Completion report (require, then synthesize): every dispatched agent MUST end with a structured
|
|
114
|
+
completion report as its final message (`references/agent-report-contract.md`). When an agent
|
|
115
|
+
returns no usable report, run `scripts/agent-report <intent_dir> --role <role>` to synthesize a
|
|
116
|
+
deterministic filesystem-derived one, so the handoff account always exists.
|
|
117
|
+
|
|
118
|
+
### Delegation (agents writing under the owner's lock)
|
|
119
|
+
|
|
120
|
+
This session owns the delivery lock. A dispatched agent runs in its own session, so register
|
|
121
|
+
each one as a delegate before (or when) it needs to write into the intent dir:
|
|
122
|
+
|
|
123
|
+
1. Instruct each spawned agent to report its session id and runtime identity in its first
|
|
168
124
|
message: `CODEX_THREAD_ID` for Codex, or `CLAUDE_CODE_SESSION_ID` for Claude. Use the
|
|
169
|
-
|
|
125
|
+
agent's own identity when known; never infer a harness or model from missing context.
|
|
170
126
|
2. As the lock owner, run:
|
|
171
127
|
`ruby ~/.plastic/scripts/plastic-lock delegate --intent-dir <intent-dir> --delegate <specialist-session-id> --harness <specialist-harness-when-known> --agent <role> --model <resolved-model-when-known> --thread <reported-CODEX_THREAD_ID-when-Codex>`
|
|
172
128
|
Omit `--harness`, `--model`, or `--thread` when that value is unknown; `--agent <role>` is
|
|
173
|
-
always known from the
|
|
174
|
-
3.
|
|
175
|
-
command; run it and have the specialist retry.
|
|
176
|
-
4. Immediately after the specialist returns, and before validating or dispatching
|
|
129
|
+
always known from the roster.
|
|
130
|
+
3. Immediately after the specialist returns, and before validating or dispatching
|
|
177
131
|
the next handoff, classify the return and record its activity status as the owner:
|
|
178
132
|
- `finished` means the specialist returned a usable completion report, whether
|
|
179
133
|
agent-authored or synthesized through `scripts/agent-report`.
|
|
180
134
|
- `failed` means the specialist returned blocked, errored, or without a usable
|
|
181
135
|
completion report that can be synthesized.
|
|
182
|
-
|
|
136
|
+
4. Record the classification with exactly one of:
|
|
183
137
|
```bash
|
|
184
138
|
ruby ~/.plastic/scripts/plastic-lock delegate --intent-dir <intent-dir> \
|
|
185
139
|
--delegate <specialist-session-id> --status finished --harness <same-specialist-harness-when-known> \
|
|
@@ -188,204 +142,151 @@ as a delegate before (or when) it needs to write into the intent dir:
|
|
|
188
142
|
--delegate <specialist-session-id> --status failed --harness <same-specialist-harness-when-known> \
|
|
189
143
|
--agent <same-role> --model <same-resolved-model-when-known> --thread <same-CODEX_THREAD_ID-when-Codex>
|
|
190
144
|
```
|
|
191
|
-
Apply the same omission rule to unknown values on terminal status commands.
|
|
192
|
-
|
|
193
|
-
never dispatch the next specialist first.
|
|
145
|
+
Apply the same omission rule to unknown values on terminal status commands. A failed agent
|
|
146
|
+
stops that handoff under the error procedure; never dispatch the next agent first.
|
|
194
147
|
|
|
195
148
|
Only the owner can delegate. Delegates cannot re-delegate or release.
|
|
196
149
|
|
|
197
|
-
Headless
|
|
150
|
+
Headless note: in a headless or background run the session id may be unset; the arm verb then
|
|
151
|
+
keys the lock by a derived key and the record hook still writes the savepoint ledger from the
|
|
152
|
+
written path. Verify the lock with `plastic-lock status` rather than assuming.
|
|
198
153
|
|
|
199
|
-
Solo fallback:
|
|
154
|
+
Solo fallback: on a harness with no agent dispatch (Codex CLI today), this session walks the
|
|
155
|
+
five steps itself: it still writes the matrix, still writes the tests first, and reviews its own
|
|
156
|
+
plan against the matrix before code, saying so in `## Insights`.
|
|
200
157
|
|
|
201
158
|
## Stage-Aware Entry
|
|
202
159
|
|
|
203
|
-
Read the active intent's `savepoint.md` FIRST
|
|
204
|
-
|
|
205
|
-
|
|
160
|
+
Read the active intent's `savepoint.md` FIRST: the last line classifies the stage, and you
|
|
161
|
+
verify only that line's artifact before entering. Fall back to the filesystem probe when the
|
|
162
|
+
ledger is missing (then rebuild it with `Savepoint.rebuild_savepoint`).
|
|
206
163
|
|
|
207
164
|
| Ledger last line | Enter |
|
|
208
165
|
|---|---|
|
|
209
|
-
| `What {id}--{slug}.md` (born) or no spec |
|
|
210
|
-
| `Why spec.md created` |
|
|
211
|
-
| `How plan.md created` / `How checklist.md created` / `Exec started` |
|
|
166
|
+
| `What {id}--{slug}.md` (born) or no spec | Why (write spec.md) |
|
|
167
|
+
| `Why spec.md created` | How |
|
|
168
|
+
| `How plan.md created` / `How checklist.md created` / `Exec started` | Exec (verify plan, matrix, checklist) |
|
|
212
169
|
| `Exec outcome.md created` | Exec done; complete the intent |
|
|
213
170
|
| `Done delivered|abandoned` | Terminal; do not resume |
|
|
214
171
|
|
|
215
|
-
Filesystem fallback
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
1.
|
|
236
|
-
2.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
Then
|
|
251
|
-
|
|
252
|
-
##
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
6. Continue execution from the project directory using the tactical intent
|
|
284
|
-
|
|
285
|
-
## Exec Phase
|
|
286
|
-
|
|
287
|
-
1. If `superpowers:subagent-driven-development` or `superpowers:executing-plans` is available, delegate execution to it
|
|
288
|
-
2. Otherwise invoke `plastic-intent-executing`
|
|
289
|
-
3. Execute actions from checklist sequentially
|
|
290
|
-
4. Check off items in `checklist.md` as completed
|
|
291
|
-
5. Append observations to `## Insights` with `(autonomous)` marker
|
|
292
|
-
6. Sub-agents can be spawned for parallel actions (one agent per action)
|
|
293
|
-
7. Notify user (Exec briefing, M and L only): brief per `references/human-report-contract.md`
|
|
294
|
-
(State: what got built and the test result; Risk: residual failures or deviations;
|
|
295
|
-
Call: go to review, or done). At S this briefing does not fire; the final owner report at
|
|
296
|
-
End carries what it would have said.
|
|
172
|
+
Filesystem fallback, in order: `checklist.md` with items checked means resume Exec from the
|
|
173
|
+
first unchecked item; `plan.md` plus `checklist.md` means enter Exec; `spec.md` alone means
|
|
174
|
+
enter How; `## Context` with content means complete Why; only `## Intent` means start Why.
|
|
175
|
+
|
|
176
|
+
Announce which stage you are entering and why.
|
|
177
|
+
|
|
178
|
+
## Why (the lead)
|
|
179
|
+
|
|
180
|
+
1. Read `## Context` and `### Decisions`; assess the gaps.
|
|
181
|
+
2. Research yourself: code, docs, related intents through `## Links`, the web if needed. No
|
|
182
|
+
questions to the human.
|
|
183
|
+
3. Decide: pick the best option per gap, record it in `## Context > ### Decisions` with the
|
|
184
|
+
rationale, and log it in `## Insights` with the `(autonomous)` marker through
|
|
185
|
+
`scripts/insight-append`.
|
|
186
|
+
4. Write `spec.md`.
|
|
187
|
+
|
|
188
|
+
Then How.
|
|
189
|
+
|
|
190
|
+
## How (the lead), then the plan review
|
|
191
|
+
|
|
192
|
+
1. Write `plan.md`: numbered steps.
|
|
193
|
+
2. Write at least one real `actions/ACTION_N.md` (one consolidated `ACTION_1.md` by default;
|
|
194
|
+
several only when the work splits into independent, parallel-safe actions). Each action
|
|
195
|
+
carries the failure-mode matrix: one row per operation, the failure mode, and the test that
|
|
196
|
+
catches it. A `.gitkeep`-only `actions/` is not a finished How.
|
|
197
|
+
3. Write `checklist.md` covering every action.
|
|
198
|
+
4. Dispatch the plan reviewer (boot 1) with `plastic-intent-executing`'s
|
|
199
|
+
`plan-reviewer-prompt.md`, the spawn preamble, and the intent directory. Fold every finding
|
|
200
|
+
into the spec, the matrix, and the tests; record what was dropped and why in the action
|
|
201
|
+
file's review fold. A REVISE verdict is folded and not re-reviewed unless a finding changes
|
|
202
|
+
a decision.
|
|
203
|
+
5. Notify the user (the one mid-flight briefing, per `references/human-report-contract.md`):
|
|
204
|
+
State, the plan shape and what it builds; Risk, the riskiest row of the matrix; Call,
|
|
205
|
+
proceeding to build. In auto mode this briefing informs; it does not wait.
|
|
206
|
+
|
|
207
|
+
Then Exec.
|
|
208
|
+
|
|
209
|
+
## Exec (the executor)
|
|
210
|
+
|
|
211
|
+
1. Dispatch `plastic-executor` (boot 2) through `plastic-intent-executing` with the whole
|
|
212
|
+
consolidated action pasted in: the spec decisions, the matrix, the checklist items, the
|
|
213
|
+
worktree path from the preamble. Tests first: the executor commits the matrix's tests red,
|
|
214
|
+
then builds, then drives the full suite green.
|
|
215
|
+
2. Read its return by code: DONE or DONE_WITH_CONCERNS proceeds; NEEDS_CONTEXT re-dispatches
|
|
216
|
+
with the missing context; BLOCKED stops under the error procedure.
|
|
217
|
+
3. Tick the checklist as items land (the executor does this; verify it).
|
|
218
|
+
|
|
219
|
+
## Review by risk (boot 3, only when a rule fires)
|
|
220
|
+
|
|
221
|
+
Dispatch the post-execution reviewer with `code-quality-reviewer-prompt.md` when any of these
|
|
222
|
+
holds, each checkable from disk with no judgment; otherwise the green suite is the review:
|
|
223
|
+
|
|
224
|
+
1. `git diff --name-only <red-commit>..HEAD` touches a path on the risk list in
|
|
225
|
+
`references/agent-architecture.md` (hooks, the lock, the arming module, the installer, a
|
|
226
|
+
release file).
|
|
227
|
+
2. A row of any `actions/ACTION_N.md` failure-mode matrix names a test file that is not in that
|
|
228
|
+
diff, or a test the green run did not execute.
|
|
229
|
+
3. The executor's completion report carries a status other than `delivered`, or a non-empty
|
|
230
|
+
`deviations` or `blockers` field.
|
|
231
|
+
|
|
232
|
+
The reviewer returns a pass or a list of fixes; the executor (re-dispatched) applies them, then
|
|
233
|
+
the suite runs once more.
|
|
234
|
+
## Project Creation
|
|
235
|
+
|
|
236
|
+
If the plan calls for creating a new project, determine the path from `~/.plastic/config.yml`
|
|
237
|
+
`project_roots` or the intent context, confirm the path with the user (the one human
|
|
238
|
+
interaction added mid-delivery), invoke `plastic-project-creating`, and continue from the
|
|
239
|
+
project directory on the tactical intent.
|
|
297
240
|
|
|
298
241
|
## Permission Model - Safe-by-Default
|
|
299
242
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
| Alter column | Additive migration - new column + backfill |
|
|
307
|
-
| Remove feature | Feature flag off, code stays until human confirms |
|
|
308
|
-
| Database migration | Backup before migration, keep rollback path |
|
|
309
|
-
|
|
310
|
-
### Hard Stop (without `--skip-permissions`)
|
|
311
|
-
|
|
312
|
-
When a genuinely destructive action on an existing project has NO safe alternative:
|
|
313
|
-
1. Log the proposed action in `## Insights`
|
|
314
|
-
2. Notify user: "Blocked on destructive action: [description]. Approve to continue, or provide alternative direction."
|
|
315
|
-
3. **STOP and wait for human response.** Do not proceed.
|
|
316
|
-
|
|
317
|
-
With `--skip-permissions`, the agent logs the action in Insights but proceeds without stopping.
|
|
318
|
-
|
|
319
|
-
### Greenfield Exception
|
|
320
|
-
|
|
321
|
-
During initial project creation, all decisions are non-destructive by definition (there's nothing to destroy). The agent has full autonomy for greenfield choices - DB engine, framework, gems, architecture.
|
|
243
|
+
Prefer non-destructive routes: rename instead of drop, additive migrations plus backfill, move
|
|
244
|
+
files instead of deleting them, feature flags off instead of removed code, a backup before a
|
|
245
|
+
migration. When a destructive action on an existing project has no safe alternative, log it in
|
|
246
|
+
`## Insights`, notify the user ("Blocked on destructive action: ..."), and STOP unless
|
|
247
|
+
`--skip-permissions` was given, in which case log and proceed. During initial project creation
|
|
248
|
+
every choice is non-destructive and the team has full autonomy.
|
|
322
249
|
|
|
323
250
|
## Completion
|
|
324
251
|
|
|
325
|
-
Read `../plastic-conventions/references/completion-and-done.md` for what "intent done" means
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
- `manual` - skip auto-commit, notify user: "Release configured as manual - commit when ready."
|
|
340
|
-
4. If `release.verify` is set, run the verify command (e.g. `bundle exec rake test`):
|
|
341
|
-
- **Exit 0 (green):** proceed to sub-step 5
|
|
342
|
-
- **Non-zero (red):** check `release.on_red`:
|
|
343
|
-
- `fix_and_retry` - attempt to fix the failure, re-run verify (max 2 retries)
|
|
344
|
-
- `stop` - write `savepoint.md` with current state, notify user: "Verify failed - savepoint written.", **STOP**
|
|
345
|
-
- `manual` - notify user: "Verify failed: [summary]. Resolve manually."
|
|
346
|
-
5. If `release.on_green` has items, invoke `plastic-releasing` to handle them (tag, changelog, publish, etc.). Do NOT duplicate release logic - delegate entirely.
|
|
347
|
-
4. Review `## Insights` for observations that should spawn future intents. If any:
|
|
348
|
-
- Create them (using `plastic-intent-creating` conventions)
|
|
349
|
-
- Update `chain` in the current intent's frontmatter
|
|
350
|
-
5. Run the mechanical close through `plastic-intent-ending`: it owns steps 1-7 of the Done
|
|
351
|
-
procedure (outcome/INDEX/savepoint/commit, disarm, the QMD reindex last, and the single
|
|
352
|
-
EM-to-CTO owner report) as ONE delegation, not a series of separate one-liners restated
|
|
353
|
-
here. `scripts/end-intent` now performs steps 1-5 itself, INCLUDING disarm (worktree
|
|
354
|
-
release plus clearing `delivery.lock`): a single call closes the intent AND clears its
|
|
355
|
-
lock, so exit 0 means both are done. Pass
|
|
356
|
-
`--session` (this session's id, or rely on the `CLAUDE_CODE_SESSION_ID` fallback) so
|
|
357
|
-
disarm resolves the right bridge, and `--index-note` with a rich Completed/Abandoned entry
|
|
358
|
-
description (mode/tier, what shipped or why abandoned, suite result):
|
|
252
|
+
Read `../plastic-conventions/references/completion-and-done.md` for what "intent done" means.
|
|
253
|
+
|
|
254
|
+
1. Verify every checklist item is checked and the suite is green once on the branch.
|
|
255
|
+
2. Write `outcome.md` from `~/.plastic/templates/outcome.md` with `disposition: delivered`.
|
|
256
|
+
3. Release, if configured: match the working directory against `~/.plastic/projects.yml`, read
|
|
257
|
+
`project.yml`'s `release` block, and act on `on_complete` (`commit`, `commit_and_push`,
|
|
258
|
+
`manual`), `verify` (green proceeds; red follows `on_red`: `fix_and_retry` up to twice,
|
|
259
|
+
`stop`, or `manual`), and `on_green` (delegate entirely to `plastic-releasing`).
|
|
260
|
+
4. Review `## Insights` for observations that should become future intents; create them through
|
|
261
|
+
`plastic-intent-creating` and update `chain`.
|
|
262
|
+
5. Close through `plastic-intent-ending`, which runs `scripts/end-intent`: outcome, INDEX,
|
|
263
|
+
savepoint, the store commit, and the disarm (the worktree released, `delivery.lock` cleared,
|
|
264
|
+
the session pointer back on the day ledger), then the QMD reindex last and the single owner
|
|
265
|
+
report. Pass `--session` and `--index-note`:
|
|
359
266
|
```bash
|
|
360
267
|
ruby ~/.plastic/scripts/end-intent --store <store_path> --id <ID> --disposition delivered \
|
|
361
268
|
--session "$CLAUDE_CODE_SESSION_ID" \
|
|
362
|
-
--index-note "<
|
|
269
|
+
--index-note "<what shipped>; <suite result>"
|
|
363
270
|
```
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
present (run `/plastic-doctor check the lock status`), 6 means the structure gate refused
|
|
369
|
-
(see the named reason on stderr; fix via the owning tool named above, then re-run). Two
|
|
370
|
-
steps remain as separate actions after this call succeeds: Step 6 (QMD reindex, async,
|
|
371
|
-
last) and Step 7 (the EM-to-CTO owner report, the single report the owner reads).
|
|
372
|
-
Never leave an orphaned worktree; run `git worktree prune` on a stale reference. If any of
|
|
373
|
-
this ever needs to change, change `plastic-intent-ending`, not this skill.
|
|
271
|
+
Exit 4 means a live foreign session holds the lock; 5 means the worktree is dirty (commit
|
|
272
|
+
first, or pass `--discard-worktree-changes` deliberately); 3 means the lock survived the
|
|
273
|
+
disarm (`/plastic-doctor check the lock status`); 6 means the structure check refused. Never
|
|
274
|
+
leave an orphaned worktree; run `git worktree prune` on a stale reference.
|
|
374
275
|
|
|
375
276
|
## Error Handling
|
|
376
277
|
|
|
377
|
-
If the
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
4. **STOP.** Do not attempt workarounds that could leave the project in a broken state.
|
|
278
|
+
If the team gets stuck (an unresolvable gap, a missing dependency, a suite that stays red):
|
|
279
|
+
log the blocker in `## Insights`, make sure `savepoint.md` reflects the state, notify the user
|
|
280
|
+
("Blocked on intent [ID] - [name]: ..."), and STOP. Never work around a blocker in a way that
|
|
281
|
+
leaves the project broken.
|
|
382
282
|
|
|
383
283
|
## References
|
|
384
284
|
|
|
385
|
-
- Read `references/agent-architecture.md` for the
|
|
386
|
-
|
|
387
|
-
- Read `references/human-report-contract.md` for the
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
285
|
+
- Read `references/agent-architecture.md` for the team model, the risk list, the headless note,
|
|
286
|
+
and the solo fallback when dispatching or when a harness has no agent dispatch.
|
|
287
|
+
- Read `references/human-report-contract.md` for the State/Risk/Call briefing before sending the
|
|
288
|
+
How briefing.
|
|
289
|
+
- Read `references/agent-report-contract.md` for the completion report format when reading a
|
|
290
|
+
dispatched agent's return or synthesizing one.
|
|
291
|
+
- Read `references/end-tail.md` for what `Arm.disarm` does at the End tail and why the reindex
|
|
292
|
+
runs last, before closing an intent.
|