@zalom/plastic 2.0.0-alpha.21 → 2.0.0-alpha.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLASTIC.md +20 -18
- package/package.json +1 -1
- package/scripts/doctor.rb +79 -4
- package/scripts/hook-session-start +293 -321
- package/scripts/insight-append +18 -4
- package/scripts/lib/installer_core.rb +3 -3
- package/scripts/skill-lint +115 -6
- package/skills/auto/SKILL.md +53 -55
- package/skills/auto/references/agent-architecture.md +10 -8
- package/skills/auto/references/human-report-contract.md +1 -1
- package/skills/conventions/references/completion-and-done.md +7 -7
- package/skills/conventions/references/locks-and-worktrees.md +3 -3
- package/skills/conventions/references/maintenance-and-revisions.md +1 -1
- package/skills/doctor/report.md +1 -1
- package/skills/intent-continuing/references/boarding-matrix.md +2 -2
- package/skills/intent-creating/SKILL.md +58 -133
- package/skills/intent-ending/SKILL.md +48 -56
- package/skills/intent-ending/evals/evals.json +1 -1
- package/skills/intent-executing/SKILL.md +38 -137
- package/skills/intent-speccing/SKILL.md +3 -0
- package/skills/releasing/SKILL.md +1 -1
- package/skills/releasing/references/release-lines.md +1 -1
- package/skills/tutorial/SKILL.md +2 -1
- package/skills/tutorial/references/track-1-guided.md +21 -40
- package/skills/tutorial/references/track-2-auto.md +2 -2
- package/templates/agents.md +2 -2
|
@@ -6,110 +6,51 @@ user-invocable: true
|
|
|
6
6
|
|
|
7
7
|
# Creating an Intent
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Creating writes the thought to disk: an id, a directory, a born-complete intent file.
|
|
10
|
+
Nothing else runs here; specifying, planning, and execution are separate, later skills.
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
10
13
|
- User starts new work ("build X", "fix Y", "research Z")
|
|
11
14
|
- No active intent matches the current task
|
|
12
15
|
- User explicitly says "new intent" or "create intent"
|
|
13
16
|
- An agent discovers work needed during implementation
|
|
14
17
|
|
|
15
|
-
##
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
When creating a tactical intent in a project store:
|
|
33
|
-
- Read the project's `AGENTS.md` for project context and decisions
|
|
34
|
-
- Link back to the project's governing intent (from `projects.yml` `parent` field) via `sources` (the project genuinely is formed from its founding intent, a true formative edge, reciprocated on the founding intent's `chain`)
|
|
35
|
-
- Add `[[global:<parent_ID>]]` backlink in `## Links`
|
|
36
|
-
- The intent's Folgezettel ID is scoped to the project store (run `folgezettel-id` against the project's store at `~/.plastic/projects/{slug}/store/`)
|
|
37
|
-
|
|
38
|
-
## Workflow
|
|
18
|
+
## Decide the store and the shape, before scaffolding
|
|
19
|
+
|
|
20
|
+
- **CWD inside a registered project** (`~/.plastic/projects.yml`), or the user names a
|
|
21
|
+
project by slug -> **project intent (tactical)**, `~/.plastic/projects/{slug}/store/`,
|
|
22
|
+
linked back to the project's governing intent (`projects.yml` `parent` field) via
|
|
23
|
+
`sources`, with `[[global:<parent_ID>]]` in `## Links` and a Folgezettel id scoped to
|
|
24
|
+
that store.
|
|
25
|
+
- **No match** -> **global intent (strategic)**, `~/.plastic/store/`.
|
|
26
|
+
- **Duplicate or predecessor check (QMD-first):** before allocating an id, run
|
|
27
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` (a no-op when QMD is absent, fall
|
|
28
|
+
back to INDEX.md) so a near-duplicate is reused and a true predecessor lands in
|
|
29
|
+
`--sources`.
|
|
30
|
+
- **Branch vs root**, decided by meaning, not by "a parent in mind": branch
|
|
31
|
+
(`--parent <parent_id>`) when the intent only makes sense as part of the parent's work;
|
|
32
|
+
root with `--sources <ascendant_id>` when it was created from another intent's
|
|
33
|
+
lifecycle; root with no `--sources` when it is merely related (record that relation on
|
|
34
|
+
the PREDECESSOR's `chain` instead - topic similarity alone is never a `sources` edge).
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### 2. Check for a Duplicate or Predecessor (QMD-first)
|
|
46
|
-
|
|
47
|
-
QMD-first (when available): before scanning the store with grep/Read, run
|
|
48
|
-
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or duplicate
|
|
49
|
-
intents, then open the authoritative intent file for any hit you act on. The command is a no-op
|
|
50
|
-
when QMD is absent, so fall back to the existing INDEX.md / file scan. Do this before allocating
|
|
51
|
-
the id so a near-duplicate can be reused and a true predecessor can be set in `--sources`.
|
|
52
|
-
|
|
53
|
-
### 3. Decide Branch vs Root
|
|
36
|
+
When a branch intent exists because a late ruling arrived AFTER its parent was already
|
|
37
|
+
completed, the parent is restored to v1 via `scripts/restore-intent-v1`, never a hand-run
|
|
38
|
+
`git checkout`/revert (see `plastic-conventions > references/maintenance-and-revisions.md`,
|
|
39
|
+
WORK vs MAINTENANCE).
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
|
|
41
|
+
`## Links` is a DERIVED view of `sources`/`chain`: never hand-write a `## Links` line, add
|
|
42
|
+
the frontmatter edge and reproject. Links follow context influence (a `chain` edge needs
|
|
43
|
+
the candidate's context to materially help deliver this intent), never shared files or a
|
|
44
|
+
similarity score; `scripts/link-suggest` and `scripts/project-links` gather candidates.
|
|
45
|
+
Read `../plastic-conventions/references/knowledge-graph.md` for the full linking doctrine:
|
|
46
|
+
the tiers of influence, sources versus chain, and how `## Links` is derived.
|
|
57
47
|
|
|
58
|
-
|
|
59
|
-
makes sense as part of the parent's work. Pass `--parent <parent_id>`.
|
|
60
|
-
- **Root (`15`, `16`)**: an independent thought. Two cases, decided by ORIGIN:
|
|
61
|
-
- **Created from another intent** (it emerged from that intent's lifecycle): make it a
|
|
62
|
-
root and set `--sources <ascendant_id>`. `sources` is reserved for true created-from /
|
|
63
|
-
direct-ascendant provenance (D1).
|
|
64
|
-
- **Merely related to / inspired by another intent** (it did NOT come out of that
|
|
65
|
-
intent's lifecycle): carry NO `--sources`. Record the relation on the PREDECESSOR's
|
|
66
|
-
`chain` instead (the related-but-not-spawned rule); the `## Links` section follows
|
|
67
|
-
from that edge, you do not write it by hand.
|
|
68
|
-
- **Rule of thumb:** if the intent could exist without its parent, make it a root; only set
|
|
69
|
-
`--sources` when it was genuinely created from / emerged from that intent's lifecycle.
|
|
70
|
-
Topic similarity alone is not a `sources` edge.
|
|
48
|
+
## Scaffold
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`
|
|
76
|
-
rule and the tool.
|
|
77
|
-
|
|
78
|
-
`## Links` is a DERIVED view of `sources`/`chain`. Never hand-write a `## Links` line; add the
|
|
79
|
-
frontmatter edge and reproject. Links are decided by context influence (a `chain` edge has a high
|
|
80
|
-
bar: the candidate's context must materially help deliver this intent), not by shared files or a
|
|
81
|
-
similarity score. To gather candidates with their context and record an edge, use the
|
|
82
|
-
`scripts/link-suggest` and `scripts/project-links`.
|
|
83
|
-
|
|
84
|
-
Read `../plastic-conventions/references/knowledge-graph.md` for the full linking doctrine: the
|
|
85
|
-
tiers of influence, sources versus chain, and how the `## Links` projection is derived. This path
|
|
86
|
-
resolves relative to this skill's own installed directory.
|
|
87
|
-
|
|
88
|
-
### 4. Determine Intent Properties
|
|
89
|
-
|
|
90
|
-
Ask or infer from context:
|
|
91
|
-
- **intent**: one-line description
|
|
92
|
-
- **slug**: short hyphenated handle for the directory name
|
|
93
|
-
- **author**: `human` | `claude-code` | other agent name
|
|
94
|
-
- **sources**: the direct ascendant(s) this intent was created from / emerged from the
|
|
95
|
-
lifecycle of (formation, not topic similarity), e.g., `4a1`. For a project intent,
|
|
96
|
-
include the governing intent's id. A branch's structural parent is ALSO recorded in
|
|
97
|
-
`sources` (the ID carries it for the human/paper tree, `sources` carries it for
|
|
98
|
-
software), which `new-intent` does automatically (see `new-intent:126`).
|
|
99
|
-
- **tags**: freeform list (use `project-<name>` for project membership)
|
|
100
|
-
|
|
101
|
-
`chain` carries what this intent spawns AND related-but-not-spawned successors it leads to;
|
|
102
|
-
it starts empty and is populated later. See
|
|
103
|
-
[`how-plastic-sources-and-chains-intents.md`](https://github.com/zalom/plastic/blob/main/docs/concepts/how-plastic-sources-and-chains-intents.md) for the full model.
|
|
104
|
-
Place the intent in `## Active` or `## Future` in INDEX.md (status is
|
|
105
|
-
convention-derived, not a frontmatter field).
|
|
106
|
-
|
|
107
|
-
### 5. Scaffold via new-intent (single call)
|
|
108
|
-
|
|
109
|
-
Delegate id allocation, directory and file creation, the born-complete intent
|
|
110
|
-
file, the sentinel placeholder lifecycle files, the reciprocal file links, and
|
|
111
|
-
self-validation to one `new-intent` invocation. Do NOT hand-author any of these
|
|
112
|
-
files.
|
|
50
|
+
One call does the rest: id allocation, the directory, `actions/` and `resources/`, the
|
|
51
|
+
born-complete intent file, sentinel placeholder lifecycle files (each marked
|
|
52
|
+
`<!-- plastic:placeholder -->` so no stage detector reads them as reached), reciprocal
|
|
53
|
+
`[[id]]` links, and self-validation. Do NOT hand-author any of these files.
|
|
113
54
|
|
|
114
55
|
```bash
|
|
115
56
|
ruby ~/.plastic/scripts/new-intent \
|
|
@@ -118,47 +59,31 @@ ruby ~/.plastic/scripts/new-intent \
|
|
|
118
59
|
[--sources "id,id"] [--tags "project-<slug>,tag"]
|
|
119
60
|
```
|
|
120
61
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
placeholder `spec.md`/`plan.md`/`checklist.md`/`outcome.md` (each marked
|
|
125
|
-
`<!-- plastic:placeholder -->` so no stage detector reads them as reached), wires
|
|
126
|
-
the reciprocal `[[id]]` links, and self-validates (frontmatter plus the sanctioned
|
|
127
|
-
`##` sections). It prints the created directory path and exits 0.
|
|
128
|
-
|
|
129
|
-
It does NOT touch INDEX.md, git, or project creation: those stay in this skill
|
|
130
|
-
(steps 6 to 9 below).
|
|
131
|
-
|
|
132
|
-
If `new-intent` exits non-zero, read the stderr report and fix the inputs (slug,
|
|
133
|
-
intent, sources). Do not commit or announce an intent that did not scaffold
|
|
134
|
-
cleanly, and do not work around the failure by hand-writing the files.
|
|
135
|
-
|
|
136
|
-
### 6. If Implementation Intent Spawns a Project
|
|
137
|
-
|
|
138
|
-
When the user says "start building" or the plan calls for a new project, invoke the
|
|
139
|
-
`plastic-project-creating` skill; it owns project directory creation, AGENTS.md
|
|
140
|
-
population, projects.yml registration, store provisioning, and the auto-commit of
|
|
141
|
-
both stores. Add `project-<slug>` to this intent's `tags` array either before
|
|
142
|
-
invoking it or as part of that skill's handoff.
|
|
143
|
-
|
|
144
|
-
### 7. Update INDEX.md
|
|
62
|
+
It does NOT touch INDEX.md, git, or project creation (Finish, below). If it exits
|
|
63
|
+
non-zero, read the stderr report, fix the inputs (slug, intent, sources), and retry;
|
|
64
|
+
never work around a failed scaffold by hand-writing the files.
|
|
145
65
|
|
|
146
|
-
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### 8. Auto-commit
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
cd <store-root> && git add . && git commit -m "feat: create intent ID - [name]"
|
|
155
|
-
```
|
|
66
|
+
`chain` carries what this intent spawns AND related-but-not-spawned successors it leads
|
|
67
|
+
to; it starts empty and is populated later. See
|
|
68
|
+
[`how-plastic-sources-and-chains-intents.md`](https://github.com/zalom/plastic/blob/main/docs/concepts/how-plastic-sources-and-chains-intents.md)
|
|
69
|
+
for the full model.
|
|
156
70
|
|
|
157
|
-
|
|
71
|
+
## Finish
|
|
158
72
|
|
|
159
|
-
|
|
73
|
+
1. **Global intent:** add a line to `~/.plastic/INDEX.md` under `## Active` (or
|
|
74
|
+
`## Future`) and the right cluster. **Project intent:** no global INDEX.md change.
|
|
75
|
+
2. When the user says "start building" or the plan calls for a new project, invoke
|
|
76
|
+
`plastic-project-creating`; it owns project directory creation, AGENTS.md population,
|
|
77
|
+
`projects.yml` registration, store provisioning, and the auto-commit of both stores.
|
|
78
|
+
Add `project-<slug>` to this intent's `tags` either before invoking it or as part of
|
|
79
|
+
that skill's handoff.
|
|
80
|
+
3. Commit: `cd <store-root> && git add . && git commit -m "feat: create intent ID - [name]"`.
|
|
81
|
+
4. Announce: "Created intent ID - [name]. Placed in: [Active|Future]. Store:
|
|
82
|
+
[global|project:<slug>]."
|
|
160
83
|
|
|
161
84
|
## References
|
|
162
85
|
|
|
163
|
-
- Read `references/lifecycle.md` for the full What
|
|
164
|
-
-
|
|
86
|
+
- Read `references/lifecycle.md` for the full What->Why->How->Exec stage detail and the
|
|
87
|
+
filesystem-as-schema conventions.
|
|
88
|
+
- Read `references/wikilinks.md` for the wikilink syntax table when hand-checking a
|
|
89
|
+
`## Links` projection.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plastic-intent-ending
|
|
3
3
|
description: >
|
|
4
|
-
Wrap, finish,
|
|
5
|
-
when completing or abandoning an intent, when a
|
|
6
|
-
|
|
4
|
+
Wrap, finish, or close an intent as delivered or abandoned. Use
|
|
5
|
+
when completing or abandoning an intent, when a graph's last node
|
|
6
|
+
reaches a terminal status (or, for a legacy intent, a checklist
|
|
7
|
+
reaches 100 percent) and Exec is finished, or when asked to "wrap
|
|
8
|
+
this up".
|
|
7
9
|
user-invocable: true
|
|
8
10
|
---
|
|
9
11
|
|
|
@@ -26,7 +28,7 @@ installed directory.
|
|
|
26
28
|
| 0 | Precondition check | You, before touching outcome.md |
|
|
27
29
|
| 1 | backfill spec/plan/action/outcome from the record, self-check, intent-file `## Outcome` summary | `scripts/end-intent` |
|
|
28
30
|
| 2 | INDEX.md terminal move (Active -> Completed/Abandoned) | `scripts/end-intent` |
|
|
29
|
-
| 3 | savepoint
|
|
31
|
+
| 3 | the terminal savepoint line | `scripts/end-intent` |
|
|
30
32
|
| 4 | store auto-commit | `scripts/end-intent` |
|
|
31
33
|
| 5 | disarm (worktree + lock) | `scripts/end-intent` (intent 188) |
|
|
32
34
|
| 6 | QMD reindex, async, LAST | You |
|
|
@@ -45,50 +47,47 @@ Nothing refuses the close any more (the 1.x write-time gate and `end-intent`'s
|
|
|
45
47
|
exit-6 structure gate were retired in 2.0, intents 302 and 308). What you leave
|
|
46
48
|
on disk is what the record becomes, so before the call:
|
|
47
49
|
|
|
48
|
-
1.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
1. For an intent with a `graph.md`: confirm every node's Status in `graph.md` is
|
|
51
|
+
terminal (`done` or `failed_verification`, nothing left `running`, `blocked`, or
|
|
52
|
+
waiting `needs_decision`), and that the last verify node's gates were
|
|
53
|
+
accepted. A node still open is not a refusal, it is a reported gap that lands
|
|
54
|
+
verbatim in the backfilled `## Follow-ups`.
|
|
55
|
+
For an intent with no `graph.md` (legacy): read checklist.md, tick every item as
|
|
56
|
+
it is actually performed, including an item that describes the close itself:
|
|
57
|
+
running this very procedure IS what that item describes; an unchecked box is not
|
|
58
|
+
a refusal, it is a reported gap. Also confirm every acceptance criterion in
|
|
59
|
+
spec.md is verifiable (tests pass, or the manual check described in its HOW line
|
|
60
|
+
was actually run).
|
|
61
|
+
2. Decide what you have to say. For an intent with a `graph.md`, never hand-write
|
|
62
|
+
`outcome.md`: `scripts/end-intent` GENERATES it, through
|
|
63
|
+
`scripts/lib/outcome_report.rb` (`scripts/outcome-report` is its standalone
|
|
64
|
+
CLI, useful for checking the generated text before the close). `## Delivered`,
|
|
65
|
+
`## Verification`, `## Graph diff`, and `## Findings` are read straight from
|
|
66
|
+
`graph.md`, `nodes/`, and the ledger every time, in plain wording a reader
|
|
67
|
+
recognizes, never hand-typed; when the generated wording is wrong, fix
|
|
68
|
+
`graph.md` or `nodes/`, the source it reads from, not the report. `## Summary`,
|
|
69
|
+
`## Needs you`, and `## Follow-ups`, and every frontmatter key but
|
|
70
|
+
`disposition`, are preserved byte for byte when you author them and
|
|
71
|
+
generated as plain facts otherwise. For an intent with no `graph.md`, a
|
|
72
|
+
spec.md, plan.md, action file, or outcome.md left as the scaffold placeholder
|
|
73
|
+
is written from the record by `scripts/end-intent` (the intent file's
|
|
74
|
+
`## Intent`, `### Decisions`, and `## Insights`, the checklist, the worktree
|
|
75
|
+
diff). A file you wrote, even under a still-present sentinel, is never touched.
|
|
69
76
|
|
|
70
77
|
### Step 1-5. Run `scripts/end-intent`
|
|
71
78
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
`##
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
abandonment reason and the trail (see Pivot below). An intent with a `graph.md` and no
|
|
85
|
-
hand-written outcome.md gets one generated instead (Step 0.3 above); a placeholder
|
|
86
|
-
outcome.md on an intent with no `graph.md` is backfilled from the record, with the
|
|
87
|
-
close's disposition and the `--outcome-summary` line as its summary. Also author
|
|
88
|
-
the rich INDEX entry note now (a short line in the store's existing
|
|
89
|
-
Completed/Abandoned convention: mode, what shipped or why it was
|
|
90
|
-
abandoned, suite result, merge/spawn notes); content authoring stays with
|
|
91
|
-
you, `--index-note` only appends what you write.
|
|
79
|
+
For an intent with a `graph.md`, do not author `outcome.md` by hand: run
|
|
80
|
+
`ruby ~/.plastic/scripts/outcome-report <intent_dir> --write --disposition delivered|abandoned`
|
|
81
|
+
if you want to see the generated text before the close, or let the single call below write it.
|
|
82
|
+
`## Summary`, `## Needs you`, and `## Follow-ups` are the sections worth your own words; edit
|
|
83
|
+
those into the file before the call when the generator's plain facts say too little (they are
|
|
84
|
+
preserved byte for byte). `## Needs you` is the literal None or a `| N | What | Why |` table.
|
|
85
|
+
On abandon, `## Summary` states the abandonment reason and the trail (see Pivot below). An
|
|
86
|
+
intent with no `graph.md` gets a placeholder outcome.md backfilled from the record instead,
|
|
87
|
+
with the close's disposition and the `--outcome-summary` line as its summary. Also author the
|
|
88
|
+
rich INDEX entry note now (a short line in the store's existing Completed/Abandoned
|
|
89
|
+
convention: mode, what shipped or why it was abandoned, suite result, merge/spawn notes);
|
|
90
|
+
content authoring stays with you, `--index-note` only appends what you write.
|
|
92
91
|
|
|
93
92
|
Then call the script once:
|
|
94
93
|
|
|
@@ -110,23 +109,16 @@ line from `## Active` to `## Completed` or `## Abandoned` (dated today,
|
|
|
110
109
|
idempotent, accepting either a real em dash or a plain hyphen as the id/
|
|
111
110
|
title separator on read while always emitting the real em dash on write)
|
|
112
111
|
with the `--index-note` text appended after the date so the entry stays
|
|
113
|
-
rich, appends the savepoint
|
|
112
|
+
rich, appends the terminal savepoint line, commits the store repo, and
|
|
114
113
|
disarms (releases the code worktree and clears `delivery.lock`, verified
|
|
115
114
|
against the durable lock file on disk, never merely trusted). Omit
|
|
116
115
|
`--index-note` for a thin id+date entry, add `--no-commit` when a separate
|
|
117
116
|
commit step already covers the store (this never skips disarm), and
|
|
118
117
|
`--dry-run` to preview steps 1-5 with no writes.
|
|
119
118
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
existing `delivery.lock`. A live foreign session refuses the whole run
|
|
124
|
-
(exit 4, nothing written); a stale foreign lock is reclaimed automatically
|
|
125
|
-
(audited to savepoint.md) and the run proceeds as the new owner. Before
|
|
126
|
-
removing the worktree, step 5 also refuses on an unexpectedly dirty code
|
|
127
|
-
worktree (exit 5, naming the worktree path) rather than force-discarding
|
|
128
|
-
uncommitted changes; pass `--discard-worktree-changes` only when you mean
|
|
129
|
-
to override that deliberately.
|
|
119
|
+
Read `../plastic-conventions/references/completion-and-done.md` for the pre-flight lock guard
|
|
120
|
+
and the dirty-worktree refusal this call runs before writing anything (exit 4 and exit 5
|
|
121
|
+
below); this procedure only calls `end-intent`, it never re-implements them.
|
|
130
122
|
|
|
131
123
|
On the auto mode / curator path (no release), this single call performs the
|
|
132
124
|
FULL disarm (plain worktree remove, since the branch survives for later
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"scope": "behavior",
|
|
20
20
|
"set": "train",
|
|
21
21
|
"prompt": "Run the mechanical close (scripts/end-intent) for a delivered intent with a real outcome.md.",
|
|
22
|
-
"expected_output": "The savepoint
|
|
22
|
+
"expected_output": "The terminal savepoint line lands exactly once in savepoint.md, and a second run of the same command does not duplicate it (this is the regression the intent fixes: releasing used to skip this line entirely).",
|
|
23
23
|
"files": [],
|
|
24
24
|
"assertions": [
|
|
25
25
|
{ "type": "human", "check": "SKILL.md Step 1-4 calls scripts/end-intent as one script instead of restating the outcome/INDEX/savepoint one-liners in prose", "result": "expect-pass" },
|
|
@@ -1,116 +1,61 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plastic-intent-executing
|
|
3
|
-
description: Use when you have a
|
|
3
|
+
description: Use when you have a graph or a plan to execute. A graph delivery runs on
|
|
4
|
+
`scripts/runner`'s three verbs, `step`, `status`, and `answer`; older, non-graph work
|
|
5
|
+
dispatches the `plastic-executor` agent for one consolidated action.
|
|
4
6
|
user-invocable: true
|
|
5
7
|
---
|
|
6
8
|
|
|
7
9
|
# Executing a Plan
|
|
8
10
|
|
|
9
|
-
## Overview
|
|
10
|
-
|
|
11
|
-
Load plan from the active intent's `plan.md`, execute all tasks, review as below, report when complete.
|
|
12
|
-
|
|
13
11
|
## Step 0: Sync Worktree First
|
|
14
12
|
|
|
15
|
-
Before
|
|
16
|
-
|
|
13
|
+
Before touching any file the graph or the plan names, sync the code worktree with main so no
|
|
14
|
+
edit lands on a path a merged rename or delete already removed:
|
|
17
15
|
|
|
18
16
|
```
|
|
19
17
|
git -C <worktree> fetch origin && git -C <worktree> merge --ff-only origin/main
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Read `../plastic-conventions/references/locks-and-worktrees.md` for delivery isolation: the
|
|
27
|
-
single-owner lock, claims, worktrees, solo mode, and the station ledger, before touching the
|
|
28
|
-
worktree above. This path resolves relative to this skill's own installed directory.
|
|
29
|
-
|
|
30
|
-
## Mode Selection
|
|
31
|
-
|
|
32
|
-
### Check for superpowers first
|
|
33
|
-
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.
|
|
20
|
+
If a named file or directory is missing (renamed or removed upstream), stop and report it
|
|
21
|
+
rather than editing a stale path. Read
|
|
22
|
+
`../plastic-conventions/references/locks-and-worktrees.md` for delivery isolation before
|
|
23
|
+
touching the worktree above.
|
|
34
24
|
|
|
35
|
-
|
|
36
|
-
- Tell the skill that the plan is at `~/.plastic/store/ID--slug/plan.md` (not `docs/superpowers/plans/`)
|
|
37
|
-
- Tell the skill that specs live at `~/.plastic/store/ID--slug/spec.md` (not `docs/superpowers/specs/`)
|
|
38
|
-
- All meta-artifacts must stay inside `~/.plastic/store/ID--slug/`
|
|
39
|
-
- Code files go in the project tree as normal
|
|
40
|
-
- Superpowers skills respect "user preferences for plan/spec location"; Plastic IS that preference
|
|
25
|
+
## step
|
|
41
26
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
The
|
|
27
|
+
`ruby scripts/runner step <intent_dir>` computes which nodes in `graph.md`/`nodes/*.md` are
|
|
28
|
+
ready, applies dispatch policy (model, call cap), and prints a spawn block per dispatched node
|
|
29
|
+
- agent, model, packet path, the one test command, the call cap - fenced in its own stdout.
|
|
30
|
+
The runner itself never spawns an agent (327 D42). Call `step` again after each dispatched
|
|
31
|
+
node returns.
|
|
46
32
|
|
|
47
33
|
### Graph dispatch: the paste
|
|
48
34
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### Inline (Fallback)
|
|
52
|
-
Executes tasks sequentially in the current session. Use when subagents aren't available or user explicitly requests inline mode.
|
|
53
|
-
|
|
54
|
-
To select: user says "inline", "execute inline", or "no subagents".
|
|
55
|
-
|
|
56
|
-
## Subagent-Driven Workflow
|
|
57
|
-
|
|
58
|
-
### Step 1: Load Plan
|
|
59
|
-
Run Step 0 (Sync Worktree First) before this step.
|
|
60
|
-
1. Read the active intent's `plan.md`
|
|
61
|
-
2. Extract ALL tasks with their full text, store in memory. Never make subagents read the plan file.
|
|
62
|
-
3. Create a task list to track progress
|
|
63
|
-
|
|
64
|
-
### Step 2: Execute Each Task
|
|
65
|
-
|
|
66
|
-
Dispatch ONE executor subagent and give it the whole delivery: every task's full text from `plan.md` (pasted in, never a file reference), every action file with its failure-mode matrix, the checklist items it must tick, the project context from CLAUDE.md, the active intent context from `{ID}--{slug}.md`, and the worktree path. In auto mode this is the `plastic-executor` agent; elsewhere use the `implementer-prompt.md` template. The executor writes the matrix's tests and commits them red, implements the consolidated action in order, ticks each item as it lands (see `## Tick-as-you-land`), and drives the test suite green.
|
|
67
|
-
|
|
68
|
-
After each commit lands (the red commit and every commit after it), append a `Commit` line to the savepoint ledger: `ruby ~/.plastic/scripts/savepoint-note <intent_dir> --kind Commit --text "<sha> <what it proves>"` (intent 317, D17). This is what feeds `report-screen delay`; a commit with no line is a gap the delay report cannot explain.
|
|
69
|
-
|
|
70
|
-
Print `ruby ~/.plastic/scripts/report-screen state <intent_dir> --changed "<what just landed>"` as the first characters of the reply, nothing before it, no fence, right after the red commit and again once the suite goes green (intent 331f).
|
|
71
|
-
|
|
72
|
-
Read its response by code:
|
|
73
|
-
- DONE or DONE_WITH_CONCERNS → proceed to Step 3.
|
|
74
|
-
- NEEDS_CONTEXT → provide the missing context, re-dispatch the executor.
|
|
75
|
-
- BLOCKED → stop, report to the user, wait for resolution.
|
|
76
|
-
|
|
77
|
-
### Step 3: Review by Risk
|
|
78
|
-
Apply the auto skill's risk rule to the executor's return and the diff: a matrix row no test could prove, a diff touching a hook, the lock, the worktree code, the installer, or a release file, a DONE_WITH_CONCERNS or a deviation from the matrix, or an owner-facing surface no test pins. When a rule fires, dispatch the post-execution reviewer with `code-quality-reviewer-prompt.md` (a separate agent with fresh context, never the maker); if it returns changes, re-dispatch the executor to fix them, then run the suite once more. When no rule fires, the green suite is the review.
|
|
79
|
-
|
|
80
|
-
Whenever a review verdict returns - the plan review before code, or the post-execution review above - the lead appends a `Review` line: `ruby ~/.plastic/scripts/savepoint-note <intent_dir> --kind Review --text "<verdict, what changed>"` (intent 317, D17). This is the other half of what `report-screen delay` reads.
|
|
35
|
+
The dispatch step is the paste, not a lead's hand-typed brief: copy each spawn block into the
|
|
36
|
+
Agent tool as its own dispatch, verbatim.
|
|
81
37
|
|
|
82
|
-
|
|
38
|
+
## status
|
|
83
39
|
|
|
84
|
-
|
|
85
|
-
|
|
40
|
+
`ruby scripts/runner status <intent_dir>` renders the graph's ledger state: which nodes are
|
|
41
|
+
running, done, blocked, or waiting on a decision. Safe to poll constantly; read node status
|
|
42
|
+
through `NodeLedger.status` before dispatching anything, never re-derive it by eye.
|
|
86
43
|
|
|
87
|
-
|
|
88
|
-
2. Hand the mechanical close to `plastic-intent-ending`. It owns `outcome.md`, the intent file's `## Outcome` stamp, the INDEX terminal move, the savepoint `Done` line, the store auto-commit, disarm, the QMD reindex, and the EM-to-CTO owner report, as ONE delegation. Author the outcome.md content when that skill asks for it; do not restate the mechanical steps here.
|
|
44
|
+
## answer
|
|
89
45
|
|
|
90
|
-
|
|
46
|
+
`ruby scripts/runner answer <intent_dir> --node <id> --decision "<text>"` closes a
|
|
47
|
+
`needs_decision` node with the owner's ruling, recorded to the ledger, so `step` can resume
|
|
48
|
+
the graph past it.
|
|
91
49
|
|
|
92
|
-
##
|
|
50
|
+
## Non-graph work
|
|
93
51
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
For each task:
|
|
102
|
-
1. Mark as in_progress
|
|
103
|
-
2. Follow each step exactly
|
|
104
|
-
3. Run verifications as specified
|
|
105
|
-
4. Tick as it lands: follow `## Tick-as-you-land` below
|
|
106
|
-
|
|
107
|
-
### Step 3: Update Intent and Complete
|
|
108
|
-
Capture observations in `## Insights`. When ALL checklist items are checked:
|
|
109
|
-
|
|
110
|
-
1. Update the intent's cluster entries in `INDEX.md` to show `_(completed)_`. Do this first, so the store auto-commit in the next step picks it up. `plastic-intent-ending` does not cover cluster maintenance (`store-indexing` and `store-curating` own it), so doing it here keeps the step from being lost.
|
|
111
|
-
2. Hand the mechanical close to `plastic-intent-ending`. It owns `outcome.md`, the intent file's `## Outcome` stamp, the INDEX terminal move, the savepoint `Done` line, the store auto-commit, disarm, the QMD reindex, and the EM-to-CTO owner report, as ONE delegation. Author the outcome.md content when that skill asks for it; do not restate the mechanical steps here.
|
|
112
|
-
|
|
113
|
-
**This is NOT optional.** Complete the intent immediately when work is done.
|
|
52
|
+
When the intent has no `graph.md`, dispatch ONE `plastic-executor` subagent with the whole
|
|
53
|
+
consolidated action pasted in (never a file reference): every task's full text, every action
|
|
54
|
+
file with its failure-mode matrix, the checklist items it must tick, the project context, and
|
|
55
|
+
the worktree path. It writes the matrix's tests and commits them red, implements the
|
|
56
|
+
consolidated action in order, ticks each item as it lands (see `## Tick-as-you-land`), and
|
|
57
|
+
drives the test suite green. Read its response by code: DONE or DONE_WITH_CONCERNS proceeds;
|
|
58
|
+
NEEDS_CONTEXT provides the missing context and re-dispatches; BLOCKED stops and reports.
|
|
114
59
|
|
|
115
60
|
## Tick-as-you-land
|
|
116
61
|
|
|
@@ -124,57 +69,13 @@ progress. Do not batch several tasks' worth of checklist updates into one
|
|
|
124
69
|
later edit; tick the moment the task is verified, before moving to the next
|
|
125
70
|
task.
|
|
126
71
|
|
|
127
|
-
## Verify before every owner review
|
|
128
|
-
|
|
129
|
-
Hard rule: before presenting any completed work to the owner, independently
|
|
130
|
-
verify it. Grep or run the artifact the work just produced (the test suite,
|
|
131
|
-
the changed file, the installed output) rather than restating the intended
|
|
132
|
-
change. Never present an unverified claim to the owner. If verification
|
|
133
|
-
fails, fix it before the review, not after.
|
|
134
|
-
|
|
135
|
-
## Methods report (audits and sweeps)
|
|
136
|
-
|
|
137
|
-
When the work is an audit or a sweep (checking many files or many instances of
|
|
138
|
-
something rather than building one artifact), deposit a methods report to
|
|
139
|
-
`{intent_dir}/resources/` before the review: what was checked, how it was
|
|
140
|
-
checked, and what was found. This lets the owner review the method, not just
|
|
141
|
-
the conclusion.
|
|
142
|
-
|
|
143
|
-
## Reroute vs dispatch
|
|
144
|
-
|
|
145
|
-
A human-facing instruction like "run /plastic-intent-speccing" means the user
|
|
146
|
-
types that slash command themselves; it is never handed to a
|
|
147
|
-
subagent. Agent-facing dispatch text is a prompt passed to the Agent tool for
|
|
148
|
-
a subagent to execute. Keep the two separate: do not address a slash command
|
|
149
|
-
to a subagent, and do not paste a dispatch prompt at the user.
|
|
150
|
-
|
|
151
|
-
## Owner decisions during Exec
|
|
152
|
-
|
|
153
|
-
When presenting a batch of Exec decisions for the owner to rule, read
|
|
154
|
-
`~/.plastic/_decision-tables.md` and follow the numbered-table procedure,
|
|
155
|
-
persisting each ruling with `--stage Exec`.
|
|
156
|
-
|
|
157
72
|
## Position in the cycle
|
|
158
73
|
|
|
159
|
-
- **Before:** `
|
|
160
|
-
|
|
161
|
-
- **
|
|
74
|
+
- **Before:** the graph (`graph.md`, `nodes/*.md`), or `plan.md`/`checklist.md`, exists; the
|
|
75
|
+
worktree is armed.
|
|
76
|
+
- **Produces:** code changes and a ticked checklist.
|
|
77
|
+
- **Next:** `plastic-intent-ending` owns `outcome.md`, generated through
|
|
78
|
+
`scripts/outcome-report`, and the rest of the mechanical close.
|
|
162
79
|
|
|
163
80
|
Read `../plastic-conventions/references/lifecycle-and-savepoints.md` for the subagent
|
|
164
81
|
report-home contract this handoff relies on.
|
|
165
|
-
|
|
166
|
-
## Model Selection for Subagents
|
|
167
|
-
|
|
168
|
-
Match model to task complexity:
|
|
169
|
-
- **Mechanical tasks** (config files, boilerplate): cheapest available
|
|
170
|
-
- **Standard implementation**: default model
|
|
171
|
-
- **Architecture, integration, review**: most capable model
|
|
172
|
-
|
|
173
|
-
## Prompt Templates
|
|
174
|
-
|
|
175
|
-
Subagent prompts are in this skill's directory:
|
|
176
|
-
- `implementer-prompt.md`: template for implementer subagents
|
|
177
|
-
- `spec-reviewer-prompt.md`: template for spec compliance reviewers
|
|
178
|
-
- `code-quality-reviewer-prompt.md`: template for code quality reviewers
|
|
179
|
-
|
|
180
|
-
Read the appropriate template when dispatching each subagent type.
|
|
@@ -14,6 +14,9 @@ user-invocable: true
|
|
|
14
14
|
|
|
15
15
|
# Intent Speccing: thinking mode
|
|
16
16
|
|
|
17
|
+
Speccing is optional: a ruled or small-enough intent skips straight to How/Exec, and this
|
|
18
|
+
skill runs only when the request genuinely needs a design conversation first.
|
|
19
|
+
|
|
17
20
|
One skill for the whole thinking conversation on an intent. It asks one question at a time,
|
|
18
21
|
records every owner ruling the moment it lands, grills when asked, deposits research in
|
|
19
22
|
`resources/`, and ends by writing the action files the work runs from and consolidating the
|