@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
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:creating-project
|
|
3
|
+
description: >-
|
|
4
|
+
Create a new project from an implementation intent. Sets up project directory,
|
|
5
|
+
git init, AGENTS.md with founding intent decisions, plastic:install --local,
|
|
6
|
+
tactical mirror, projects.yml registration, and framework scaffolding.
|
|
7
|
+
Use when an implementation intent spawns a project, or manually by user.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Creating a Project
|
|
11
|
+
|
|
12
|
+
Announce: "Creating project `<slug>` from intent [ID] — [name]."
|
|
13
|
+
|
|
14
|
+
## Precondition
|
|
15
|
+
|
|
16
|
+
An active intent must exist with enough context to define a project — at minimum: name/slug, path, and key decisions from `## Context > ### Decisions`.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### 1. Determine Project Identity
|
|
21
|
+
|
|
22
|
+
- **Slug:** derived from intent name (kebab-case, 2-4 words) or user-specified
|
|
23
|
+
- **Path:** from `~/.plastic/config.yml` `project_roots` (first entry as default), or user-specified
|
|
24
|
+
- Confirm path with user before creation
|
|
25
|
+
|
|
26
|
+
### 2. Create Project Directory
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
mkdir -p <project_root>/<slug>
|
|
30
|
+
cd <project_root>/<slug>
|
|
31
|
+
git init
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Run `plastic:install --local`
|
|
35
|
+
|
|
36
|
+
Invoke `plastic:install --local` in the project directory. This creates:
|
|
37
|
+
```
|
|
38
|
+
.plastic/
|
|
39
|
+
├── store/
|
|
40
|
+
├── INDEX.md
|
|
41
|
+
└── config.yml
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 4. Populate AGENTS.md
|
|
45
|
+
|
|
46
|
+
Create `AGENTS.md` in the project root with:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
# <Project Name> — Agent Instructions
|
|
50
|
+
|
|
51
|
+
Read `PLASTIC.md` in `~/.plastic/`. It contains all Plastic conventions.
|
|
52
|
+
Follow it exactly.
|
|
53
|
+
|
|
54
|
+
This file is the operating contract for this project. Any agent entering
|
|
55
|
+
this project reads this file first.
|
|
56
|
+
|
|
57
|
+
## Global Store
|
|
58
|
+
|
|
59
|
+
Location: `~/.plastic/`
|
|
60
|
+
Governing intent(s): <list of founding intent IDs with descriptions>
|
|
61
|
+
|
|
62
|
+
## Decisions
|
|
63
|
+
|
|
64
|
+
<Copy ALL decisions from founding intent(s)' `## Context > ### Decisions`>
|
|
65
|
+
|
|
66
|
+
Each decision should include:
|
|
67
|
+
- The decision itself
|
|
68
|
+
- The rationale (why this choice)
|
|
69
|
+
- Date decided
|
|
70
|
+
|
|
71
|
+
## Project-Specific Rules
|
|
72
|
+
|
|
73
|
+
<Any rules derived from the decisions — e.g., "Use Minitest, not RSpec",
|
|
74
|
+
"37signals methodology", "sqlite-vec for vector storage">
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 5. Create Tactical Mirror
|
|
78
|
+
|
|
79
|
+
Create the first intent in the project's store at `~/.plastic/projects/{slug}/store/`:
|
|
80
|
+
|
|
81
|
+
**Directory:** `~/.plastic/projects/{slug}/store/1--{slug}/`
|
|
82
|
+
**File:** `~/.plastic/projects/{slug}/store/1--{slug}/1--{slug}.md`
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
---
|
|
86
|
+
id: '1'
|
|
87
|
+
intent: "<same description as founding intent>"
|
|
88
|
+
sources: ["global:<founding_intent_ID>"]
|
|
89
|
+
chain: []
|
|
90
|
+
created: <today>
|
|
91
|
+
author: <same as founding intent author>
|
|
92
|
+
tags: [<relevant tags>]
|
|
93
|
+
---
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Sections:
|
|
97
|
+
- `## Intent` — same as founding intent
|
|
98
|
+
- `## Context` — carry forward relevant Context and Decisions
|
|
99
|
+
- `## Outcome` — (pending)
|
|
100
|
+
- `## Insights` — empty
|
|
101
|
+
- `## Links` — `[[global:<founding_intent_ID>|<founding intent name>]]`
|
|
102
|
+
|
|
103
|
+
Update the project's `~/.plastic/projects/{slug}/INDEX.md`:
|
|
104
|
+
```markdown
|
|
105
|
+
# Index
|
|
106
|
+
|
|
107
|
+
## Active
|
|
108
|
+
- [1 — <intent name>](store/1--<slug>/1.md) — implementation, from: global:<ID>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**For multi-intent spawning (Hub):**
|
|
112
|
+
- `sources`: `["global:<id1>", "global:<id2>", ...]` — all founding intents
|
|
113
|
+
- All founding intents' decisions merge into AGENTS.md
|
|
114
|
+
- Context carries forward from all founding intents
|
|
115
|
+
|
|
116
|
+
### 6. Register in projects.yml
|
|
117
|
+
|
|
118
|
+
Read `~/.plastic/projects.yml` and add:
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
<slug>:
|
|
122
|
+
path: <full-path>
|
|
123
|
+
parent: "<founding_intent_ID>"
|
|
124
|
+
registered: <today>
|
|
125
|
+
status: active
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
For Hub-spawned projects, `parent` references the primary founding intent.
|
|
129
|
+
|
|
130
|
+
### 7. Mark Global Intent(s) Completed
|
|
131
|
+
|
|
132
|
+
For each founding intent:
|
|
133
|
+
|
|
134
|
+
1. Write `## Outcome` in the intent file:
|
|
135
|
+
> "Spawned project `<slug>` at `<path>`. Decisions carried to AGENTS.md. Tactical mirror: `project-<slug>:1`."
|
|
136
|
+
2. Write `outcome.md` with full details (all decisions, project path, tactical mirror ID)
|
|
137
|
+
3. Update `chain` to include `project-<slug>:1`
|
|
138
|
+
4. Move from `## Active` to `## Completed` in `~/.plastic/INDEX.md` (with today's date)
|
|
139
|
+
|
|
140
|
+
### 8. Framework Scaffolding
|
|
141
|
+
|
|
142
|
+
If decisions specify a framework, run the appropriate scaffolding command AFTER steps 3-4 (so scaffolding doesn't overwrite Plastic files or AGENTS.md):
|
|
143
|
+
|
|
144
|
+
| Framework | Command |
|
|
145
|
+
|---|---|
|
|
146
|
+
| Rails | `rails new <slug> [options from decisions] --skip-git` (skip git — already initialized) |
|
|
147
|
+
| Node/npm | `npm init -y` |
|
|
148
|
+
| Ruby gem | `bundle gem <slug>` |
|
|
149
|
+
| Other | As specified in decisions |
|
|
150
|
+
|
|
151
|
+
After scaffolding, verify AGENTS.md and `.plastic/` still exist. If scaffolding overwrote them, restore.
|
|
152
|
+
|
|
153
|
+
### 9. Auto-commit Both Stores
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
cd ~/.plastic && git add . && git commit -m "feat: spawn project <slug> from intent <ID>"
|
|
157
|
+
cd <project> && git add . && git commit -m "feat: initialize project from intent <ID>"
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 10. Announce
|
|
161
|
+
|
|
162
|
+
Log in `## Insights` of each founding intent:
|
|
163
|
+
> "Project `<slug>` created at `<path>`. Tactical mirror: `project-<slug>:1` (autonomous)"
|
|
164
|
+
|
|
165
|
+
Announce to user:
|
|
166
|
+
> "Project `<slug>` created at `<path>`. AGENTS.md populated with [N] decisions from [founding intent IDs]. Tactical mirror `1` is now the active intent in the project store."
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:executing-plan
|
|
3
|
+
description: Use when you have a written implementation plan to execute. Default mode is subagent-driven (dispatches fresh subagent per task with two-stage review). Fallback mode is inline execution for environments without subagent support. If superpowers:subagent-driven-development or superpowers:executing-plans are available, delegates to them.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Executing a Plan
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Load plan from the active intent's `plan.md`, execute all tasks, review between tasks, report when complete.
|
|
11
|
+
|
|
12
|
+
**Announce at start:** "I'm using the executing-plan skill to implement this plan."
|
|
13
|
+
|
|
14
|
+
## Mode Selection
|
|
15
|
+
|
|
16
|
+
### Check for superpowers first
|
|
17
|
+
If `superpowers:subagent-driven-development` is available as a skill, delegate to it. If only `superpowers:executing-plans` is available, delegate to that. If neither is available, use Plastic's own execution engine below.
|
|
18
|
+
|
|
19
|
+
**CRITICAL — when delegating to superpowers:**
|
|
20
|
+
- Tell the skill that the plan is at `~/.plastic/store/ID--slug/plan.md` (not `docs/superpowers/plans/`)
|
|
21
|
+
- Tell the skill that specs live at `~/.plastic/store/ID--slug/spec.md` (not `docs/superpowers/specs/`)
|
|
22
|
+
- All meta-artifacts must stay inside `~/.plastic/store/ID--slug/`
|
|
23
|
+
- Code files go in the project tree as normal
|
|
24
|
+
- Superpowers skills respect "user preferences for plan/spec location" — Plastic IS that preference
|
|
25
|
+
|
|
26
|
+
### Subagent-Driven (Default)
|
|
27
|
+
Dispatches a fresh subagent per task. Controller never implements — only dispatches, reviews, and tracks progress. Two-stage review after each task: spec compliance first, then code quality.
|
|
28
|
+
|
|
29
|
+
### Inline (Fallback)
|
|
30
|
+
Executes tasks sequentially in the current session. Use when subagents aren't available or user explicitly requests inline mode.
|
|
31
|
+
|
|
32
|
+
To select: user says "inline", "execute inline", or "no subagents".
|
|
33
|
+
|
|
34
|
+
## Subagent-Driven Workflow
|
|
35
|
+
|
|
36
|
+
### Step 1: Load Plan
|
|
37
|
+
1. Read the active intent's `plan.md`
|
|
38
|
+
2. Extract ALL tasks with their full text — store in memory. Never make subagents read the plan file.
|
|
39
|
+
3. Create a task list to track progress
|
|
40
|
+
|
|
41
|
+
### Step 2: Execute Each Task
|
|
42
|
+
|
|
43
|
+
For each task sequentially (never parallel — conflict risk):
|
|
44
|
+
|
|
45
|
+
**a. Dispatch implementer subagent**
|
|
46
|
+
Use the Agent tool with the implementer prompt template. Include:
|
|
47
|
+
- Full task text (pasted in, not file reference)
|
|
48
|
+
- Project context from CLAUDE.md
|
|
49
|
+
- Active intent context from `{ID}--{slug}.md`
|
|
50
|
+
|
|
51
|
+
**b. Handle implementer response**
|
|
52
|
+
- DONE → proceed to spec review
|
|
53
|
+
- DONE_WITH_CONCERNS → note concerns, proceed to spec review
|
|
54
|
+
- NEEDS_CONTEXT → provide missing context, re-dispatch
|
|
55
|
+
- BLOCKED → stop, report to user, wait for resolution
|
|
56
|
+
|
|
57
|
+
**c. Dispatch spec compliance reviewer**
|
|
58
|
+
Use the Agent tool with spec-reviewer prompt. The reviewer reads actual code and compares against the task requirements. Pass/fail.
|
|
59
|
+
- If fail: implementer fixes, spec reviewer re-reviews (loop until pass)
|
|
60
|
+
|
|
61
|
+
**d. Dispatch code quality reviewer**
|
|
62
|
+
Only after spec compliance passes. Reviews clean code, testing, architecture. Pass/fail.
|
|
63
|
+
- If fail: implementer fixes, quality reviewer re-reviews (loop until pass)
|
|
64
|
+
|
|
65
|
+
**e. Mark task complete**, move to next
|
|
66
|
+
|
|
67
|
+
### Step 3: Final Review
|
|
68
|
+
After all tasks complete, dispatch a final reviewer for the entire implementation.
|
|
69
|
+
|
|
70
|
+
### Step 4: Update Intent and Complete
|
|
71
|
+
Capture observations in `## Insights`. When ALL checklist items are checked:
|
|
72
|
+
|
|
73
|
+
1. Write `outcome.md` with detailed results in the intent directory
|
|
74
|
+
2. Write `## Outcome` summary in the intent file (1-2 sentences)
|
|
75
|
+
3. Move intent from `## Active` to `## Completed` in INDEX.md (with today's date)
|
|
76
|
+
4. Update cluster entries to show `_(completed)_`
|
|
77
|
+
5. Auto-commit: `cd <store-root> && git add . && git commit -m "feat: complete intent <ID> — <name>"`
|
|
78
|
+
|
|
79
|
+
**This is NOT optional.** An intent with all checklist items done but no Outcome is a broken state. Complete the intent immediately — do not leave it for later.
|
|
80
|
+
|
|
81
|
+
## Inline Workflow
|
|
82
|
+
|
|
83
|
+
### Step 1: Load and Review Plan
|
|
84
|
+
1. Read plan file from active intent
|
|
85
|
+
2. Review critically — raise concerns before starting
|
|
86
|
+
3. Create task list to track progress
|
|
87
|
+
|
|
88
|
+
### Step 2: Execute Tasks
|
|
89
|
+
For each task:
|
|
90
|
+
1. Mark as in_progress
|
|
91
|
+
2. Follow each step exactly
|
|
92
|
+
3. Run verifications as specified
|
|
93
|
+
4. Mark as completed
|
|
94
|
+
|
|
95
|
+
### Step 3: Update Intent and Complete
|
|
96
|
+
Capture observations in `## Insights`. When ALL checklist items are checked:
|
|
97
|
+
|
|
98
|
+
1. Write `outcome.md` with detailed results in the intent directory
|
|
99
|
+
2. Write `## Outcome` summary in the intent file (1-2 sentences)
|
|
100
|
+
3. Move intent from `## Active` to `## Completed` in INDEX.md (with today's date)
|
|
101
|
+
4. Update cluster entries to show `_(completed)_`
|
|
102
|
+
5. Auto-commit: `cd <store-root> && git add . && git commit -m "feat: complete intent <ID> — <name>"`
|
|
103
|
+
|
|
104
|
+
**This is NOT optional.** Complete the intent immediately when work is done.
|
|
105
|
+
|
|
106
|
+
## Model Selection for Subagents
|
|
107
|
+
|
|
108
|
+
Match model to task complexity:
|
|
109
|
+
- **Mechanical tasks** (config files, boilerplate): cheapest available
|
|
110
|
+
- **Standard implementation**: default model
|
|
111
|
+
- **Architecture, integration, review**: most capable model
|
|
112
|
+
|
|
113
|
+
## Prompt Templates
|
|
114
|
+
|
|
115
|
+
Subagent prompts are in this skill's directory:
|
|
116
|
+
- `implementer-prompt.md` — template for implementer subagents
|
|
117
|
+
- `spec-reviewer-prompt.md` — template for spec compliance reviewers
|
|
118
|
+
- `code-quality-reviewer-prompt.md` — template for code quality reviewers
|
|
119
|
+
|
|
120
|
+
Read the appropriate template when dispatching each subagent type.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Code Quality Reviewer Prompt
|
|
2
|
+
|
|
3
|
+
The implementation passed spec compliance review. Now review for code quality.
|
|
4
|
+
|
|
5
|
+
## Task That Was Implemented
|
|
6
|
+
|
|
7
|
+
{{TASK_TEXT}}
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
Review the changes for:
|
|
12
|
+
|
|
13
|
+
1. **Clean code** — clear naming, no unnecessary complexity, follows project conventions
|
|
14
|
+
2. **Single responsibility** — each file/function does one thing
|
|
15
|
+
3. **Testing quality** — tests are meaningful, not just coverage padding
|
|
16
|
+
4. **No regressions** — existing tests still pass
|
|
17
|
+
5. **File organization** — follows the plan's file structure, files aren't too large
|
|
18
|
+
|
|
19
|
+
## Report Format
|
|
20
|
+
|
|
21
|
+
**PASS** — Code quality is good. No significant issues.
|
|
22
|
+
|
|
23
|
+
**FAIL** — Issues found:
|
|
24
|
+
|
|
25
|
+
### Strengths
|
|
26
|
+
- What was done well
|
|
27
|
+
|
|
28
|
+
### Issues
|
|
29
|
+
- [file:line] Issue description and suggested fix
|
|
30
|
+
|
|
31
|
+
### Assessment
|
|
32
|
+
Overall quality rating and whether fixes are needed before proceeding.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Implementer Subagent Prompt
|
|
2
|
+
|
|
3
|
+
You are implementing a specific task from a plan. You have been given the full task text below.
|
|
4
|
+
|
|
5
|
+
## Your Task
|
|
6
|
+
|
|
7
|
+
{{TASK_TEXT}}
|
|
8
|
+
|
|
9
|
+
## Project Context
|
|
10
|
+
|
|
11
|
+
{{PROJECT_CONTEXT}}
|
|
12
|
+
|
|
13
|
+
## Active Intent
|
|
14
|
+
|
|
15
|
+
{{INTENT_CONTEXT}}
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
|
|
19
|
+
1. Read the task carefully. If anything is unclear, report NEEDS_CONTEXT with what you need.
|
|
20
|
+
2. Implement exactly what the task specifies — nothing more, nothing less.
|
|
21
|
+
3. Write tests first when the task includes test steps (TDD).
|
|
22
|
+
4. Follow the file paths specified in the task exactly.
|
|
23
|
+
5. Commit after each logical unit of work.
|
|
24
|
+
6. When done, self-review against this checklist:
|
|
25
|
+
- [ ] All steps in the task are completed
|
|
26
|
+
- [ ] Tests pass
|
|
27
|
+
- [ ] Code is clean and follows project conventions
|
|
28
|
+
- [ ] No unrelated changes
|
|
29
|
+
|
|
30
|
+
## Report Format
|
|
31
|
+
|
|
32
|
+
End your work with one of these status lines:
|
|
33
|
+
|
|
34
|
+
**DONE** — All steps completed, tests pass, code committed.
|
|
35
|
+
|
|
36
|
+
**DONE_WITH_CONCERNS** — Completed but I noticed: [describe concerns].
|
|
37
|
+
|
|
38
|
+
**NEEDS_CONTEXT** — I need clarification on: [specific questions].
|
|
39
|
+
|
|
40
|
+
**BLOCKED** — Cannot proceed because: [describe blocker].
|
|
41
|
+
|
|
42
|
+
It is always OK to report BLOCKED or NEEDS_CONTEXT. Do not guess or improvise when uncertain.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Spec Compliance Reviewer Prompt
|
|
2
|
+
|
|
3
|
+
The implementer says they finished this task. Verify independently — their report may be incomplete or optimistic.
|
|
4
|
+
|
|
5
|
+
## Task Requirements
|
|
6
|
+
|
|
7
|
+
{{TASK_TEXT}}
|
|
8
|
+
|
|
9
|
+
## Instructions
|
|
10
|
+
|
|
11
|
+
1. Read the actual code that was written (not the implementer's report)
|
|
12
|
+
2. Compare line by line against the task requirements
|
|
13
|
+
3. Check for:
|
|
14
|
+
- Missing requirements — anything in the task that wasn't implemented
|
|
15
|
+
- Extra work — anything added that the task didn't ask for
|
|
16
|
+
- Misunderstandings — code that doesn't match what the task intended
|
|
17
|
+
- Test coverage — are all specified behaviors tested?
|
|
18
|
+
|
|
19
|
+
## Report Format
|
|
20
|
+
|
|
21
|
+
**PASS** — All task requirements are correctly implemented. No gaps, no extras.
|
|
22
|
+
|
|
23
|
+
**FAIL** — Issues found:
|
|
24
|
+
- [file:line] Description of what's wrong and what was expected
|
|
25
|
+
- [file:line] Description of what's missing
|
|
26
|
+
|
|
27
|
+
Be specific. Reference exact file paths and line numbers.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:install
|
|
3
|
+
description: Use when initializing Plastic globally (~/.plastic/) or locally in a project. Global install is recommended — creates the global intent store as a git-backed repository. Local install creates .plastic/ in the current project for testing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Install Plastic
|
|
7
|
+
|
|
8
|
+
## Modes
|
|
9
|
+
|
|
10
|
+
### Global Install (default, recommended)
|
|
11
|
+
|
|
12
|
+
Run `/plastic:install` with no arguments.
|
|
13
|
+
|
|
14
|
+
#### Procedure
|
|
15
|
+
|
|
16
|
+
**Step 1: Check for existing installation**
|
|
17
|
+
|
|
18
|
+
Check if `~/.plastic/INDEX.md` exists.
|
|
19
|
+
- If yes: announce "Plastic is already installed at ~/.plastic/. Run `/plastic:update` to sync core files."
|
|
20
|
+
- If no: proceed with fresh install.
|
|
21
|
+
|
|
22
|
+
**Step 2: Create ~/.plastic/ as a git repo**
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mkdir -p ~/.plastic/store ~/.plastic/projects
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Copy templates from the plugin:
|
|
29
|
+
- `config.yml` from `${CLAUDE_PLUGIN_ROOT}/templates/config.yml`
|
|
30
|
+
- `projects.yml` from `${CLAUDE_PLUGIN_ROOT}/templates/projects.yml`
|
|
31
|
+
- `INDEX.md` from `${CLAUDE_PLUGIN_ROOT}/templates/index.md`
|
|
32
|
+
- `PLASTIC.md` from `${CLAUDE_PLUGIN_ROOT}/PLASTIC.md`
|
|
33
|
+
|
|
34
|
+
Create `AGENTS.md` (user-editable, not overwritten on updates):
|
|
35
|
+
```markdown
|
|
36
|
+
# Plastic — Agent Instructions
|
|
37
|
+
|
|
38
|
+
Read `PLASTIC.md` in this directory. It contains all Plastic conventions.
|
|
39
|
+
Follow it exactly. Never modify it — it is overwritten on plugin updates.
|
|
40
|
+
|
|
41
|
+
This file (`AGENTS.md`) is where project-specific rules live. Users and agents
|
|
42
|
+
may add content below.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Add `.gitkeep` to `store/` and `projects/`.
|
|
48
|
+
|
|
49
|
+
Initialize git:
|
|
50
|
+
```bash
|
|
51
|
+
cd ~/.plastic && git init && git add . && git commit -m "chore: initialize Plastic global intent store"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Step 2b: Copy utility scripts**
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
mkdir -p ~/.plastic/scripts
|
|
58
|
+
cp "${CLAUDE_PLUGIN_ROOT}/scripts/folgezettel-id" ~/.plastic/scripts/folgezettel-id
|
|
59
|
+
cp "${CLAUDE_PLUGIN_ROOT}/scripts/read-config" ~/.plastic/scripts/read-config
|
|
60
|
+
chmod +x ~/.plastic/scripts/folgezettel-id ~/.plastic/scripts/read-config
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
This ensures project agents can generate hashes via `~/.plastic/scripts/folgezettel-id` without depending on a specific agent's plugin cache path.
|
|
64
|
+
|
|
65
|
+
**Step 2c: Detect agent type and set preferences**
|
|
66
|
+
|
|
67
|
+
Detect which agent is running:
|
|
68
|
+
- If `CLAUDE_CODE` env var is set or we're running inside Claude Code → `agent.type: claude-code`
|
|
69
|
+
- If `HERMES_HOME` env var is set → `agent.type: hermes`
|
|
70
|
+
- Otherwise → ask the user: "Which AI agent are you using? (claude-code / hermes / other)"
|
|
71
|
+
|
|
72
|
+
Ask the user:
|
|
73
|
+
> "Enable Agent Teams? (experimental — parallel project work with teammates)"
|
|
74
|
+
> - Yes → set `parallel_mode: agent-teams`
|
|
75
|
+
> - No → set `parallel_mode: linear` (subagents only)
|
|
76
|
+
|
|
77
|
+
Update `~/.plastic/config.yml` with detected/chosen values using `read-config --migrate` first to ensure v3 schema, then write the agent-specific values.
|
|
78
|
+
|
|
79
|
+
Auto-commit the config change.
|
|
80
|
+
|
|
81
|
+
**Step 2d: Configure GitHub and push preferences**
|
|
82
|
+
|
|
83
|
+
Inform the user:
|
|
84
|
+
> "Plastic agents can create GitHub repositories for new projects.
|
|
85
|
+
> By default, all agent-created repos are **private**. Your global
|
|
86
|
+
> intent store (~/.plastic/) is never pushed — it stays local-only."
|
|
87
|
+
|
|
88
|
+
Ask the user:
|
|
89
|
+
> "Default visibility for agent-created repos?"
|
|
90
|
+
> - Private (recommended) → set `github.default_visibility: private`
|
|
91
|
+
> - Public → set `github.default_visibility: public`
|
|
92
|
+
|
|
93
|
+
> "Allow agents to push to GitHub without asking?"
|
|
94
|
+
> - No (recommended) → set `github.auto_push: false`
|
|
95
|
+
> - Yes → set `github.auto_push: true`
|
|
96
|
+
|
|
97
|
+
Update `config.yml` with chosen values. Auto-commit.
|
|
98
|
+
|
|
99
|
+
**Step 3: Configure project roots**
|
|
100
|
+
|
|
101
|
+
Ask the user:
|
|
102
|
+
> "Where do you keep your projects? Default: ~/.plastic/projects/"
|
|
103
|
+
> "Add additional roots? (e.g., ~/apps/personal/, ~/apps/companies/)"
|
|
104
|
+
|
|
105
|
+
Update `config.yml` with any additional roots.
|
|
106
|
+
|
|
107
|
+
Auto-commit the config change.
|
|
108
|
+
|
|
109
|
+
**Step 4: Announce**
|
|
110
|
+
|
|
111
|
+
> "Plastic installed globally at ~/.plastic/. Create your first intent with `/plastic:creating-intent`."
|
|
112
|
+
|
|
113
|
+
### Local Install (testing/legacy)
|
|
114
|
+
|
|
115
|
+
Run `/plastic:install --local`.
|
|
116
|
+
|
|
117
|
+
#### Procedure
|
|
118
|
+
|
|
119
|
+
**Step 1:** Check if `.plastic/` exists in CWD — if so, warn and exit.
|
|
120
|
+
|
|
121
|
+
**Step 2:** Create `.plastic/` in CWD:
|
|
122
|
+
- `config.yml` from templates
|
|
123
|
+
- `INDEX.md` from templates
|
|
124
|
+
- `store/` with `.gitkeep`
|
|
125
|
+
|
|
126
|
+
**Step 3:** If global install exists (`~/.plastic/projects.yml`), register this project:
|
|
127
|
+
- Determine project slug from directory name
|
|
128
|
+
- Detect git remote URL if available
|
|
129
|
+
- Add entry to `~/.plastic/projects.yml` with `parent: null`
|
|
130
|
+
- Auto-commit in `~/.plastic/`
|
|
131
|
+
|
|
132
|
+
**Step 4:** Commit in project: `git add .plastic/ && git commit -m "chore: initialize Plastic local store"`
|
|
133
|
+
|
|
134
|
+
**Step 5:** Announce: "Plastic initialized locally. This is a testing/legacy mode. Consider `/plastic:install` for global mode."
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:intent-curator
|
|
3
|
+
description: |
|
|
4
|
+
Use when completing or reviewing intents, reorganizing the index,
|
|
5
|
+
or when the intent store needs maintenance. Examples:
|
|
6
|
+
<example>Context: User has finished implementing a feature.
|
|
7
|
+
user: "This intent is done, clean up the index"
|
|
8
|
+
assistant: "I'll use the intent-curator to update the intent status and reorganize INDEX.md"
|
|
9
|
+
<commentary>Intent lifecycle change triggers curator for index maintenance.</commentary></example>
|
|
10
|
+
<example>Context: The intent store has grown and clusters need review.
|
|
11
|
+
user: "Organize the intents"
|
|
12
|
+
assistant: "I'll use the intent-curator to review clusters, flag orphans, and suggest connections"
|
|
13
|
+
<commentary>Periodic maintenance of the Zettelkasten structure.</commentary></example>
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# Intent Curator
|
|
17
|
+
|
|
18
|
+
Dispatches to the `plastic:intent-curator` agent for intent store maintenance.
|
|
19
|
+
|
|
20
|
+
## When to Use
|
|
21
|
+
- Completing or reviewing intents
|
|
22
|
+
- Reorganizing INDEX.md
|
|
23
|
+
- Cluster maintenance, orphan detection, link discovery
|
|
24
|
+
- Batch status updates
|
|
25
|
+
|
|
26
|
+
## Workflow
|
|
27
|
+
|
|
28
|
+
Invoke the `plastic:intent-curator` agent via the Agent tool with `subagent_type: "plastic:intent-curator"`. Pass the user's request as the prompt, including:
|
|
29
|
+
|
|
30
|
+
1. **What to do** — complete intent, reorganize, triage stale, etc.
|
|
31
|
+
2. **Which store** — global (`~/.plastic/`) or project (`.plastic/store/`)
|
|
32
|
+
3. **Which intents** — by ID or "all active"
|
|
33
|
+
|
|
34
|
+
The agent handles:
|
|
35
|
+
- Intent lifecycle management (status transitions, Outcome sections)
|
|
36
|
+
- INDEX.md maintenance (Active/Future/Clusters/Completed sections)
|
|
37
|
+
- Link discovery between related intents
|
|
38
|
+
- Cluster management (create, merge, rename)
|
|
39
|
+
- Orphan detection
|
|
40
|
+
|
|
41
|
+
After the agent completes, report what changed.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plastic:linking-intents
|
|
3
|
+
description: Use when creating connections between intents, the user says "link" or "connect", or when discovering that two intents are related. Manages sources, chain, and cross-reference links.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Linking Intents
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
- During intent creation (automatic — ask about related intents)
|
|
10
|
+
- User says "link", "connect", "relates to"
|
|
11
|
+
- Agent discovers a relationship between intents during work
|
|
12
|
+
|
|
13
|
+
## Connection Types (Ranked by Strength)
|
|
14
|
+
|
|
15
|
+
### 1. Direct Links (Strongest)
|
|
16
|
+
Explicit wikilinks in the `## Links` section. Bidirectional — add to both intents.
|
|
17
|
+
|
|
18
|
+
```markdown
|
|
19
|
+
## Links
|
|
20
|
+
- [[1a]] — research this plan is based on
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 2. Sources (Backward)
|
|
24
|
+
The `sources` array in frontmatter. What influenced this intent — backward links to parent/prior work:
|
|
25
|
+
```yaml
|
|
26
|
+
sources: ["1a", "1a2"]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### 3. Chain (Forward)
|
|
30
|
+
The `chain` array in frontmatter. What this intent spawned — forward links to children/follow-on work:
|
|
31
|
+
```yaml
|
|
32
|
+
chain: ["1b1", "1b2"]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 4. Tags (Weakest)
|
|
36
|
+
Shared tags in frontmatter enable filtered discovery. Use `project-<name>` tags for project membership.
|
|
37
|
+
```yaml
|
|
38
|
+
tags: [plastic, project-reddit-kb]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Workflow
|
|
42
|
+
|
|
43
|
+
### 1. Identify Intents to Connect
|
|
44
|
+
Show existing intents by scanning the store's directory for intent files:
|
|
45
|
+
```bash
|
|
46
|
+
for dir in $STORE_ROOT/store/*/; do
|
|
47
|
+
f=$(find "$dir" -maxdepth 1 -name "*.md" ! -name "spec.md" ! -name "plan.md" ! -name "checklist.md" ! -name "outcome.md" ! -name "savepoint.md" | head -1)
|
|
48
|
+
[ -n "$f" ] && ruby -ryaml -e '
|
|
49
|
+
data = File.read(ARGV[0]).split("---")[1]
|
|
50
|
+
parsed = YAML.safe_load(data)
|
|
51
|
+
puts "#{parsed["id"]} | #{parsed["intent"]}" if parsed
|
|
52
|
+
' "$f" 2>/dev/null
|
|
53
|
+
done
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### 2. Choose Connection Type
|
|
57
|
+
Ask the user which type of connection:
|
|
58
|
+
- **source** — "this was influenced by that" (add to `sources[]`, update `chain[]` on the target)
|
|
59
|
+
- **cross-reference** — "these are related" (add wikilink in `## Links` of both intents)
|
|
60
|
+
|
|
61
|
+
### 3. Apply Connection
|
|
62
|
+
|
|
63
|
+
**For sources:**
|
|
64
|
+
Update frontmatter arrays on both intents:
|
|
65
|
+
- Add the parent's ID to the child's `sources` array
|
|
66
|
+
- Add the child's ID to the parent's `chain` array
|
|
67
|
+
|
|
68
|
+
**For cross-references:**
|
|
69
|
+
Add a wikilink in the `## Links` section of **both** intents (bidirectional).
|
|
70
|
+
|
|
71
|
+
### 4. Update INDEX.md Clusters
|
|
72
|
+
If both intents share a topic, ensure they're in the same cluster.
|