@zalom/plastic 1.0.0-alpha.9 → 1.0.0-beta.10

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 (115) hide show
  1. package/PLASTIC.md +170 -469
  2. package/README.md +95 -58
  3. package/agents/plastic-brainstorming.md +45 -0
  4. package/agents/plastic-enforcer.md +36 -0
  5. package/agents/plastic-executor.md +47 -0
  6. package/agents/{future-intent-researcher.md → plastic-future-intent-researcher.md} +1 -1
  7. package/agents/{intent-curator.md → plastic-intent-curator.md} +8 -6
  8. package/agents/plastic-planner.md +47 -0
  9. package/agents/plastic-spec-specialist.md +45 -0
  10. package/bin/plastic.js +57 -0
  11. package/bin/test +28 -0
  12. package/deprecations.yml +1 -10
  13. package/hooks/auto-arm +5 -0
  14. package/hooks/bash-gate +3 -0
  15. package/hooks/check-update +12 -8
  16. package/hooks/code-gate +12 -0
  17. package/hooks/create-gate +3 -0
  18. package/hooks/gate-check +3 -1
  19. package/hooks/hooks.json +52 -0
  20. package/hooks/qmd-search +8 -0
  21. package/hooks/statusline +150 -41
  22. package/package.json +2 -2
  23. package/scripts/agent-report +142 -0
  24. package/scripts/dashboard.rb +687 -0
  25. package/scripts/doctor.rb +1219 -621
  26. package/scripts/hook-auto-arm +51 -0
  27. package/scripts/hook-bash-gate +41 -0
  28. package/scripts/hook-code-gate +27 -0
  29. package/scripts/hook-continue +15 -114
  30. package/scripts/hook-create-gate +59 -0
  31. package/scripts/hook-gate-check +47 -32
  32. package/scripts/hook-qmd-search +44 -0
  33. package/scripts/hook-session-start +106 -38
  34. package/scripts/install.rb +91 -529
  35. package/scripts/lib/boot_banner.rb +28 -0
  36. package/scripts/lib/bridge.rb +452 -19
  37. package/scripts/lib/frontmatter_writer.rb +130 -0
  38. package/scripts/lib/graph_rebuild.rb +328 -0
  39. package/scripts/lib/installer_core.rb +812 -0
  40. package/scripts/lib/intent_validator.rb +235 -0
  41. package/scripts/lib/links_projection.rb +160 -0
  42. package/scripts/lib/links_section.rb +207 -0
  43. package/scripts/lib/power_tools.rb +76 -0
  44. package/scripts/lib/qmd_hook.rb +57 -0
  45. package/scripts/lib/qmd_sync.rb +230 -0
  46. package/scripts/lib/store_provisioning.rb +100 -0
  47. package/scripts/migrate-to-global +1 -1
  48. package/scripts/new-intent +327 -0
  49. package/scripts/project-links +287 -0
  50. package/scripts/provision-project-store +53 -0
  51. package/scripts/qmd-sync +139 -0
  52. package/scripts/rebuild-graph +244 -0
  53. package/scripts/select-update-target +93 -0
  54. package/scripts/spawn-preamble +138 -0
  55. package/scripts/uninstall.rb +53 -0
  56. package/scripts/update.rb +164 -0
  57. package/scripts/validate-intent +54 -0
  58. package/scripts/versions.rb +141 -0
  59. package/skills/_active-intent-gate.md +1 -1
  60. package/skills/add-project-store/SKILL.md +54 -0
  61. package/skills/auto/SKILL.md +87 -7
  62. package/skills/auto/evals/evals.json +255 -0
  63. package/skills/auto/references/agent-architecture.md +155 -0
  64. package/skills/auto/references/agent-report-contract.md +86 -0
  65. package/skills/brainstorming/SKILL.md +10 -9
  66. package/skills/brainstorming/evals/evals.json +22 -0
  67. package/skills/brainstorming-grill-me/SKILL.md +6 -6
  68. package/skills/continuing/SKILL.md +99 -82
  69. package/skills/continuing/evals/evals.json +145 -0
  70. package/skills/continuing/references/context-management.md +32 -0
  71. package/skills/creating-intent/SKILL.md +82 -36
  72. package/skills/creating-intent/evals/evals.json +72 -0
  73. package/skills/creating-intent/references/lifecycle.md +81 -0
  74. package/skills/creating-intent/references/wikilinks.md +8 -0
  75. package/skills/creating-project/SKILL.md +40 -8
  76. package/skills/creating-project/references/hubs-projects.md +55 -0
  77. package/skills/dashboard/SKILL.md +126 -0
  78. package/skills/dashboard/evals/evals.json +22 -0
  79. package/skills/dashboard/templates/dashboard-global.md +31 -0
  80. package/skills/dashboard/templates/dashboard-project.md +40 -0
  81. package/skills/doctor/SKILL.md +51 -4
  82. package/skills/doctor/references/gates-stuck-detection.md +38 -0
  83. package/skills/doctor/report.md +4 -0
  84. package/skills/evaluating-skills/SKILL.md +140 -0
  85. package/skills/evaluating-skills/assets/eval-template.json +12 -0
  86. package/skills/evaluating-skills/evals/evals.json +75 -0
  87. package/skills/evaluating-skills/references/convention-checks.md +76 -0
  88. package/skills/evaluating-skills/references/eval-methodology.md +154 -0
  89. package/skills/executing-plan/SKILL.md +5 -3
  90. package/skills/install/SKILL.md +69 -8
  91. package/skills/intent-curator/SKILL.md +6 -4
  92. package/skills/intent-curator/evals/evals.json +22 -0
  93. package/skills/linking-intents/SKILL.md +22 -7
  94. package/skills/linking-intents/evals/evals.json +22 -0
  95. package/skills/linking-intents/references/zettelkasten.md +45 -0
  96. package/skills/managing-index/SKILL.md +11 -1
  97. package/skills/managing-index/evals/evals.json +22 -0
  98. package/skills/managing-index/references/zettelkasten-linking.md +7 -2
  99. package/skills/releasing/SKILL.md +80 -23
  100. package/skills/releasing/references/deprecations.md +60 -0
  101. package/skills/research/SKILL.md +10 -2
  102. package/skills/research/evals/evals.json +22 -0
  103. package/skills/savepoint/SKILL.md +46 -37
  104. package/skills/savepoint/references/context-management.md +32 -0
  105. package/skills/uninstall/SKILL.md +39 -28
  106. package/skills/update/SKILL.md +41 -44
  107. package/skills/versions/SKILL.md +65 -0
  108. package/skills/writing-instructions/SKILL.md +159 -0
  109. package/skills/writing-instructions/references/agentskills-spec.md +135 -0
  110. package/skills/writing-plans/SKILL.md +5 -5
  111. package/templates/agents.md +7 -7
  112. package/templates/outcome.md +13 -0
  113. package/templates/savepoint.md +14 -13
  114. package/templates/spec.md +25 -0
  115. package/bin/install.js +0 -29
@@ -0,0 +1,255 @@
1
+ {
2
+ "skill_name": "plastic-auto",
3
+ "notes": "Intent 27. Scopes: description triggering (1-8) and behavior/output quality (9). Assertions written after observing Step-3 runs (one clean subagent router per case). Intent 63 added cases 10-11 (auto-mode enforcer-led team spin-up and solo fallback).",
4
+ "results": {
5
+ "triggering": {
6
+ "cases": 8,
7
+ "passed": 8,
8
+ "pass_at_1": 1.0,
9
+ "run": "2026-06-10, one subagent per case"
10
+ },
11
+ "behavior": {
12
+ "cases": 1,
13
+ "passed": 1,
14
+ "evidence": "dogfood: intent 27 itself delivered via auto produced spec->plan->checklist before any code edit; code-gate unit test proves pre-How project-code edits are blocked"
15
+ }
16
+ },
17
+ "evals": [
18
+ {
19
+ "id": 1,
20
+ "scope": "triggering",
21
+ "set": "train",
22
+ "prompt": "auto",
23
+ "expected_output": "Activates plastic-auto (the bare 'auto' keyword is the documented trigger).",
24
+ "files": [],
25
+ "assertions": [
26
+ {
27
+ "type": "code",
28
+ "check": "router CHOICE == plastic-auto",
29
+ "observed": "plastic-auto",
30
+ "result": "pass"
31
+ }
32
+ ]
33
+ },
34
+ {
35
+ "id": 2,
36
+ "scope": "triggering",
37
+ "set": "train",
38
+ "prompt": "take it from here and deliver intent 27 end to end",
39
+ "expected_output": "Activates plastic-auto (autonomous delivery of an active intent).",
40
+ "files": [],
41
+ "assertions": [
42
+ {
43
+ "type": "code",
44
+ "check": "router CHOICE == plastic-auto",
45
+ "observed": "plastic-auto",
46
+ "result": "pass"
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ "id": 3,
52
+ "scope": "triggering",
53
+ "set": "validation",
54
+ "prompt": "go fully autonomous on the active intent, don't ask me questions",
55
+ "expected_output": "Activates plastic-auto.",
56
+ "files": [],
57
+ "assertions": [
58
+ {
59
+ "type": "code",
60
+ "check": "router CHOICE == plastic-auto",
61
+ "observed": "plastic-auto",
62
+ "result": "pass"
63
+ }
64
+ ]
65
+ },
66
+ {
67
+ "id": 4,
68
+ "scope": "triggering",
69
+ "set": "train",
70
+ "prompt": "deliver this intent for me",
71
+ "expected_output": "Activates plastic-auto.",
72
+ "files": [],
73
+ "assertions": [
74
+ {
75
+ "type": "code",
76
+ "check": "router CHOICE == plastic-auto",
77
+ "observed": "plastic-auto",
78
+ "result": "pass"
79
+ }
80
+ ]
81
+ },
82
+ {
83
+ "id": 5,
84
+ "scope": "triggering",
85
+ "set": "train",
86
+ "prompt": "set up a hook to automatically format the file on every save",
87
+ "expected_output": "Does NOT activate plastic-auto. Near-miss: shares 'auto*' but is a settings/hooks task (update-config).",
88
+ "files": [],
89
+ "assertions": [
90
+ {
91
+ "type": "code",
92
+ "check": "router CHOICE != plastic-auto",
93
+ "observed": "update-config",
94
+ "result": "pass"
95
+ }
96
+ ]
97
+ },
98
+ {
99
+ "id": 6,
100
+ "scope": "triggering",
101
+ "set": "validation",
102
+ "prompt": "deliver the built package to the dist directory",
103
+ "expected_output": "Does NOT activate plastic-auto. Near-miss: shares 'deliver' but is a build/file task.",
104
+ "files": [],
105
+ "assertions": [
106
+ {
107
+ "type": "code",
108
+ "check": "router CHOICE != plastic-auto",
109
+ "observed": "none",
110
+ "result": "pass"
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "id": 7,
116
+ "scope": "triggering",
117
+ "set": "train",
118
+ "prompt": "create a new intent for the dashboard idea",
119
+ "expected_output": "Does NOT activate plastic-auto; activates plastic-creating-intent.",
120
+ "files": [],
121
+ "assertions": [
122
+ {
123
+ "type": "code",
124
+ "check": "router CHOICE != plastic-auto",
125
+ "observed": "plastic-creating-intent",
126
+ "result": "pass"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "id": 8,
132
+ "scope": "triggering",
133
+ "set": "validation",
134
+ "prompt": "what's the status of my active intents?",
135
+ "expected_output": "Does NOT activate plastic-auto; this is a read/continuing/managing-index query.",
136
+ "files": [],
137
+ "assertions": [
138
+ {
139
+ "type": "code",
140
+ "check": "router CHOICE != plastic-auto",
141
+ "observed": "plastic-managing-index",
142
+ "result": "pass"
143
+ }
144
+ ]
145
+ },
146
+ {
147
+ "id": 9,
148
+ "scope": "behavior",
149
+ "set": "train",
150
+ "prompt": "Active intent X exists with only a '## Intent' section. Deliver it in auto mode.",
151
+ "expected_output": "Arms the lifecycle gate first, then produces spec.md (Why), then plan.md + actions/ + checklist.md (How), and edits NO project code before plan.md + checklist.md exist. Disarms on completion.",
152
+ "files": [],
153
+ "assertions": [
154
+ {
155
+ "type": "human",
156
+ "check": "spec.md written before plan.md before any project-code edit",
157
+ "observed": "dogfood run of intent 27 followed this order",
158
+ "result": "pass"
159
+ },
160
+ {
161
+ "type": "code",
162
+ "check": "code-gate blocks project-code Edit/Write while pre-How (test/code_gate_test.rb)",
163
+ "observed": "test green",
164
+ "result": "pass"
165
+ }
166
+ ]
167
+ },
168
+ {
169
+ "id": 10,
170
+ "scope": "behavior",
171
+ "set": "train",
172
+ "prompt": "Active intent X exists. Deliver it in auto mode on a harness that supports subagents.",
173
+ "expected_output": "Spins up one enforcer-led team per intent (brainstorming, spec-specialist, planner, executor, plastic-enforcer). The enforcer IS the orchestrator. Dispatches one specialist per stage sequentially on one branch, gating each deliverable (Context+Decisions, then spec.md, then plan.md+actions+checklist, then code) against the stage exit criteria before handoff, and dispatches an independent reviewer subagent at the final gate only.",
174
+ "files": [],
175
+ "assertions": [
176
+ {
177
+ "type": "human",
178
+ "check": "five-role roster spun up; specialists dispatched stage-sequentially with per-stage gating; independent reviewer only at final gate",
179
+ "observed": "dogfood: intents 60-62 delivered by exactly this enforcer-led team on a shared branch",
180
+ "result": "pass"
181
+ },
182
+ {
183
+ "type": "code",
184
+ "check": "agents/plastic-*.md role files ship and install into the harness agent dir, manifest-tracked (test/install_packaging_test.rb)",
185
+ "observed": "test green",
186
+ "result": "pass"
187
+ }
188
+ ]
189
+ },
190
+ {
191
+ "id": 11,
192
+ "scope": "behavior",
193
+ "set": "validation",
194
+ "prompt": "Active intent X exists. Deliver it in auto mode on a harness with no subagent dispatch.",
195
+ "expected_output": "Falls back to a single agent walking the full What, Why, How, Exec cycle itself, preserving current behavior. The enforcer gate discipline still applies (arm the gate first, no project-code edits before plan.md + checklist.md exist).",
196
+ "files": [],
197
+ "assertions": [
198
+ {
199
+ "type": "human",
200
+ "check": "solo agent walks the full cycle when subagent dispatch is unavailable; gate discipline preserved",
201
+ "observed": "SKILL.md Team Spin-Up documents the solo fallback explicitly",
202
+ "result": "pass"
203
+ }
204
+ ]
205
+ },
206
+ {
207
+ "id": 12,
208
+ "scope": "behavior",
209
+ "set": "validation",
210
+ "prompt": "A power-tool is present (qmd on PATH, or a .serena marker / serena on PATH). A substantive prompt arrives in auto mode.",
211
+ "expected_output": "The UserPromptSubmit power-tools hook appends a MANDATORY obligation per present tool: a MUST-use-QMD line when qmd is present (to check for an existing or related intent before treating work as new), and a MUST-use-Serena line when serena is present (symbolic tools before grep/Read). QMD hits are still injected when above threshold.",
212
+ "files": [],
213
+ "assertions": [
214
+ {
215
+ "type": "code",
216
+ "check": "PowerTools.mandate returns MUST/MANDATORY lines for each present tool; QmdHook.run appends the mandate",
217
+ "observed": "power_tools_test.rb + qmd_hook_test.rb assert MUST wording; serena line gated on the serena detector",
218
+ "result": "pass"
219
+ }
220
+ ]
221
+ },
222
+ {
223
+ "id": 13,
224
+ "scope": "behavior",
225
+ "set": "validation",
226
+ "prompt": "Neither qmd nor serena is present (no qmd on PATH, no .serena marker, no serena on PATH). A substantive prompt arrives.",
227
+ "expected_output": "Detect-then-degrade: the hook emits nothing (silent no-op, exit 0). No mandate text appears. Nothing is required to install.",
228
+ "files": [],
229
+ "assertions": [
230
+ {
231
+ "type": "code",
232
+ "check": "PowerTools.mandate returns nil and QmdHook.run returns nil when neither tool is present",
233
+ "observed": "power_tools_test.rb test_mandate_neither_is_nil + qmd_hook_test.rb test_nil_when_neither_tool_present",
234
+ "result": "pass"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "id": 14,
240
+ "scope": "behavior",
241
+ "set": "validation",
242
+ "prompt": "QMD is present. In auto mode the user says: deliver the work on the uploader retry policy (no intent id given).",
243
+ "expected_output": "Before scanning the store with grep/Read to find the matching intent, runs `ruby ~/.plastic/scripts/qmd-sync search \"uploader retry policy\"` to surface the candidate intent, then opens the authoritative intent file for the hit it takes over. This discovery step is distinct from the completion-time reindex step. No-op fallback to INDEX.md / file scan when QMD is absent.",
244
+ "files": [],
245
+ "assertions": [
246
+ {
247
+ "type": "human",
248
+ "check": "qmd-sync search is run before grep/Read during discovery; authoritative file opened for the hit; reindex step stays separate",
249
+ "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",
250
+ "result": "pass"
251
+ }
252
+ ]
253
+ }
254
+ ]
255
+ }
@@ -0,0 +1,155 @@
1
+ # Agent Architecture
2
+
3
+ ## Main Orchestrator
4
+
5
+ The Main Orchestrator manages the global store (Main Knowledge Base). It:
6
+ - Recognizes, creates, updates, and groups intents
7
+ - Spawns Project Orchestrators for registered projects
8
+ - Receives contributions back from Project Orchestrators
9
+ - Is the only agent that runs in a loop (continuous Build, Observe, Repeat)
10
+
11
+ ## Project Orchestrators
12
+
13
+ Project Orchestrators manage project stores (Project Knowledge Bases). They:
14
+ - Care about intents and execution within their project
15
+ - Spin up an enforcer-led team to deliver an intent
16
+ - Contribute back to the Main Orchestrator when new intents are born
17
+ that could enrich the Main Knowledge Base
18
+
19
+ ## The Auto-Mode Team
20
+
21
+ Auto mode spins up exactly ONE enforcer-led team per intent. The plastic-enforcer
22
+ IS the auto orchestrator itself, not a separately dispatched agent. Making the
23
+ orchestrator the enforcer avoids the who-gates-the-gater regress (the gate-keeper
24
+ can never be ungated).
25
+
26
+ The team has five roles, one per place in the What, Why, How, Exec cycle:
27
+
28
+ - **plastic-brainstorming** (Why exploration): enriches `## Context` and records
29
+ `### Decisions` with rationale.
30
+ - **plastic-spec-specialist** (Why-to-How boundary): consolidates the Why into
31
+ `spec.md` (Problem, Goals, Non-Goals, Approach, Decisions, Acceptance Criteria).
32
+ - **plastic-planner** (How): produces `plan.md`, `actions/ACTION_N.md`, and
33
+ `checklist.md`.
34
+ - **plastic-executor** (Exec): writes the code, checks off `checklist.md`, appends
35
+ `## Insights`, and drives the suite green.
36
+ - **plastic-enforcer** (spans the whole cycle): orchestrates and gates.
37
+
38
+ ### Handoff Contracts
39
+
40
+ Each specialist receives the prior stage's deliverable and produces the next stage's
41
+ input. The enforcer dispatches one specialist per stage with a constructed context
42
+ bundle, gates that deliverable against the stage's exit criteria, and only then hands
43
+ off to the next stage. Dispatch is sequential on a single branch, because the stage
44
+ deliverables share files (a parked spec, plan, and checklist all live in the same
45
+ intent directory).
46
+
47
+ The chain: intent `## Intent` / `## Context`, then enriched `## Context` plus
48
+ `### Decisions`, then `spec.md`, then `plan.md` plus `actions/` plus `checklist.md`,
49
+ then the code changes plus a checked-off checklist plus `## Insights`.
50
+
51
+ ### Spawn Preamble (L2 live-state injection)
52
+
53
+ Every dispatched specialist is booted with a spawn preamble: the enforcer runs
54
+ `scripts/spawn-preamble <intent_dir> --role <role>` and prepends its output to the
55
+ specialist's prompt. The preamble is a pure function of the intent directory on disk
56
+ (no network, no clock, no randomness), so it is deterministic and rebuildable. It
57
+ carries the active intent id and intent line, the current lifecycle stage (the last
58
+ savepoint line, else stage derived from which lifecycle files exist), the cycle
59
+ role, and the honoring instruction that the agent must emit valid lifecycle artifacts
60
+ and not hallucinate intents or stages. This is the standard L2 live-state mechanism
61
+ for harnesses whose spawned sub-agents do not inherit the top-level session event. See
62
+ `docs/reference/harness-adapters.md` for how it slots into the per-harness contract.
63
+
64
+ ### Completion Reports
65
+
66
+ Every dispatched specialist ends its turn with a structured completion report as its final
67
+ message (its return value), so the agent that did the work is the one that accounts for it. The
68
+ report carries a common envelope plus a role-specific payload that fulfils the agent's place in
69
+ the cycle; the planner explains the plan back to the orchestrator, the executor reports what was
70
+ built and the test result, and so on. The format lives in `references/agent-report-contract.md`,
71
+ and the verbatim instruction is injected once via the spawn preamble's `REPORT_CONTRACT`
72
+ constant, which the role prompts reproduce.
73
+
74
+ Enforcement is require-report then synthesize-fallback. The preamble and prompts make the report
75
+ mandatory (decision-shaping), but child-agent honor is best-effort across harnesses (Tier B/C),
76
+ so it is never a hard block. When a specialist returns no usable report, the enforcer runs
77
+ `scripts/agent-report <intent_dir> --role <role>`, a pure function of the intent dir (no network,
78
+ clock, or randomness, mirroring `spawn-preamble`) that emits a filesystem-derived report from the
79
+ savepoint, the artifacts present, the checklist checked/total, and the outcome line. A handoff
80
+ account therefore always exists: agent-authored when present, deterministically reconstructed
81
+ otherwise. This structures the finish notification only; in-flight observations stay in
82
+ `## Insights`, no progress chatter is added.
83
+
84
+ ### Gate Ownership
85
+
86
+ The enforcer arms and verifies the lifecycle gate, then gates every stage transition.
87
+ It never delegates gate ownership. At the final gate only, it dispatches an
88
+ INDEPENDENT reviewer subagent to review the delivered work. That reviewer is not a
89
+ permanent sixth role, it exists only for the final review.
90
+
91
+ ### Headless Manual Gate
92
+
93
+ When running headless or in the background, the enforcer enforces gates manually and
94
+ does not rely on hooks, because `CLAUDE_SESSION_ID` may be unset in those runs (the
95
+ gate-check and savepoint hooks no-op without it). The enforcer arms via the bridge's
96
+ derived-key fallback and verifies state itself.
97
+
98
+ ### Delegation
99
+
100
+ The roles are thin handoff contracts, not a spawning engine. Dispatch and review run
101
+ by default through Plastic's own engine, `plastic-executing-plan` (implementer plus
102
+ two-stage review, no external plugin). When `superpowers:subagent-driven-development`
103
+ and `superpowers:dispatching-parallel-agents` are available, or the user asks for them,
104
+ they delegate to those as an enhancement. The team model defines who hands what to whom
105
+ and where the gates sit; the dispatch engine, native or superpowers, does the actual
106
+ spawning.
107
+
108
+ ### Fallback by Case
109
+
110
+ The default is always Plastic's native engine, so a user without superpowers still gets
111
+ the full behavior. If the harness supports subagents but superpowers is absent, auto
112
+ mode dispatches through `plastic-executing-plan`. If the harness has no subagent dispatch
113
+ at all, auto mode falls back to a single agent walking the full What, Why, How, Exec
114
+ cycle itself. The enforcer's gate discipline still applies in every case.
115
+
116
+ ### Dogfood Proof
117
+
118
+ Intents 60, 61, and 62 were delivered by exactly this enforcer-led team on a shared
119
+ branch, which is the dogfooded proof that the model works end to end.
120
+
121
+ ## Two Modes
122
+
123
+ - **Human-driven:** Human chats with the Main Orchestrator, creates intents,
124
+ brainstorms, then the Main Orchestrator dispatches Project Orchestrators and teams
125
+ for execution.
126
+ - **Autonomous:** Human gives the Main Orchestrator a starting intent with defined
127
+ outcomes. The enforcer-led team runs the full cycle (the specialists do the
128
+ lifecycle, the enforcer reviews Insights and gates), then the orchestrator spawns
129
+ next intents and dispatches again.
130
+
131
+ ## Autonomous Delivery
132
+
133
+ Human owns What and Why for human-initiated intents. The team assists (research,
134
+ exploration) but the human drives until handoff. When Why is complete, or the human
135
+ triggers `plastic-auto`, the enforcer-led team takes over How and Exec autonomously.
136
+
137
+ - **Safe-by-default:** the executor always prefers non-destructive routes (rename vs
138
+ delete, additive migrations, backups before changes). Destructive actions on
139
+ existing projects require human approval unless `--skip-permissions` is set.
140
+ - **Notification only on:** finish or hard stop (blocked on destructive action,
141
+ unresolvable error). No progress reports, `## Insights` tracks everything.
142
+ - **Greenfield autonomy:** during initial project creation, all decisions are
143
+ non-destructive (nothing to destroy), so the team has full autonomy for greenfield
144
+ choices.
145
+ - **Autonomous decisions** are logged in `## Insights` with the `(autonomous)` marker.
146
+
147
+ ## Coordinator Loop
148
+
149
+ When "work on Project X":
150
+ 1. Read `projects.yml`, find the project path
151
+ 2. Load global config (defaults)
152
+ 3. Load project config (overrides)
153
+ 4. Load global INDEX.md, find hub intents tagged `project-<name>`
154
+ 5. Load project INDEX.md, find tactical intents
155
+ 6. The coordinator has the full picture, spins up an enforcer-led team per intent
@@ -0,0 +1,86 @@
1
+ # Agent Completion Report Contract
2
+
3
+ Every agent dispatched by the auto-mode enforcer MUST end its turn with a structured
4
+ completion report. This doc defines that report: one common envelope plus a per-role payload.
5
+ It is the format the `REPORT_CONTRACT` constant in `scripts/spawn-preamble` points at, the
6
+ role prompts (`agents/plastic-*.md`) reproduce, and the deterministic fallback
7
+ (`scripts/agent-report`) approximates. Keep all four in agreement; the constant in
8
+ `scripts/spawn-preamble` is the single source of truth for the injected wording.
9
+
10
+ ## Purpose
11
+
12
+ The report is the agent's FINAL MESSAGE (its return value), not a side-channel file. Every
13
+ harness hands a spawned agent's final text back to the dispatcher, so the final message is the
14
+ one carrier that works everywhere (decision D1). The report structures the FINISH notification
15
+ only. In-flight observations still go in `## Insights`; the report does not add progress chatter
16
+ (decision D5). An agent that finishes correct artifacts but goes idle without a report has not
17
+ completed its handoff: the agent that did the work is the cheapest, most accurate source of the
18
+ account.
19
+
20
+ ## Common envelope
21
+
22
+ Every role report, whatever the stage, carries these fields:
23
+
24
+ - **Role**: which specialist produced this (brainstorming, spec, planner, executor, reviewer).
25
+ - **Intent id and stage**: the active intent id and the cycle stage just completed.
26
+ - **Status**: `delivered` or `blocked`.
27
+ - **Artifacts written**: the files produced or changed (store paths, and project paths for the
28
+ executor).
29
+ - **Verification / tests run**: the command run and its result, or `n/a` for stages that write
30
+ no code.
31
+ - **Checklist deltas**: which checklist items this turn checked off (executor), or `n/a`.
32
+ - **Deviations from spec**: anything done differently from the spec or plan, and why, or `none`.
33
+ - **Blockers / handoff notes**: what the next stage must watch for, or `none`.
34
+
35
+ ## Per-role payload
36
+
37
+ Each role appends a payload that fulfils its place in the What, Why, How, Exec cycle (decision
38
+ D2). The payload is what makes the report useful to the orchestrator beyond the envelope.
39
+
40
+ ### brainstorming (Why exploration)
41
+ - Decisions recorded in `### Decisions`, each with its one-line rationale.
42
+ - Context enriched: what was researched and the key findings.
43
+ - Open questions resolved, and any deliberately left for the spec.
44
+
45
+ ### spec-specialist (Why to How boundary)
46
+ - Spec sections produced (Problem, Goals, Non-Goals, Approach, Decisions, Acceptance Criteria).
47
+ - How the recorded decisions resolved into the chosen approach.
48
+ - Acceptance-criteria count, so the planner knows the surface to cover.
49
+
50
+ ### planner (How): worked exemplar
51
+ The planner report EXPLAINS THE PLAN BACK TO THE ORCHESTRATOR. It carries:
52
+ - The ordered actions, one line each: what the action does and how it is verified.
53
+ - Decomposition rationale: why this order, and why the actions are independent.
54
+ - Checklist coverage: item count and that every action plus suite-green is covered.
55
+ This is the exemplar because the plan is an argument, and the orchestrator gates on whether that
56
+ argument is sound before any code is written.
57
+
58
+ ### executor (Exec)
59
+ - Actions implemented this turn, mapped to checklist items checked off (checked / total).
60
+ - A summary of the code changed (files and the shape of the change).
61
+ - Test result: the full-suite command and its pass / fail counts.
62
+ - Insights appended, with the `(autonomous)` marker.
63
+
64
+ ### final reviewer (final gate)
65
+ - Verdict: `pass` or `blockers found`.
66
+ - Each acceptance criterion checked, with the evidence that confirms or refutes it.
67
+ - Gaps or risks found, ranked, with a recommended disposition.
68
+
69
+ ## Fallback: always a report
70
+
71
+ Decision-shaping (the preamble plus these prompts) makes the report mandatory, but child-agent
72
+ honor is best-effort across harnesses (Tier B/C in `docs/reference/harness-adapters.md`), so the
73
+ contract is never a hard block (decision D3). When a dispatched agent returns no usable report
74
+ (it went idle, emitted only a bare ping, or its message was lost to a mid-run interjection), the
75
+ enforcer synthesizes one:
76
+
77
+ ```
78
+ scripts/agent-report <intent_dir> --role <role>
79
+ ```
80
+
81
+ `scripts/agent-report` is a pure function of the intent directory (no network, clock, or
82
+ randomness, mirroring `scripts/spawn-preamble`): it reads the current stage from the savepoint
83
+ ledger, the lifecycle artifacts present, the checklist checked / total, and the `## Outcome`
84
+ line, and emits a filesystem-derived report labelled `synthesized`. So a handoff account always
85
+ exists: authored by the agent when possible, reconstructed deterministically when not. This
86
+ formalizes the by-hand reconstruction the orchestrator did while delivering intent 68.
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: plastic:brainstorming
2
+ name: plastic-brainstorming
3
3
  description: "Explore intent requirements and design before implementation. Produces spec.md in the active intent directory."
4
4
  ---
5
5
 
@@ -20,7 +20,7 @@ Do NOT invoke any implementation skill, write any code, scaffold any project, or
20
20
  Before proceeding, resolve the active intent:
21
21
 
22
22
  1. **Detect store:** Read `~/.plastic/projects.yml`, match CWD against registered project paths. If match → project store at `~/.plastic/projects/{slug}/store/`. If no match → global store at `~/.plastic/store/`.
23
- 2. **Find active intent:** Read `INDEX.md` from the detected store. Look under `## Active`. If exactly one → use it. If multiple → ask which. If none → refuse: "No active intent. Create one first with /plastic:creating-intent"
23
+ 2. **Find active intent:** Read `INDEX.md` from the detected store. Look under `## Active`. If exactly one → use it. If multiple → ask which. If none → refuse: "No active intent. Create one first with /plastic-creating-intent"
24
24
  3. **Resolve intent directory:** `{store}/store/{id}--{slug}/`
25
25
 
26
26
  All artifacts go to the intent directory. Never write to external paths.
@@ -40,7 +40,7 @@ You MUST create a task for each of these items and complete them in order:
40
40
  5. **Write spec** — save to `{intent_dir}/spec.md` and commit to store repo
41
41
  6. **Spec self-review** — placeholder scan, consistency, scope, ambiguity
42
42
  7. **User reviews written spec** — ask user to review before proceeding
43
- 8. **Transition to planning** — invoke `plastic:writing-plans`
43
+ 8. **Transition to planning** — invoke `plastic-writing-plans`
44
44
 
45
45
  ## Process Flow
46
46
 
@@ -54,7 +54,7 @@ digraph brainstorming {
54
54
  "Write spec" [shape=box];
55
55
  "Spec self-review\n(fix inline)" [shape=box];
56
56
  "User reviews spec?" [shape=diamond];
57
- "Invoke plastic:writing-plans" [shape=doublecircle];
57
+ "Invoke plastic-writing-plans" [shape=doublecircle];
58
58
 
59
59
  "Explore project context" -> "Ask clarifying questions";
60
60
  "Ask clarifying questions" -> "Propose 2-3 approaches";
@@ -65,15 +65,16 @@ digraph brainstorming {
65
65
  "Write spec" -> "Spec self-review\n(fix inline)";
66
66
  "Spec self-review\n(fix inline)" -> "User reviews spec?";
67
67
  "User reviews spec?" -> "Write spec" [label="changes requested"];
68
- "User reviews spec?" -> "Invoke plastic:writing-plans" [label="approved"];
68
+ "User reviews spec?" -> "Invoke plastic-writing-plans" [label="approved"];
69
69
  }
70
70
  ```
71
71
 
72
- **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`.
72
+ **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
73
 
74
74
  ## The Process
75
75
 
76
76
  **Understanding the idea:**
77
+ - QMD-first (when available): before scanning the store with grep/Read for prior decisions, specs, or outcomes, run `ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or related intents, then open the authoritative intent file for any hit you act on. The command is a no-op when QMD is absent, so fall back to the existing INDEX.md / file scan.
77
78
  - Check out the current project state first (files, docs, recent commits)
78
79
  - Before asking detailed questions, assess scope: if the request describes multiple independent subsystems (e.g., "build a platform with chat, file storage, billing, and analytics"), flag this immediately. Don't spend questions refining details of a project that needs to be decomposed first.
79
80
  - If the project is too large for a single spec, help the user decompose into sub-projects: what are the independent pieces, how do they relate, what order should they be built? Then brainstorm the first sub-project through the normal design flow. Each sub-project gets its own spec → plan → implementation cycle.
@@ -107,7 +108,7 @@ digraph brainstorming {
107
108
 
108
109
  ## After the Design
109
110
  **Documentation:**
110
- - Write the validated design (spec) to `{intent_dir}/spec.md`
111
+ - Write the validated design (spec) to `{intent_dir}/spec.md` using the `${CLAUDE_PLUGIN_ROOT}/templates/spec.md` form
111
112
  - Use elements-of-style:writing-clearly-and-concisely skill if available
112
113
  - Commit to the store repo:
113
114
  ```
@@ -130,8 +131,8 @@ After the spec review loop passes, ask the user to review the written spec befor
130
131
  Wait for the user's response. If they request changes, make them and re-run the spec review loop. Only proceed once the user approves.
131
132
 
132
133
  **Implementation:**
133
- - Invoke `plastic:writing-plans` to create the implementation plan
134
- - Do NOT invoke any other skill. `plastic:writing-plans` is the next step.
134
+ - Invoke `plastic-writing-plans` to create the implementation plan
135
+ - Do NOT invoke any other skill. `plastic-writing-plans` is the next step.
135
136
 
136
137
  ## Key Principles
137
138
 
@@ -0,0 +1,22 @@
1
+ {
2
+ "skill_name": "plastic-brainstorming",
3
+ "notes": "Intent 66a. Spec for the QMD-first step in the Why/explore-context phase (surface prior decisions/specs/outcomes before grep/Read). Runner is intent 76; spec only.",
4
+ "evals": [
5
+ {
6
+ "id": 1,
7
+ "scope": "behavior",
8
+ "set": "validation",
9
+ "prompt": "QMD is present. Brainstorming the active intent during the Why phase, the agent needs prior decisions and specs on caching.",
10
+ "expected_output": "In the explore-project-context (Why) step, before scanning the store with grep/Read, runs `ruby ~/.plastic/scripts/qmd-sync search \"caching decisions\"` to surface prior decisions, specs, or outcomes, then opens the authoritative intent file for any hit it acts on. No-op fallback to INDEX.md / file scan when QMD is absent.",
11
+ "files": [],
12
+ "assertions": [
13
+ {
14
+ "type": "human",
15
+ "check": "qmd-sync search is run during Why before grep/Read; authoritative file opened for any hit",
16
+ "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",
17
+ "result": "pass"
18
+ }
19
+ ]
20
+ }
21
+ ]
22
+ }
@@ -1,9 +1,9 @@
1
1
  ---
2
- name: plastic:brainstorming-grill-me
2
+ name: plastic-brainstorming-grill-me
3
3
  description: >-
4
4
  Deep brainstorming that interviews the user relentlessly about a plan or design until reaching shared understanding.
5
5
  Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
6
- Complements superpowers:brainstorming — use brainstorming for quick ideation, grill-me for thorough interrogation.
6
+ Pair with plastic-brainstorming for quick ideation and use grill-me for thorough interrogation. If superpowers:brainstorming is installed it complements this skill, but it is not required.
7
7
  ---
8
8
 
9
9
  # Grill Me — Deep Brainstorming
@@ -83,18 +83,18 @@ If ALL items pass, offer autonomous delivery:
83
83
  >
84
84
  > Want to grill more, or should I go autonomous?"
85
85
 
86
- - If human says go → invoke `plastic:auto`
86
+ - If human says go → invoke `plastic-auto`
87
87
  - If human says grill more → continue grilling (reset to step 2)
88
88
  - If human says neither (wants to drive manually) → proceed as before (offer planning)
89
89
 
90
90
  This offer replaces the final question in Close Out ("Ready to plan implementation, or do you want another pass?"). The new options are:
91
- 1. Go autonomous (`plastic:auto`)
91
+ 1. Go autonomous (`plastic-auto`)
92
92
  2. Grill more (continue interrogation)
93
93
  3. Plan manually (invoke `superpowers:writing-plans` or proceed with human-driven planning)
94
94
 
95
95
  ## Relationship to superpowers:brainstorming
96
96
 
97
- | | superpowers:brainstorming | plastic:brainstorming-grill-me |
97
+ | | superpowers:brainstorming | plastic-brainstorming-grill-me |
98
98
  |---|---|---|
99
99
  | Speed | Quick (5-10 min) | Thorough (20-45 min) |
100
100
  | Depth | Surface-level exploration | Exhaustive decision tree |
@@ -102,4 +102,4 @@ This offer replaces the final question in Close Out ("Ready to plan implementati
102
102
  | Output | Initial spec | Battle-tested spec with all branches resolved |
103
103
  | Style | Collaborative, exploratory | Interrogative, relentless |
104
104
 
105
- Use `superpowers:brainstorming` to generate ideas. Use `plastic:brainstorming-grill-me` to pressure-test them.
105
+ Use `superpowers:brainstorming` to generate ideas. Use `plastic-brainstorming-grill-me` to pressure-test them.