@zalom/plastic 1.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/LICENSE +21 -0
- package/PLASTIC.md +534 -0
- package/README.md +88 -0
- package/agents/future-intent-researcher.md +38 -0
- package/agents/intent-curator.md +40 -0
- package/bin/install.js +29 -0
- package/deprecations.yml +23 -0
- package/hooks/check-update +42 -0
- package/hooks/continue +31 -0
- package/hooks/future-intent-check +25 -0
- package/hooks/gate-check +10 -0
- package/hooks/hooks.json +78 -0
- package/hooks/run-hook +7 -0
- package/hooks/savepoint +6 -0
- package/hooks/session-start +9 -0
- package/hooks/statusline +16 -0
- package/package.json +43 -0
- package/scripts/folgezettel-id +40 -0
- package/scripts/hash-intent +29 -0
- package/scripts/hook-continue +130 -0
- package/scripts/hook-future-intent-check +90 -0
- package/scripts/hook-gate-check +136 -0
- package/scripts/hook-session-start +224 -0
- package/scripts/install.rb +474 -0
- package/scripts/lib/bridge.rb +139 -0
- package/scripts/migrate-folgezettel +535 -0
- package/scripts/migrate-to-global +96 -0
- package/scripts/read-config +129 -0
- package/skills/auto/SKILL.md +127 -0
- package/skills/brainstorming-grill-me/SKILL.md +105 -0
- package/skills/continuing/SKILL.md +104 -0
- package/skills/creating-intent/SKILL.md +122 -0
- package/skills/creating-project/SKILL.md +166 -0
- package/skills/executing-plan/SKILL.md +120 -0
- package/skills/executing-plan/code-quality-reviewer-prompt.md +32 -0
- package/skills/executing-plan/implementer-prompt.md +42 -0
- package/skills/executing-plan/spec-reviewer-prompt.md +27 -0
- package/skills/install/SKILL.md +134 -0
- package/skills/intent-curator/SKILL.md +41 -0
- package/skills/linking-intents/SKILL.md +72 -0
- package/skills/managing-index/SKILL.md +66 -0
- package/skills/managing-index/references/zettelkasten-linking.md +27 -0
- package/skills/releasing/SKILL.md +124 -0
- package/skills/savepoint/SKILL.md +57 -0
- package/skills/uninstall/SKILL.md +48 -0
- package/skills/update/SKILL.md +69 -0
- package/templates/agents.md +46 -0
- package/templates/checklist.md +11 -0
- package/templates/config.yml +13 -0
- package/templates/index.md +13 -0
- package/templates/intent.md +24 -0
- package/templates/plan.md +11 -0
- package/templates/projects.yml +3 -0
- package/templates/savepoint.md +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Zlatko Alomerovic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/PLASTIC.md
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
# Plastic — Conventions
|
|
2
|
+
|
|
3
|
+
> **This file is maintained by Plastic.** It will be overwritten when the
|
|
4
|
+
> plugin is updated. Do not modify — your changes will be lost.
|
|
5
|
+
> For project-specific rules, use `AGENTS.md` instead.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## What is an Intent
|
|
9
|
+
|
|
10
|
+
An intent is a directory in the store containing `{ID}--{slug}.md` and optional supporting files.
|
|
11
|
+
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
|
+
|
|
14
|
+
```
|
|
15
|
+
store/
|
|
16
|
+
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
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Frontmatter
|
|
28
|
+
|
|
29
|
+
Identity and knowledge graph only. Nothing operational.
|
|
30
|
+
|
|
31
|
+
```yaml
|
|
32
|
+
---
|
|
33
|
+
id: "4a1"
|
|
34
|
+
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
|
|
37
|
+
created: 2026-05-29
|
|
38
|
+
author: human # human | agent-name
|
|
39
|
+
tags: [plastic, architecture]
|
|
40
|
+
---
|
|
41
|
+
```
|
|
42
|
+
|
|
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.
|
|
48
|
+
|
|
49
|
+
## Two Processes
|
|
50
|
+
|
|
51
|
+
Plastic has two nested processes:
|
|
52
|
+
|
|
53
|
+
| Process | Scope | Type | Actor |
|
|
54
|
+
|---|---|---|---|
|
|
55
|
+
| **Build → Observe → Repeat** | The system | Continuous loop | Coordinator |
|
|
56
|
+
| **What → Why → How → Exec** | One intent | Finite lifecycle | Agent |
|
|
57
|
+
|
|
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.
|
|
140
|
+
|
|
141
|
+
## State System
|
|
142
|
+
|
|
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
|
+
```
|
|
160
|
+
|
|
161
|
+
Per-project store (centralized under `~/.plastic/projects/`):
|
|
162
|
+
|
|
163
|
+
```
|
|
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
|
+
|
|
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)
|
|
188
|
+
|
|
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
|
|
194
|
+
|
|
195
|
+
### Intent Filename
|
|
196
|
+
|
|
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.
|
|
199
|
+
|
|
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`
|
|
203
|
+
|
|
204
|
+
### Wikilink Conventions
|
|
205
|
+
|
|
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/` |
|
|
212
|
+
|
|
213
|
+
### Authorship
|
|
214
|
+
|
|
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.
|
|
221
|
+
|
|
222
|
+
Sections: `## Active`, `## Future`, `## Clusters`, `## Abandoned`, `## Completed`.
|
|
223
|
+
|
|
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
|
|
277
|
+
|
|
278
|
+
## Rules for Skills
|
|
279
|
+
|
|
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.
|
|
319
|
+
|
|
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.
|
|
321
|
+
|
|
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:
|
|
460
|
+
|
|
461
|
+
| Structure | Implementation | Purpose |
|
|
462
|
+
|---|---|---|
|
|
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>`) |
|
|
466
|
+
|
|
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`.
|
|
487
|
+
|
|
488
|
+
## Deprecation Process
|
|
489
|
+
|
|
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
|
+
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Plastic
|
|
2
|
+
|
|
3
|
+
> Intent-driven state management for AI coding sessions.
|
|
4
|
+
> Named after **neuroplasticity** — adaptive, malleable, dynamic, resilient.
|
|
5
|
+
|
|
6
|
+
## What Is This?
|
|
7
|
+
|
|
8
|
+
Plastic implements two nested processes: **Build → Observe → Repeat** (Coordinator's continuous loop) and **What → Why → How → Next** (intent's finite lifecycle). Zettelkasten-inspired linking connects intents. All project state lives in `.plastic/`. Everything is an intent.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### 1. Register the marketplace
|
|
13
|
+
|
|
14
|
+
In Claude Code, run:
|
|
15
|
+
```
|
|
16
|
+
/plugin marketplace add zalom/plastic
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Install the plugin
|
|
20
|
+
|
|
21
|
+
In Claude Code, run:
|
|
22
|
+
```
|
|
23
|
+
/plugin add plastic@plastic
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### 3. Initialize in your project
|
|
27
|
+
|
|
28
|
+
In Claude Code, run:
|
|
29
|
+
```
|
|
30
|
+
/plastic:install
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Global vs Local
|
|
34
|
+
|
|
35
|
+
**Global (recommended):** Plastic stores all intents at `~/.plastic/`. Projects spawned by implementation intents get their own `.plastic/store/` for tactical intents.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
/plastic:install
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Local (testing):** Intents stored per-project in `.plastic/`. Useful for trying Plastic in a single project.
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
/plastic:install --local
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Prerequisites
|
|
48
|
+
|
|
49
|
+
Plastic hooks use Ruby for intent ID generation. Ruby is pre-installed on macOS/Linux. On Windows, use WSL or install Ruby from https://rubyinstaller.org/.
|
|
50
|
+
|
|
51
|
+
## Directory Structure
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
.plastic/
|
|
55
|
+
├── AGENTS.md # Conventions contract for all agents
|
|
56
|
+
├── config.yml # Plugin configuration
|
|
57
|
+
├── INDEX.md # Brain's entry point
|
|
58
|
+
└── store/
|
|
59
|
+
└── ID--three-to-five-words/
|
|
60
|
+
├── {ID}--{slug}.md # Always present (e.g., 1a1--design-plastic.md)
|
|
61
|
+
├── spec.md # Optional (brainstorming output)
|
|
62
|
+
├── plan.md # Optional (implementation plan)
|
|
63
|
+
├── checklist.md # Optional (progress tracking)
|
|
64
|
+
└── savepoint.md # Optional (session state)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Skills
|
|
68
|
+
|
|
69
|
+
| Skill | Purpose |
|
|
70
|
+
|-------|---------|
|
|
71
|
+
| `install` | Initialize `.plastic/` in a new project |
|
|
72
|
+
| `creating-intent` | Create a new intent with directory, hash, and INDEX.md entry |
|
|
73
|
+
| `savepoint` | Save active intent state before context reset |
|
|
74
|
+
| `continuing` | Resume from savepoint after `/clear` |
|
|
75
|
+
| `linking-intents` | Connect intents via Zettelkasten links |
|
|
76
|
+
| `managing-index` | Curate INDEX.md structure note |
|
|
77
|
+
| `executing-plan` | Execute plans via subagent-driven (default) or inline mode |
|
|
78
|
+
|
|
79
|
+
## Agents
|
|
80
|
+
|
|
81
|
+
| Agent | Purpose |
|
|
82
|
+
|-------|---------|
|
|
83
|
+
| `intent-curator` | Maintains INDEX.md health, suggests links |
|
|
84
|
+
| `future-intent-researcher` | Researches parked future intents |
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:future-intent-researcher
|
|
3
|
+
description: |
|
|
4
|
+
Use this agent to research future intents autonomously. Picks up parked
|
|
5
|
+
intents from INDEX.md, investigates them via web search and codebase analysis,
|
|
6
|
+
and writes findings into the intent. Examples:
|
|
7
|
+
<example>Context: There are future intents parked in the index.
|
|
8
|
+
user: "Research my future intents"
|
|
9
|
+
assistant: "I'll use the future-intent-researcher to pick up a parked intent and investigate it"
|
|
10
|
+
<commentary>Agent autonomously researches a future intent and writes findings.</commentary></example>
|
|
11
|
+
model: inherit
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
You are the Plastic Future Intent Researcher. Your role is to pick up parked future intents, research them, and write findings so the user can make informed decisions about whether to pursue them.
|
|
15
|
+
|
|
16
|
+
## Your Responsibilities
|
|
17
|
+
|
|
18
|
+
1. **Select a future intent** — read `.plastic/INDEX.md`, find intents listed under `## Future`
|
|
19
|
+
2. **Research it** — use web search, read relevant code, analyze feasibility
|
|
20
|
+
3. **Write findings** — add findings to the intent's `## Context` section (why content)
|
|
21
|
+
4. **Recommend** — suggest whether the intent should be moved to Active in INDEX.md or remains parked
|
|
22
|
+
|
|
23
|
+
## How You Work
|
|
24
|
+
|
|
25
|
+
1. Read `.plastic/INDEX.md` to find future intents
|
|
26
|
+
2. Pick the oldest or most relevant one (ask the user if multiple)
|
|
27
|
+
3. Read the intent's `{ID}--{slug}.md` to understand what needs researching
|
|
28
|
+
4. Research using WebSearch, WebFetch, and codebase reading
|
|
29
|
+
5. Write findings into the intent's `## Context` section (findings are Why content)
|
|
30
|
+
6. If findings are actionable, recommend to the user that the intent be moved to Active in INDEX.md
|
|
31
|
+
7. Report findings to the user with a summary
|
|
32
|
+
|
|
33
|
+
## Constraints
|
|
34
|
+
|
|
35
|
+
- You only edit `~/.plastic/store/*/ID--slug.md` (or project store) files (adding to `## Context` section)
|
|
36
|
+
- You never modify `## Insights` or `## Outcome` sections — those belong to the worker
|
|
37
|
+
- You use Read, WebSearch, WebFetch, and Bash (read-only grep/find) for research
|
|
38
|
+
- You never change status fields — status is convention-derived from INDEX.md placement
|