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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/PLASTIC.md +154 -469
  2. package/README.md +95 -58
  3. package/agents/plastic-brainstorming.md +37 -0
  4. package/agents/plastic-enforcer.md +36 -0
  5. package/agents/plastic-executor.md +37 -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} +1 -1
  8. package/agents/plastic-planner.md +37 -0
  9. package/agents/plastic-spec-specialist.md +37 -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/package.json +2 -2
  22. package/scripts/dashboard.rb +685 -0
  23. package/scripts/doctor.rb +987 -632
  24. package/scripts/hook-auto-arm +51 -0
  25. package/scripts/hook-bash-gate +41 -0
  26. package/scripts/hook-code-gate +27 -0
  27. package/scripts/hook-continue +15 -114
  28. package/scripts/hook-create-gate +59 -0
  29. package/scripts/hook-gate-check +47 -32
  30. package/scripts/hook-qmd-search +44 -0
  31. package/scripts/hook-session-start +106 -38
  32. package/scripts/install.rb +91 -529
  33. package/scripts/lib/boot_banner.rb +28 -0
  34. package/scripts/lib/bridge.rb +404 -19
  35. package/scripts/lib/installer_core.rb +807 -0
  36. package/scripts/lib/intent_validator.rb +156 -0
  37. package/scripts/lib/qmd_hook.rb +44 -0
  38. package/scripts/lib/qmd_sync.rb +209 -0
  39. package/scripts/lib/store_provisioning.rb +100 -0
  40. package/scripts/migrate-to-global +1 -1
  41. package/scripts/new-intent +177 -0
  42. package/scripts/provision-project-store +53 -0
  43. package/scripts/qmd-sync +92 -0
  44. package/scripts/select-update-target +93 -0
  45. package/scripts/spawn-preamble +121 -0
  46. package/scripts/uninstall.rb +53 -0
  47. package/scripts/update.rb +164 -0
  48. package/scripts/validate-intent +54 -0
  49. package/scripts/versions.rb +141 -0
  50. package/skills/_active-intent-gate.md +1 -1
  51. package/skills/add-project-store/SKILL.md +54 -0
  52. package/skills/auto/SKILL.md +77 -7
  53. package/skills/auto/evals/evals.json +207 -0
  54. package/skills/auto/references/agent-architecture.md +135 -0
  55. package/skills/brainstorming/SKILL.md +9 -9
  56. package/skills/brainstorming-grill-me/SKILL.md +6 -6
  57. package/skills/continuing/SKILL.md +92 -82
  58. package/skills/continuing/evals/evals.json +136 -0
  59. package/skills/continuing/references/context-management.md +32 -0
  60. package/skills/creating-intent/SKILL.md +59 -33
  61. package/skills/creating-intent/references/lifecycle.md +73 -0
  62. package/skills/creating-intent/references/wikilinks.md +8 -0
  63. package/skills/creating-project/SKILL.md +40 -8
  64. package/skills/creating-project/references/hubs-projects.md +55 -0
  65. package/skills/dashboard/SKILL.md +121 -0
  66. package/skills/dashboard/templates/dashboard-global.md +31 -0
  67. package/skills/dashboard/templates/dashboard-project.md +40 -0
  68. package/skills/doctor/SKILL.md +51 -4
  69. package/skills/doctor/references/gates-stuck-detection.md +38 -0
  70. package/skills/doctor/report.md +4 -0
  71. package/skills/evaluating-skills/SKILL.md +140 -0
  72. package/skills/evaluating-skills/assets/eval-template.json +12 -0
  73. package/skills/evaluating-skills/evals/evals.json +75 -0
  74. package/skills/evaluating-skills/references/convention-checks.md +76 -0
  75. package/skills/evaluating-skills/references/eval-methodology.md +154 -0
  76. package/skills/executing-plan/SKILL.md +5 -3
  77. package/skills/install/SKILL.md +69 -8
  78. package/skills/intent-curator/SKILL.md +3 -3
  79. package/skills/linking-intents/SKILL.md +5 -1
  80. package/skills/linking-intents/references/zettelkasten.md +33 -0
  81. package/skills/managing-index/SKILL.md +5 -1
  82. package/skills/releasing/SKILL.md +80 -23
  83. package/skills/releasing/references/deprecations.md +60 -0
  84. package/skills/research/SKILL.md +2 -2
  85. package/skills/savepoint/SKILL.md +46 -37
  86. package/skills/savepoint/references/context-management.md +32 -0
  87. package/skills/uninstall/SKILL.md +39 -28
  88. package/skills/update/SKILL.md +41 -44
  89. package/skills/versions/SKILL.md +65 -0
  90. package/skills/writing-instructions/SKILL.md +159 -0
  91. package/skills/writing-instructions/references/agentskills-spec.md +135 -0
  92. package/skills/writing-plans/SKILL.md +5 -5
  93. package/templates/agents.md +7 -7
  94. package/templates/outcome.md +13 -0
  95. package/templates/savepoint.md +14 -13
  96. package/templates/spec.md +25 -0
  97. package/bin/install.js +0 -29
package/PLASTIC.md CHANGED
@@ -4,26 +4,29 @@
4
4
  > plugin is updated. Do not modify — your changes will be lost.
5
5
  > For project-specific rules, use `AGENTS.md` instead.
6
6
 
7
-
8
7
  ## What is an Intent
9
8
 
10
- An intent is a directory in the store containing `{ID}--{slug}.md` and optional supporting files.
9
+ A directory in the store containing `{ID}--{slug}.md` and optional supporting files.
11
10
  It represents a desire — something a human or agent wants to accomplish, explore, or understand.
12
- Intents are atomic thoughts that need to be developed.
13
11
 
14
12
  ```
15
13
  store/
16
14
  ID--three-to-five-words/
17
- {ID}--{slug}.md # required — the intent itself (e.g., 1a1--design-plastic.md)
18
- spec.md # optional — consolidated specification (Why deliverable)
19
- plan.md # optional — implementation plan (How deliverable)
20
- checklist.md # optional — execution registry with checkboxes (How deliverable)
21
- outcome.md # optional — detailed result (Exec deliverable)
22
- actions/ # optional — makes the intent actionable
23
- ACTION_1.md
24
- savepoint.md # optional — session state for resuming
15
+ {ID}--{slug}.md # required — the intent itself
16
+ spec.md # optional — specification (Why deliverable)
17
+ plan.md # optional — implementation plan (How deliverable)
18
+ checklist.md # optional — execution registry (How deliverable)
19
+ outcome.md # optional — detailed result (Exec deliverable)
20
+ actions/ # optional — individual work items
21
+ resources/ # optional — research, references, screenshots, diagrams
22
+ savepoint.md # optional — deterministic cycle-step ledger (auto-written)
25
23
  ```
26
24
 
25
+ Lifecycle files (`spec.md`, `plan.md`, `checklist.md`, `outcome.md`) have defined
26
+ roles. Supporting artifacts that aren't lifecycle deliverables — research reports,
27
+ reference docs, external API snapshots, screenshots, diagrams — go in `resources/`.
28
+ Name files inside as `{type}--{description}.md` (e.g., `deep-research--gsd-core.md`).
29
+
27
30
  ## Frontmatter
28
31
 
29
32
  Identity and knowledge graph only. Nothing operational.
@@ -32,503 +35,185 @@ Identity and knowledge graph only. Nothing operational.
32
35
  ---
33
36
  id: "4a1"
34
37
  intent: "Short description of the desire"
35
- sources: ["4a"] # backward links — what influenced this intent's creation
36
- chain: ["4a1a", "4a1b"] # forward links — what this intent spawned
38
+ sources: ["4a"] # backward links — what influenced this
39
+ chain: ["4a1a"] # forward links — what this spawned
37
40
  created: 2026-05-29
38
41
  author: human # human | agent-name
39
42
  tags: [plastic, architecture]
40
43
  ---
41
44
  ```
42
45
 
43
- - `sources` and `chain` form the double-linked knowledge graph
44
- - `sources` = what fed into this intent (parents, inspirations, prerequisites)
45
- - `chain` = what this intent produced (children, follow-ups, spin-offs)
46
- - IDs use Folgezettel format — the same identifier used in wikilinks and filenames
47
- - No other fields. Everything else is derived from conventions.
46
+ - `sources` + `chain` form the double-linked knowledge graph (Folgezettel)
47
+ - IDs use Luhmann's alternating convention: `1` `1a` `1a1` → `1a1a`
48
+ - Multiple branches increment: `1a`, `1b`, `1c`
48
49
 
49
50
  ## Two Processes
50
51
 
51
- Plastic has two nested processes:
52
-
53
52
  | Process | Scope | Type | Actor |
54
53
  |---|---|---|---|
55
54
  | **Build → Observe → Repeat** | The system | Continuous loop | Coordinator |
56
55
  | **What → Why → How → Exec** | One intent | Finite lifecycle | Agent |
57
56
 
58
- **Build Observe Repeat** is the Coordinator's heartbeat:
59
- - **Build** — dispatch an intent to an Agent
60
- - **Observe** — review results, read Insights, assess what spawns next
61
- - **Repeat** — create new intents from Insights, dispatch again
62
-
63
- **What Why How Exec** is what happens inside each dispatched intent (see Building an Intent below).
64
-
65
- The connection point: an intent's **## Insights** (captured throughout all stages) feeds into the Coordinator's **Observe** phase, which triggers a new **Build**. The B→O→R loop never ends; the W→W→H→E lifecycle does.
66
-
67
- ## Building an Intent The What→Why→How→Exec Lifecycle
68
-
69
- Every intent progresses through four stages. Each stage has a deliverable.
70
-
71
- ### What `## Intent` section
72
-
73
- The desire. One paragraph. What the human or agent wants.
74
- This exists from the moment the intent is created.
75
-
76
- **Deliverable:** `{ID}--{slug}.md`
77
-
78
- ### Why `## Context` + `### Decisions` sections
79
-
80
- Why this intent exists. Grows over time through brainstorming and exploration.
81
-
82
- - **Context** — what we knew going in + what we decided along the way
83
- - **Decisions** — main premises derived from Context plus decisions from brainstorming/grilling
84
- - Decisions are Why-level: "status belongs on actions because multiple workstreams", not How-level: "use ACTION_N.md files"
85
-
86
- **Deliverable:** `spec.md` (consolidated specification from Context + Decisions + brainstorming)
87
-
88
- ### How Planning and preparation
89
-
90
- Research decisions, create the implementation plan, define actions.
91
-
92
- **Deliverable:** `plan.md` + `actions/` + `checklist.md` (execution registry with checkboxes covering all actions)
93
-
94
- ### Exec Execute actions
95
-
96
- Execute actions from the plan, track progress via checklist.
97
-
98
- **Deliverable:** `outcome.md` (detailed result). `## Outcome` in intent.md = short summary written as last step.
99
-
100
- ### ## Insights — Append-only work log
101
-
102
- Captured throughout ALL stages. One-liner bullet points.
103
- Never modified, only appended.
104
-
105
- Tracks: stage transitions, decisions, shifts, blocks, cancellations, material for future intents.
106
- This is how execution is tracked. When this intent completes, Insights
107
- is where to look for what comes next. New intents spawned from Insights
108
- appear in the `chain` field.
109
-
110
- ### ## Links
111
-
112
- Wikilinks for Obsidian graph navigation. Human-facing counterpart to the
113
- frontmatter knowledge graph.
114
-
115
- ## Conventions Filesystem as Schema
116
-
117
- State is derived from what exists, not from what's declared.
118
-
119
- | Convention | Signal |
120
- |---|---|
121
- | No `## Context` | Intent is fleeting (quick capture, non-actionable) |
122
- | `## Context` has content | Intent is permanent (developed, actionable) |
123
- | `## Outcome` has content | Intent is done |
124
- | `## Insights` has `(autonomous)` entries | Intent is/was being delivered autonomously |
125
-
126
- ### Transitions
127
-
128
- - Fleeting → permanent: add `## Context` (one-way, also makes it actionable)
129
- - There is no separate "non-actionable → actionable" transition — permanence implies actionability
130
- - Even research intents are actionable: the research itself is the action, the conclusion is the outcome
131
-
132
- ### Actions
133
-
134
- When an intent becomes permanent, it is actionable. Create `actions/` with:
135
- - `ACTION_N.md` — individual work items, each self-contained with all resources and context from plan.md
136
- - `CHECKLIST.md` — execution registry tracking progress; serves as the savepoint of execution
137
-
138
- Status lives on actions, not on the intent. An intent can have multiple
139
- parallel workstreams.
57
+ BOR is the Coordinator's heartbeat. W→W→H→E is what happens inside each intent.
58
+ The connection: an intent's `## Insights` feeds the Coordinator's Observe phase.
59
+
60
+ ## Lifecycle Stages
61
+
62
+ | Stage | Section | Deliverable | Detail |
63
+ |-------|---------|-------------|--------|
64
+ | **What** | `## Intent` | `{ID}--{slug}.md` | `plastic-creating-intent` |
65
+ | **Why** | `## Context` + Decisions | `spec.md` | `plastic-brainstorming` |
66
+ | **How** | Planning | `plan.md` + `actions/` + `checklist.md` | `plastic-writing-plans` |
67
+ | **Exec** | Execution | `outcome.md` | `plastic-executing-plan` |
68
+
69
+ `## Insights` — append-only work log captured throughout ALL stages. **Append-only means
70
+ newest entry at the bottom; never prepend.** This ordering is a hard convention: Insights
71
+ are the semantic trace of an intent, and a consistent newest-last order keeps that trace
72
+ readable across every intent.
73
+ For full lifecycle detail, the skills in the Detail column have references/.
74
+
75
+ `savepoint.md` — a deterministic, append-only ledger of cycle-step milestones (one line per
76
+ lifecycle boundary, newest at the bottom), written automatically by the gate hook. It is
77
+ sugar on top of the conventions, not a source of truth: state is always derivable from
78
+ files-on-disk, and the ledger is rebuildable. It exists so a resuming agent reads the cycle's
79
+ succession at a glance (last line = where we are).
80
+
81
+ ## Gotchas
82
+
83
+ - **Artifacts go in the intent directory.** Never create `docs/plans/`,
84
+ `docs/specs/`, `researches/`, or similar. All meta-artifacts go in
85
+ `~/.plastic/store/ID--slug/` or the project store equivalent.
86
+ - **Code goes in the project. Everything else goes in the intent.**
87
+ Plans, specs, checklists, savepoints all in the intent directory.
88
+ - **The global store is never pushed.** `~/.plastic/` is git-tracked locally
89
+ but contains sensitive data. Never push to a remote.
90
+ - **Agent-created repos are private by default.** Use `gh repo create --private`.
91
+ - **State is derived from what exists.** No `## Context` = fleeting intent.
92
+ `## Context` exists = permanent/actionable. `## Outcome` exists = done.
93
+ - **Status lives on actions, not intents.** An intent can have parallel workstreams.
94
+ - **`outcome.md` = done.** Presence signals completion. Don't write it until
95
+ checklist is fully checked.
96
+ - **Delegation overrides external skill defaults.** When delegating to
97
+ brainstorming, writing-plans, etc., Plastic's directory rules override
98
+ their default output paths.
99
+
100
+ ## Defaults-First
101
+
102
+ Plastic stands on its own. Skills and agents use Plastic's own defaults; an
103
+ external skill (for example `superpowers:*`) is opt-in, never load-bearing.
104
+
105
+ - **Default to Plastic, delegate by exception.** Name the Plastic-native path as
106
+ the default. Delegate to an external skill only when (a) it is available in the
107
+ harness, or (b) the user explicitly asks for it. A user without that plugin must
108
+ still get the core behavior.
109
+ - **Phrase external skills as enhancements.** Write "use Plastic's native X by
110
+ default; if `superpowers:<skill>` is available, or the user prefers it, delegate
111
+ to it" never "delegate to `superpowers:<skill>`" as the only path.
112
+ - **Optional dependencies detect then degrade.** `qmd` is the reference shape:
113
+ `scripts/lib/qmd_sync.rb` detects the binary first and every verb no-ops cleanly
114
+ when it is absent (see `scripts/qmd-sync`). Optional CLIs and MCP servers follow
115
+ the same detect-then-skip pattern, so a missing tool never crashes a session.
116
+ - **Legitimate hard dependencies are exempt.** Ruby, Node, git, and POSIX tools are
117
+ the cost of running Plastic, not silent coupling. The principle targets accidental
118
+ dependence on external skills doing work Plastic should do itself.
140
119
 
141
120
  ## State System
142
121
 
143
- Global mode (default):
144
-
145
- ```
146
- ~/.plastic/ # Global intent store
147
- ├── AGENTS.md # This file — conventions contract
148
- ├── config.yml # User preferences
149
- ├── projects.yml # Project slug → path registry
150
- ├── INDEX.md # Brain's entry point
151
- └── store/
152
- └── ID--three-to-five-words/ # One directory per strategic intent
153
- ├── {ID}--{slug}.md # The intent (always present, e.g., 1a1--design-plastic.md)
154
- ├── spec.md # Consolidated specification (optional — Why deliverable)
155
- ├── plan.md # Implementation plan (optional — How deliverable)
156
- ├── checklist.md # Execution registry with checkboxes (optional — How deliverable)
157
- ├── outcome.md # Detailed result (optional — Exec deliverable)
158
- └── savepoint.md # Session state for resume (optional)
159
122
  ```
160
-
161
- Per-project store (centralized under `~/.plastic/projects/`):
162
-
123
+ ~/.plastic/ # Global intent store (git, never pushed)
124
+ ├── INDEX.md # Structure note (clusters by meaning)
125
+ ├── config.yml # User preferences
126
+ ├── projects.yml # Project slug → path registry
127
+ └── store/ # Strategic intents
128
+ └── ID--slug/
129
+ └── {ID}--{slug}.md
130
+
131
+ ~/.plastic/projects/{slug}/ # Project-scoped store
132
+ ├── INDEX.md # Project-scoped index
133
+ ├── AGENTS.md # Project stack defaults
134
+ └── store/ # Tactical intents
135
+ └── ID--slug/
163
136
  ```
164
- ~/.plastic/projects/
165
- └── {slug}/ # One directory per registered project
166
- ├── store/ # Project-scoped intents
167
- └── INDEX.md # Project-scoped index
168
- ```
169
-
170
- Project stores are derived from `projects.yml` — the path is always `~/.plastic/projects/{slug}/store/`.
171
- No files are placed in the project's code directory. The SessionStart hook detects the project
172
- by matching CWD against `projects.yml` and loads the appropriate store automatically.
173
-
174
- ### Privacy and Collaboration
175
-
176
- **Plastic is personal.** All intent data lives under `~/.plastic/` — one location, one git repo, never pushed. Each person has their own intent store with their own thought evolution. No files are placed in project directories.
177
-
178
- Collaboration happens through pull requests and project conventions, not shared intents. When an intent delivers something that changes how a project works, the decision gets written into the project's shared files (README, docs, config). The intents themselves are private working memory.
179
-
180
- Project config (`~/.plastic/projects/{slug}/config.yml`) overrides global config (`~/.plastic/config.yml`). Both are private.
181
-
182
- ### Directory Naming — Folgezettel
183
137
 
184
- Format: `ID--three-to-five-words` applies to all stores.
185
- - `ID` Folgezettel identifier using Luhmann's alternating convention
186
- - `--` — separator
187
- - `three-to-five-words` — human-readable slug (3-5 words max)
138
+ Project stores derived from `projects.yml`. No files placed in project code
139
+ directories. SessionStart hook detects project by matching CWD.
188
140
 
189
- Folgezettel IDs encode lineage:
190
- - Root intents: sequential numbers (`1`, `2`, `3`...)
191
- - Branches alternate letters and numbers: `1` → `1a` → `1a1` → `1a1a` → ...
192
- - Multiple branches from the same parent increment: `1a`, `1b`, `1c` or `1a1`, `1a2`, `1a3`
193
- - IDs are assigned at creation time and never change
141
+ **Privacy:** Plastic is personal. All intent data under `~/.plastic/`. Each
142
+ person has their own store. Collaboration through PRs, not shared intents.
194
143
 
195
- ### Intent Filename
144
+ ## Directory Naming
196
145
 
197
- The intent file is named `{ID}--{slug}.md` matching the directory name.
198
- Wikilinks use the ID only (`[[1a1]]`) and resolve via Obsidian alias or search.
146
+ Format: `ID--three-to-five-words` (all stores).
199
147
 
200
- Examples:
201
- - Directory `1a1--design-plastic-state-system/` contains `1a1--design-plastic-state-system.md`
202
- - Directory `4a1b--lifecycle-file-mapping/` contains `4a1b--lifecycle-file-mapping.md`
148
+ - Root intents: sequential numbers (`1`, `2`, `3`)
149
+ - Branches alternate: `1` `1a` → `1a1` → `1a1a`
150
+ - Intent file matches directory: `1a1--slug/1a1--slug.md`
151
+ - Next ID: `"${CLAUDE_PLUGIN_ROOT}/scripts/folgezettel-id" <parent_id> <store_path>`
203
152
 
204
- ### Wikilink Conventions
153
+ **Branch vs root — the semantic decision.** The numbering is mechanics; choosing
154
+ *whether* to branch is meaning:
205
155
 
206
- | Syntax | Meaning |
207
- |--------|---------|
208
- | `[[ID]]` | Link to intent in same store (e.g., `[[1a1]]`) |
209
- | `[[ID\|display text]]` | Link with human-readable label (e.g., `[[1a1\|Design Plastic]]`) |
210
- | `[[global:ID]]` | Link to intent in `~/.plastic/store/` |
211
- | `[[project-slug:ID]]` | Link to intent in `~/.plastic/projects/{slug}/store/` |
156
+ - **Branch (`14a`, `14b`)** — a sub-task, refinement, or direct continuation of the
157
+ parent. It cannot stand on its own; it only makes sense as part of the parent's work.
158
+ - **Root (`15`, `16`)** an independent thought, even if inspired by another intent.
159
+ Record provenance with `sources: ["14"]`, not by branching.
160
+ - **Rule of thumb:** if the intent could exist without its parent, it's a root.
212
161
 
213
- ### Authorship
162
+ ## INDEX.md
214
163
 
215
- Intents can be created by humans or AI agents (`author` field): `human`, `claude-code`, `hermes`, `openclaw`, or any agent identifier.
216
-
217
- ## INDEX.md — Structure Note
218
-
219
- INDEX.md is a Zettelkasten structure note, not a table of contents.
220
- It clusters intents by meaning, not by date or status.
164
+ A Zettelkasten structure note, not a table of contents. Clusters by meaning.
221
165
 
222
166
  Sections: `## Active`, `## Future`, `## Clusters`, `## Abandoned`, `## Completed`.
223
167
 
224
- ## Creating an Intent
225
-
226
- 1. Determine the target store: `~/.plastic/store/` for global intents (default), `~/.plastic/projects/{slug}/store/` for project intents
227
- 2. Determine the Folgezettel ID: If root (no parent), find highest root number +1. If branch, run `"${CLAUDE_PLUGIN_ROOT}/scripts/folgezettel-id" <parent_id> <store_path>`
228
- 3. Create the intent directory in the chosen store (e.g., `ID--three-to-five-words`)
229
- 4. Create `{ID}--{slug}.md` with frontmatter (id, intent, sources, chain, created, author, tags)
230
- 5. Write `## Intent` — the What
231
- 6. Add remaining sections: `## Context`, `## Outcome`, `## Insights`, `## Links`
232
- 7. Update the appropriate `INDEX.md` — add to Active section and appropriate cluster
233
-
234
- A fleeting intent can skip `## Context` — just `## Intent` and empty sections.
235
-
236
- ## Progressing an Intent
237
-
238
- 1. **What → Why:** Brainstorm, explore, grill. Add Context + Decisions to `## Context`. Write `spec.md`.
239
- - **Autonomous handoff:** When Why is complete, human can invoke `plastic:auto` to hand off How and Exec to the agent. The agent completes any remaining Why gaps through self-directed research, then proceeds through How and Exec autonomously.
240
- 2. **Why → How:** Research decisions, plan. Write `plan.md`, create `actions/`, write `checklist.md`.
241
- 3. **How → Exec:** Execute actions, update `checklist.md`. When all done, write `outcome.md`.
242
- 4. **Throughout:** Capture observations in `## Insights` (append-only). These spark future intents.
243
- 5. **Completing:** Write `## Outcome` summary in intent.md. Spawn follow-up intents from `## Insights`, update `chain`.
244
-
245
- ## Context Management (Start-Save-Continue)
246
-
247
- ### Save Point
248
- Triggered by PreCompact hook or manually:
249
- 1. Find active intent(s) from `~/.plastic/INDEX.md`
250
- 2. Update active intent's `checklist.md` (check off completed items)
251
- 3. Update active intent's `savepoint.md` (in-progress, next steps, blockers, discoveries)
252
- 4. Add observations to `## Insights`
253
- 5. Update INDEX.md
254
- 6. Commit: `cd ~/.plastic && git add . && git commit -m "chore: savepoint — [intent name]"`
255
- 7. Notify user to `/clear`
256
-
257
- ### Continue
258
- Triggered by UserPromptSubmit hook when user says "continue". Priority order:
259
-
260
- **1. Active intents first (resume work):**
261
- 1. Read INDEX.md → find active intent(s)
262
- 2. Read active intent's `intent.md` → what and why
263
- 3. Read active intent's `savepoint.md` → where we left off
264
- 4. Read active intent's `checklist.md` → what's next
265
- 5. Announce: intent name, current state, next step, blockers
266
- 6. Resume
267
-
268
- **2. No active intents → offer future intents:**
269
- 1. List all future intents from INDEX.md
270
- 2. Present them as options
271
- 3. When user picks one, move to Active in INDEX.md
272
-
273
- **3. Stale future intents (untouched 3+ days) → triage:**
274
- - **activate** — start working on it now
275
- - **abandon** — mark as abandoned
276
- - **defer to agent** — implement, research, or ideate
168
+ For index maintenance, use `plastic-managing-index`.
277
169
 
278
170
  ## Rules for Skills
279
171
 
280
- ALL work flows through intents. No skill, agent, or workflow creates directories, specs, plans, or artifacts outside the intent system.
281
-
282
- 1. **Before starting any work**, check INDEX.md for the active intent. If none exists, create one first.
283
- 2. **Never create** `docs/superpowers/specs/`, `docs/plans/`, `researches/`, or similar directories. All artifacts go into the active intent's directory.
284
- 3. **When a skill produces output** (spec, plan, checklist), write it inside the active intent's directory.
285
- 4. **When a skill completes**, capture observations in `## Insights`.
286
- 5. **When work is done**, write `outcome.md` and `## Outcome` summary in intent.md (presence of `outcome.md` = done). Update INDEX.md.
287
- 6. **Researches are intents.** No separate folder.
288
-
289
- ### Delegation to External Skills
290
-
291
- When Plastic delegates to an external skill, **Plastic's directory rules OVERRIDE the external skill's defaults:**
292
-
293
- - Plans save to `~/.plastic/store/ID--slug/plan.md` (not `docs/superpowers/plans/`)
294
- - Specs save to `~/.plastic/store/ID--slug/spec.md` (not `docs/superpowers/specs/`)
295
- - Code files go in the project tree; meta-artifacts go in the intent directory
296
-
297
- **The rule is simple:** code goes in the project. Plans, specs, checklists, savepoints, and all meta-artifacts go in the intent directory. No exceptions.
298
-
299
- ## Hubs
300
-
301
- A Hub is a cloud of intents around related topics. Hubs emerge naturally from
302
- Folgezettel branching — intents that spawn in the same direction (same concept,
303
- new ideas, new features) cluster into a Hub.
304
-
305
- - A Hub can spawn a Project. The Hub holds the founding ideas.
306
- - A single intent can also spawn a Project (Intent-spawned vs Hub-spawned).
307
- - Hub-spawned projects revolve around different ideas/features around related topics.
308
- - Intent-spawned projects revolve around the single founding intent.
309
- - A Project is the result of ideation — the deliverable outcome of one or more intents.
310
-
311
- Hubs are represented as clusters in INDEX.md.
312
-
313
- ## Projects
314
-
315
- A Project is a deliverable grouping of intents — a hub that connects related work into something that can be delivered. Projects have two stores, both under `~/.plastic/`:
316
-
317
- - **Global store** (`~/.plastic/store/`): strategic intents — ideas, research, explorations that span multiple projects or don't belong to any project.
318
- - **Project store** (`~/.plastic/projects/{slug}/store/`): project-scoped intents — implementation, actions, execution, delivery artifacts.
172
+ ALL work flows through intents.
319
173
 
320
- No files are placed in project code directories. The SessionStart hook detects the project by matching CWD against `projects.yml` and loads the appropriate store.
174
+ 1. Before starting work, check INDEX.md for active intent. If none, create one.
175
+ 2. Skill output (spec, plan, checklist) goes in the intent directory.
176
+ 3. On completion, capture observations in `## Insights`.
177
+ 4. When done, write `outcome.md` + `## Outcome` summary. Update INDEX.md.
178
+ 5. Researches are intents. No separate folder.
179
+ 6. Intents are created only via `plastic-creating-intent`. Never hand-author an intent file. The skill self-verifies the written intent with `scripts/validate-intent` before announcing or committing, so every intent is born complete.
321
180
 
322
- `projects.yml` maps project slugs to codebase paths:
323
- ```yaml
324
- projects:
325
- plastic:
326
- path: "/path/to/plastic"
327
- remote: "git@github.com:org/plastic.git"
328
- registered: '2026-05-26'
329
- status: active
330
- ```
331
-
332
- The project store path is always derived: `~/.plastic/projects/{slug}/store/`. No explicit store path in `projects.yml`.
333
-
334
- Config resolution: `~/.plastic/projects/{slug}/config.yml` overrides `~/.plastic/config.yml`.
335
-
336
- Cross-linking: project intents reference global intents via `[[global:ID]]`. Global intents reference project intents via `[[project-slug:ID]]`.
337
-
338
- ## Agent Architecture
339
-
340
- ### Main Orchestrator
341
-
342
- The Main Orchestrator manages the global store (Main Knowledge Base). It:
343
- - Recognizes, creates, updates, and groups intents
344
- - Spawns Project Orchestrators for registered projects
345
- - Receives contributions back from Project Orchestrators
346
- - Is the only agent that runs in a loop (continuous Build→Observe→Repeat)
347
-
348
- ### Project Orchestrators
349
-
350
- Project Orchestrators manage project stores (Project Knowledge Bases). They:
351
- - Care about intents and execution within their project
352
- - Spawn teams to develop and execute intents
353
- - Contribute back to the Main Orchestrator when new intents are born
354
- that could enrich the Main Knowledge Base
355
-
356
- The Main Orchestrator and Project Orchestrators can be any agent platform: Claude Code, Hermes, OpenClaw.
357
- Agents and sub-agents can also be any platform.
358
-
359
- Two modes:
360
- - **Human-driven:** Human chats with Main Orchestrator, creates intents, brainstorms, then Main Orchestrator dispatches Project Orchestrators and Agents for execution.
361
- - **Autonomous:** Human gives Main Orchestrator a starting intent with defined outcomes. Main Orchestrator runs the full cycle — Agents do the lifecycle (What→Why→How→Exec), Main Orchestrator reviews Insights, spawns next intents, dispatches again. Human is the boss but doesn't need to be in the loop for every decision.
362
-
363
- Rules:
364
- - 1 Main Orchestrator : 1 Global Store (`~/.plastic/`)
365
- - 1 Main Orchestrator : N Project Orchestrators
366
- - 1 Project Orchestrator : 1 Project Store
367
- - 1 Agent : 1 Intent (exclusive assignment)
368
- - 1 Agent : N Sub-agents (for parallel Actions within an intent)
369
-
370
- When "work on Project X":
371
- 1. Read `projects.yml` → find project path
372
- 2. Load global config (defaults)
373
- 3. Load project config (overrides)
374
- 4. Load global INDEX.md → find hub intents tagged `project-<name>`
375
- 5. Load project `.plastic/INDEX.md` → tactical intents
376
- 6. Coordinator has full picture, dispatches Agent teams
377
-
378
- The Coordinator runs **Build → Observe → Repeat**:
379
- 1. **Build** — dispatch intent to an Agent
380
- 2. **Observe** — Agent completes, Coordinator reads ## Insights and ## Outcome
381
- 3. **Repeat** — spawn new intents from Insights, update chain, dispatch next
382
-
383
- Each Agent runs **What → Why → How → Exec** on its assigned intent:
384
- 1. Receives intent from Coordinator
385
- 2. Handles full lifecycle: What→Why→How→Exec
386
- 3. Can spawn sub-agents for parallel Actions
387
- 4. When done: notifies Coordinator (triggers Observe phase)
388
-
389
- ### Autonomous Delivery
390
-
391
- Human owns What and Why for human-initiated intents. Agent assists (research,
392
- exploration) but human drives until handoff. When Why is complete — or human
393
- triggers `plastic:auto` — the agent takes over How and Exec autonomously.
394
-
395
- - **Safe-by-default:** Agent always prefers non-destructive routes (rename vs
396
- delete, additive migrations, backups before changes). Destructive actions on
397
- existing projects require human approval unless `--skip-permissions` is set.
398
- - **One agent per intent.** Agent follows the full W→W→H→E lifecycle.
399
- - **Notification only on:** finish or hard stop (blocked on destructive action,
400
- unresolvable error). No progress reports — `## Insights` tracks everything.
401
- - **Greenfield autonomy:** During initial project creation, all decisions are
402
- non-destructive (nothing to destroy). Agent has full autonomy for greenfield choices.
403
- - **Autonomous decisions** are logged in `## Insights` with `(autonomous)` marker.
404
-
405
- ## Hook Enforcement
406
-
407
- Hooks are the convention enforcement layer. The agent reads PLASTIC.md for understanding; hooks enforce it.
408
-
409
- ### Bridge File Pattern
410
-
411
- `/tmp/plastic-{session}.json` is the hot cache; the filesystem is the authority.
412
- SessionStart rebuilds the bridge file from the filesystem — the bridge is always disposable.
413
-
414
- ### Gate Taxonomy
415
-
416
- | Gate type | Purpose |
417
- |---|---|
418
- | **Pre-flight** | Prerequisites exist? (e.g., spec.md before plan.md) |
419
- | **Revision** | New info invalidated prior work? (e.g., Context changed after spec.md was written) |
420
- | **Escalation** | Blocked items surface to user (e.g., unresolved decision needed) |
421
- | **Abort** | Inconsistent state detected (e.g., outcome.md exists but checklist incomplete) |
422
-
423
- ### Transition Table
424
-
425
- | Transition | Trigger |
426
- |---|---|
427
- | What → Why | `spec.md` written |
428
- | Why → How | `plan.md` + `actions/` + `checklist.md` written (the triplet) |
429
- | How → Exec | `checklist.md` has items to execute |
430
- | Exec → Done | `outcome.md` written |
431
-
432
- ### Gate Enforcement
433
-
434
- | Gate | Blocked action | Required prerequisite |
435
- |---|---|---|
436
- | Pre-flight | Cannot write `plan.md` | `spec.md` must exist |
437
- | Pre-flight | Cannot create `actions/` | `spec.md` must exist |
438
- | Pre-flight | Cannot write `outcome.md` | `checklist.md` must exist with all items checked |
439
- | Revision | Cannot proceed to Exec | Context changed after spec.md — re-derive spec |
440
- | Abort | Cannot complete intent | `outcome.md` exists but checklist has unchecked items |
441
-
442
- Hard blocking — hooks exit with code 2 when gates fail.
443
-
444
- ## Stuck Detection
445
-
446
- | Condition | Threshold | Action |
447
- |---|---|---|
448
- | Consecutive gate failures | 3+ | Warning |
449
- | Consecutive gate failures | 5+ | Force savepoint + escalate to user |
450
- | No activity | 5+ min | Warning |
451
- | No activity | 10+ min | Force savepoint + escalate to user |
452
- | Context pressure | 80% | Warning |
453
- | Context pressure | 90% | Force savepoint |
454
-
455
- Token tracking is done via transcript parsing — Claude Code hooks do not expose token counts directly.
456
-
457
- ## Zettelkasten Structure
458
-
459
- Plastic implements three Zettelkasten structures:
181
+ ## Transition Gates
460
182
 
461
- | Structure | Implementation | Purpose |
183
+ | Transition | Trigger | Gate |
462
184
  |---|---|---|
463
- | Folgezettel (linked list) | `sources` + `chain` in frontmatter | Sequential provenance what led here, what spawned from here |
464
- | Directed graph (web of notes) | `## Links` with wikilinks | Obsidian graph navigation, human-facing connections |
465
- | Tag-based taxonomy | `tags` in frontmatter | Grouping by topic and project membership (`project-<name>`) |
185
+ | What Why | `spec.md` written | — |
186
+ | Why How | `plan.md` + `actions/` + `checklist.md` | `spec.md` must exist |
187
+ | How Exec | Checklist has items | Plan triplet must exist |
188
+ | Exec → Done | `outcome.md` written | All checklist items checked |
466
189
 
467
- INDEX.md is a structure note (hub), not a table of contents. It clusters intents by meaning. Project hubs in INDEX.md represent deliverable groupings.
468
-
469
- ## Dual-Mode
470
-
471
- This store works in two modes without modification:
472
- - **Obsidian** (human, offline) — browse, link, write markdown
473
- - **Programmatic** (any agent) — read/write via filesystem operations
474
-
475
- No special tooling required for either mode.
476
-
477
- ## Git Rules
478
-
479
- The global store (`~/.plastic/`) is tracked with git locally but **never pushed
480
- to a remote**. It contains sensitive data (intents, decisions, project context).
481
-
482
- - `~/.plastic/`: git tracked, **never push**
483
- - Project repos: push only when the user explicitly confirms
484
- - Agent-created repos: **private by default**. When an agent creates a GitHub
485
- repository (e.g., for a new project), it must be private unless the user
486
- explicitly requests public. Use `gh repo create --private`.
190
+ Hard blocking hooks exit code 2 on gate failure.
487
191
 
488
192
  ## Deprecation Process
489
193
 
490
- When removing a feature, changing a convention, or making a breaking change:
491
-
492
- 1. Add entry to `deprecations.yml` in the Plastic source root
493
- 2. Set appropriate severity: `info` (awareness), `warning` (action needed), `critical` (urgent)
494
- 3. Provide clear migration steps never deprecate without telling the user what to do
495
- 4. Set `removal` version at least 2 minor versions ahead (warning) or 1 minor (info)
496
- 5. The SessionStart hook displays active deprecations automatically
497
- 6. Remove the feature AND the deprecation entry together in the removal version
498
-
499
- ### Severity Levels
500
-
501
- | Severity | When to use | Dismissable? |
502
- |----------|-------------|--------------|
503
- | `info` | Awareness of upcoming change | Yes |
504
- | `warning` | Action needed before removal | Yes (re-shown at removal version) |
505
- | `critical` | Urgent/security-related removal | Never |
506
-
507
- ### deprecations.yml Schema
508
-
509
- ```yaml
510
- deprecations:
511
- - id: unique-slug
512
- severity: info | warning | critical
513
- summary: "One-line description"
514
- migration_steps:
515
- - "Step 1"
516
- - "Step 2"
517
- introduced: "0.9.0"
518
- removal: "1.0.0"
519
- link: "optional URL"
520
- ```
521
-
522
- ### Dismissal
523
-
524
- Users dismiss deprecations by adding the id to `deprecations_dismissed` in `config.yml`:
525
-
526
- ```yaml
527
- deprecations_dismissed:
528
- - some-deprecated-feature
529
- ```
530
-
531
- Critical deprecations and final-version warnings ignore dismissal.
532
-
533
- ## Agent-Specific Files
534
-
194
+ Deprecations live in `deprecations.yml` and are shown at SessionStart. While Plastic is
195
+ pre-1.0, a satisfied deprecation (its migration is already done on installed machines) may be
196
+ removed immediately instead of waiting for its declared `removal` version. From `1.0.0` on,
197
+ the steady-state grace rule applies (removal at least two minors ahead). For the full process,
198
+ severity levels, and the pre-1.0 exception, see the `plastic-releasing` skill.
199
+
200
+ ## Skills Reference
201
+
202
+ Detailed conventions live inside the skills that use them, not in this file.
203
+
204
+ | Topic | Skill | References in skill |
205
+ |-------|-------|-------------------|
206
+ | Creating intents, lifecycle | `plastic-creating-intent` | lifecycle, wikilinks |
207
+ | Brainstorming, spec writing | `plastic-brainstorming` | |
208
+ | Planning, actions | `plastic-writing-plans` | |
209
+ | Execution, delivery | `plastic-executing-plan` | |
210
+ | Autonomous delivery | `plastic-auto` | agent architecture |
211
+ | Save/restore state | `plastic-savepoint`, `plastic-continuing` | context management |
212
+ | Knowledge graph, linking | `plastic-linking-intents` | zettelkasten, wikilinks |
213
+ | Projects, hubs | `plastic-creating-project` | hubs, project stores |
214
+ | Provision a project store | `plastic-add-project-store` | project stores |
215
+ | Index maintenance | `plastic-managing-index` | — |
216
+ | Releases, deprecations | `plastic-releasing` | deprecation process |
217
+ | Health diagnostics | `plastic-doctor` | three scopes: `--core` (binary install-integrity check, runs on SessionStart), `--store [global\|<slug>]` (per-store check, runs on dashboard load), no flag = full check (runs after every update); gate enforcement, stuck detection |
218
+ | Writing agent instructions | `plastic-writing-instructions` | agentskills.io spec |
219
+ | Evaluating skills, evals | `plastic-evaluating-skills` | eval methodology, convention checks |