@zalom/plastic 1.0.0-beta.2 → 1.0.0-beta.21
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 +131 -7
- package/agents/plastic-brainstorming.md +9 -1
- package/agents/plastic-enforcer.md +1 -1
- package/agents/plastic-executor.md +11 -1
- package/agents/plastic-intent-curator.md +7 -5
- package/agents/plastic-planner.md +11 -1
- package/agents/plastic-spec-specialist.md +9 -1
- package/hooks/hooks.json +20 -0
- package/hooks/retrieval-gate +10 -0
- package/hooks/savepoint-pre +10 -0
- package/hooks/statusline +150 -41
- package/package.json +1 -1
- package/scripts/agent-report +163 -0
- package/scripts/doctor.rb +172 -0
- package/scripts/hook-auto-arm +1 -1
- package/scripts/hook-bash-gate +2 -2
- package/scripts/hook-code-gate +11 -6
- package/scripts/hook-create-gate +2 -2
- package/scripts/hook-gate-check +14 -23
- package/scripts/hook-retrieval-gate +136 -0
- package/scripts/hook-savepoint-pre +32 -0
- package/scripts/hook-session-start +1 -1
- package/scripts/insight-append +51 -0
- package/scripts/lib/bridge.rb +374 -34
- package/scripts/lib/frontmatter_writer.rb +130 -0
- package/scripts/lib/graph_rebuild.rb +328 -0
- package/scripts/lib/insights.rb +86 -0
- package/scripts/lib/installer_core.rb +23 -0
- package/scripts/lib/link_suggestions.rb +322 -0
- package/scripts/lib/links_projection.rb +160 -0
- package/scripts/lib/links_section.rb +207 -0
- package/scripts/lib/power_tools.rb +76 -0
- package/scripts/lib/qmd_hook.rb +38 -25
- package/scripts/lib/qmd_sync.rb +36 -0
- package/scripts/lib/retrieval_gate.rb +211 -0
- package/scripts/lib/worktree.rb +409 -0
- package/scripts/link-suggest +211 -0
- package/scripts/new-intent +138 -29
- package/scripts/project-links +287 -0
- package/scripts/qmd-sync +50 -3
- package/scripts/rebuild-graph +244 -0
- package/scripts/spawn-preamble +26 -1
- package/skills/auto/SKILL.md +58 -11
- package/skills/auto/evals/evals.json +48 -0
- package/skills/auto/references/agent-architecture.md +27 -4
- package/skills/auto/references/agent-report-contract.md +121 -0
- package/skills/brainstorming/SKILL.md +1 -0
- package/skills/brainstorming/evals/evals.json +22 -0
- package/skills/continuing/SKILL.md +30 -8
- package/skills/continuing/evals/evals.json +9 -0
- package/skills/creating-intent/SKILL.md +16 -2
- package/skills/creating-intent/evals/evals.json +16 -0
- package/skills/creating-intent/references/lifecycle.md +9 -4
- package/skills/creating-skills/SKILL.md +65 -0
- package/skills/creating-skills/evals/evals.json +108 -0
- package/skills/creating-skills/references/agents.md +168 -0
- package/skills/creating-skills/references/evals.md +41 -0
- package/skills/creating-skills/references/hooks.md +248 -0
- package/skills/creating-skills/references/progressive-disclosure.md +176 -0
- package/skills/creating-skills/references/scripts.md +166 -0
- package/skills/creating-skills/references/skills.md +165 -0
- package/skills/creating-skills/scripts/scaffold.rb +313 -0
- package/skills/dashboard/SKILL.md +5 -0
- package/skills/dashboard/evals/evals.json +22 -0
- package/skills/executing-plan/SKILL.md +2 -2
- package/skills/humanizer/SKILL.md +39 -0
- package/skills/humanizer/evals/evals.json +70 -0
- package/skills/humanizer/references/always-on-snippet.md +9 -0
- package/skills/humanizer/references/examples.md +48 -0
- package/skills/intent-curator/SKILL.md +6 -1
- package/skills/intent-curator/evals/evals.json +22 -0
- package/skills/linking-intents/SKILL.md +54 -12
- package/skills/linking-intents/evals/evals.json +22 -0
- package/skills/linking-intents/references/zettelkasten.md +7 -0
- package/skills/managing-index/SKILL.md +8 -0
- package/skills/managing-index/evals/evals.json +22 -0
- package/skills/managing-index/references/zettelkasten-linking.md +6 -1
- package/skills/releasing/SKILL.md +32 -0
- package/skills/research/SKILL.md +8 -0
- package/skills/research/evals/evals.json +22 -0
- package/skills/writing-instructions/SKILL.md +0 -159
- package/skills/writing-instructions/references/agentskills-spec.md +0 -135
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Examples - before and after
|
|
2
|
+
|
|
3
|
+
Each pair shows a tell or a slop pattern, then the fix.
|
|
4
|
+
|
|
5
|
+
## 1. Em-dash
|
|
6
|
+
Before: The release is ready - we just need sign-off.
|
|
7
|
+
After: The release is ready. We just need sign-off.
|
|
8
|
+
Why: Use a full stop or comma, not an em-dash.
|
|
9
|
+
|
|
10
|
+
## 2. "Not X but Y"
|
|
11
|
+
Before: This is not just a config change, it's a rethink of the flow.
|
|
12
|
+
After: This change reworks the flow.
|
|
13
|
+
Why: State the point directly.
|
|
14
|
+
|
|
15
|
+
## 3. Rule of three
|
|
16
|
+
Before: The tool is fast, robust, and powerful.
|
|
17
|
+
After: The tool is fast.
|
|
18
|
+
Why: Drop the list-for-rhythm; keep the claim you can back.
|
|
19
|
+
|
|
20
|
+
## 4. Hype / AI word
|
|
21
|
+
Before: We leverage a comprehensive caching layer to unlock performance.
|
|
22
|
+
After: We cache results to make it faster.
|
|
23
|
+
Why: Plain verbs and nouns.
|
|
24
|
+
|
|
25
|
+
## 5. Filler opener / signposting
|
|
26
|
+
Before: It's worth noting that the cache expires after five minutes.
|
|
27
|
+
After: The cache expires after five minutes.
|
|
28
|
+
Why: Say the thing; skip the runway.
|
|
29
|
+
|
|
30
|
+
## 6. Hedging pile-up
|
|
31
|
+
Before: This might possibly help reduce cost in some cases, generally.
|
|
32
|
+
After: This reduces cost.
|
|
33
|
+
Why: One clear claim. Add a caveat only if it is real.
|
|
34
|
+
|
|
35
|
+
## 7. Sycophancy
|
|
36
|
+
Before: Great question! That's a really insightful point. Here's the answer.
|
|
37
|
+
After: Here's the answer.
|
|
38
|
+
Why: Drop the praise; answer.
|
|
39
|
+
|
|
40
|
+
## 8. Structural fix (the mush)
|
|
41
|
+
Before: There are several important considerations to keep in mind when thinking about how best to approach the broad and multifaceted topic of caching, each of which carries its own trade-offs.
|
|
42
|
+
After: Cache reads, not writes. Reads repeat; writes do not.
|
|
43
|
+
Why: One load-bearing point. Cut the restatement and the abstract throat-clearing.
|
|
44
|
+
|
|
45
|
+
## 9. Over-bolding
|
|
46
|
+
Before: **Note:** the cache **expires** after **five minutes**, so **always** check it.
|
|
47
|
+
After: The cache expires after five minutes, so check it first.
|
|
48
|
+
Why: Bold nothing here; the sentence carries itself.
|
|
@@ -33,9 +33,14 @@ Invoke the `plastic-intent-curator` agent via the Agent tool with `subagent_type
|
|
|
33
33
|
|
|
34
34
|
The agent handles:
|
|
35
35
|
- Intent lifecycle management (status transitions, Outcome sections)
|
|
36
|
-
- INDEX.md maintenance (Active/Future/Clusters/Completed sections)
|
|
36
|
+
- INDEX.md maintenance (Active/Future/Clusters/Completed/Abandoned sections)
|
|
37
37
|
- Link discovery between related intents
|
|
38
38
|
- Cluster management (create, merge, rename)
|
|
39
39
|
- Orphan detection
|
|
40
40
|
|
|
41
|
+
When an intent reaches a terminal state — moved to Completed OR Abandoned — do two things as the closing act of the transfer:
|
|
42
|
+
|
|
43
|
+
1. Stamp the terminal savepoint bookend (intent 81), so the ledger's last line records the disposition: `ruby -r ~/.plastic/scripts/lib/bridge -e 'Bridge.append_terminal_savepoint("<intent_dir>", "delivered")'` (use `"abandoned"` for an abandoned intent). Idempotent.
|
|
44
|
+
2. Refresh the QMD index for the affected store (no-op when QMD absent), running in the background so it never blocks: `ruby ~/.plastic/scripts/qmd-sync reindex --store <store-root> --async`.
|
|
45
|
+
|
|
41
46
|
After the agent completes, report what changed.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "plastic-intent-curator",
|
|
3
|
+
"notes": "Intent 66a. Spec for the QMD-first discovery step in agents/plastic-intent-curator.md (locate a specific intent before grep/find; distinct from the completion-time reindex step). Runner is intent 76; spec only.",
|
|
4
|
+
"evals": [
|
|
5
|
+
{
|
|
6
|
+
"id": 1,
|
|
7
|
+
"scope": "behavior",
|
|
8
|
+
"set": "validation",
|
|
9
|
+
"prompt": "QMD is present. The user says: find and reclassify the intent about orphan detection.",
|
|
10
|
+
"expected_output": "During discovery (How You Work), before scanning the store with grep/find to locate the intent, runs `ruby ~/.plastic/scripts/qmd-sync search \"orphan detection\"` to surface the candidate or related intents, then opens the authoritative intent file for the hit it acts on. This discovery step is distinct from the completion-time reindex step. No-op fallback to the full scan when QMD is absent.",
|
|
11
|
+
"files": [],
|
|
12
|
+
"assertions": [
|
|
13
|
+
{
|
|
14
|
+
"type": "human",
|
|
15
|
+
"check": "qmd-sync search is run before grep/find during discovery; authoritative file opened for the hit; reindex step stays separate",
|
|
16
|
+
"observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
|
|
17
|
+
"result": "pass"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -6,34 +6,70 @@ description: Use when creating connections between intents, the user says "link"
|
|
|
6
6
|
# Linking Intents
|
|
7
7
|
|
|
8
8
|
## When to Use
|
|
9
|
-
- During intent creation (automatic
|
|
9
|
+
- During intent creation (automatic: ask about related intents)
|
|
10
10
|
- User says "link", "connect", "relates to"
|
|
11
11
|
- Agent discovers a relationship between intents during work
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Discovery and ranking are separate
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
Explicit wikilinks in the `## Links` section. Bidirectional — add to both intents.
|
|
15
|
+
Two distinct steps, do not conflate them:
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
1. **Discovery** (finding candidate related intents) may use any tool: grep, find, ripgrep,
|
|
18
|
+
or QMD/Serena when present (QMD-first per the project rule). Discovery casts a wide net.
|
|
19
|
+
2. **Ranking** the candidates is a CONTEXT-INFLUENCE judgement: read each candidate's `## Intent`
|
|
20
|
+
and `## Context` and ask whether that context actually informed this intent. Ranking is NOT a
|
|
21
|
+
structural metric (no shared-file or shared-symbol grading: on intent 90, matching whole files
|
|
22
|
+
flagged 35 intents because ~20 touch `bridge.rb`). It is NOT a similarity score either (QMD
|
|
23
|
+
relevance measures topic proximity, not influence). A script cannot make this call; an agent
|
|
24
|
+
does.
|
|
25
|
+
|
|
26
|
+
## The three tiers (by context influence)
|
|
27
|
+
|
|
28
|
+
- **sources:** the foundational context that shaped this intent's CREATION (a split, an idea born
|
|
29
|
+
during development, a merge). Earns an edge. Decided by origin, never inferred.
|
|
30
|
+
- **chain:** the context that materially helps DELIVER this intent. HIGH bar: only the genuinely
|
|
31
|
+
delivery-moving intents, not everything in the same area. Earns an edge, reflected in `## Links`.
|
|
32
|
+
Worked example (intent 90): 79 created it so 79 is a source; 80 deferred the exact fix 90 makes,
|
|
33
|
+
so its context directly helps delivery and 80 is chain; 49/66/73 are same-area background, so
|
|
34
|
+
they get a shared tag and no link.
|
|
35
|
+
- **tags:** loose theme grouping for search. NOT a link.
|
|
36
|
+
|
|
37
|
+
**Timing.** The influence judgement happens at What/Why (and during upkeep), guided by this rule.
|
|
38
|
+
It does not wait for code to exist; it is reasoning over the candidate's context, not over a diff.
|
|
39
|
+
|
|
40
|
+
**Record the call.** For every edge an agent adds, store a rating (high / medium / low) plus a
|
|
41
|
+
one-line reason in `link-decisions.md` in the intent dir. Keep it out of frontmatter (graph only)
|
|
42
|
+
and out of the `## Links` label (which is projected), so the audit trail never breaks the
|
|
43
|
+
projection identity.
|
|
44
|
+
|
|
45
|
+
## `## Links` is derived (never author it by hand)
|
|
22
46
|
|
|
23
|
-
|
|
47
|
+
`## Links` is a DERIVED view of `sources` then `chain`, not a place to write links. Never
|
|
48
|
+
hand-write a `## Links` line, and never auto-delete one. To add a link, add the frontmatter
|
|
49
|
+
edge (below), then let the projection regenerate the section (`scripts/project-links`).
|
|
50
|
+
|
|
51
|
+
Run `scripts/link-suggest <id>` to gather candidate intents WITH each one's Intent and Context (the
|
|
52
|
+
evidence you judge influence on) and to flag drift (a `## Links` line with no frontmatter edge
|
|
53
|
+
behind it). To record a confirmed edge plus its rating and reason, run it with
|
|
54
|
+
`--record <id> --edge <sources|chain> --rating <high|medium|low> --reason "..." --confirm`. It never
|
|
55
|
+
grades influence itself, never writes an edge without `--confirm`, and never deletes.
|
|
56
|
+
|
|
57
|
+
## Connection Types (the frontmatter edges)
|
|
58
|
+
|
|
59
|
+
### 1. Sources (Backward)
|
|
24
60
|
The `sources` array in frontmatter. The direct ascendant(s) this intent was created from / emerged from the lifecycle of (formation, not topic similarity), backward links to the work it was built out of:
|
|
25
61
|
```yaml
|
|
26
62
|
sources: ["1a", "1a2"]
|
|
27
63
|
```
|
|
28
64
|
|
|
29
|
-
###
|
|
65
|
+
### 2. Chain (Forward)
|
|
30
66
|
The `chain` array in frontmatter. What this intent spawned AND related-but-not-spawned successors it leads to, forward links to children, follow-on, and related work:
|
|
31
67
|
```yaml
|
|
32
68
|
chain: ["1b1", "1b2"]
|
|
33
69
|
```
|
|
34
70
|
|
|
35
|
-
###
|
|
36
|
-
Shared tags in frontmatter enable filtered discovery. Use `project-<name>` tags for project membership.
|
|
71
|
+
### 3. Tags (for discovery, not links)
|
|
72
|
+
Shared tags in frontmatter enable filtered discovery. Use `project-<name>` tags for project membership. A shared tag is a loose theme grouping: it earns NO edge.
|
|
37
73
|
```yaml
|
|
38
74
|
tags: [plastic, project-reddit-kb]
|
|
39
75
|
```
|
|
@@ -41,6 +77,12 @@ tags: [plastic, project-reddit-kb]
|
|
|
41
77
|
## Workflow
|
|
42
78
|
|
|
43
79
|
### 1. Identify Intents to Connect
|
|
80
|
+
|
|
81
|
+
QMD-first (when available): before scanning the store with grep/Read, run
|
|
82
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or related
|
|
83
|
+
intents to propose as sources/chain, then open the authoritative intent file for any hit you act
|
|
84
|
+
on. The command is a no-op when QMD is absent, so fall back to the directory scan below.
|
|
85
|
+
|
|
44
86
|
Show existing intents by scanning the store's directory for intent files:
|
|
45
87
|
```bash
|
|
46
88
|
for dir in $STORE_ROOT/store/*/; do
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "plastic-linking-intents",
|
|
3
|
+
"notes": "Intent 66a. Spec for the QMD-first discovery step (surface candidate/related intents to propose as sources/chain before grep/Read). Runner is intent 76; this case is a spec, not executed.",
|
|
4
|
+
"evals": [
|
|
5
|
+
{
|
|
6
|
+
"id": 1,
|
|
7
|
+
"scope": "behavior",
|
|
8
|
+
"set": "validation",
|
|
9
|
+
"prompt": "QMD is present. The user says: link this intent to the related upload-pipeline work.",
|
|
10
|
+
"expected_output": "Before scanning the store directory with grep/Read to identify related intents, runs `ruby ~/.plastic/scripts/qmd-sync search \"upload pipeline\"` to surface candidate or related intents to propose as sources/chain, then opens the authoritative intent file for any hit it links. No-op fallback to the directory scan when QMD is absent.",
|
|
11
|
+
"files": [],
|
|
12
|
+
"assertions": [
|
|
13
|
+
{
|
|
14
|
+
"type": "human",
|
|
15
|
+
"check": "qmd-sync search is run before the directory scan; authoritative file opened for any hit before proposing sources/chain",
|
|
16
|
+
"observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
|
|
17
|
+
"result": "pass"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -10,6 +10,13 @@ Plastic implements three Zettelkasten structures:
|
|
|
10
10
|
|
|
11
11
|
INDEX.md is a structure note (hub), not a table of contents.
|
|
12
12
|
|
|
13
|
+
`## Links` mirrors the frontmatter graph exactly. Each entry is
|
|
14
|
+
`- [[id--slug|<target's full intent: text>]]` (cross-store: `- [[store:id--slug|...]]`),
|
|
15
|
+
a clickable `id--slug` target with the target's full `intent:` text as the label.
|
|
16
|
+
Ordering is mandatory: all `sources` first (top), then all `chain`, frontmatter order
|
|
17
|
+
preserved within each group. Sources never appear at the end. No source/chain tags, no
|
|
18
|
+
sub-grouping. An intent with empty `sources` and `chain` carries the empty-state comment.
|
|
19
|
+
|
|
13
20
|
## Folgezettel IDs
|
|
14
21
|
|
|
15
22
|
IDs encode lineage using Luhmann's alternating convention:
|
|
@@ -41,8 +41,16 @@ Topic-based groupings. Manually curated. Create a new cluster when 3+ intents sh
|
|
|
41
41
|
### Completed
|
|
42
42
|
All completed intents with dates. Links preserved, never deleted.
|
|
43
43
|
|
|
44
|
+
When you move an intent INTO Completed or Abandoned, stamp the terminal savepoint bookend as the closing act of the transfer (intent 81), so the ledger's last line records the disposition: `ruby -r ~/.plastic/scripts/lib/bridge -e 'Bridge.append_terminal_savepoint("<intent_dir>", "delivered")'` (use `"abandoned"` for an abandoned intent). Idempotent.
|
|
45
|
+
|
|
44
46
|
## Workflow
|
|
45
47
|
|
|
48
|
+
QMD-first (when available): when you need to locate a specific intent (to reclassify, flag, or
|
|
49
|
+
cluster it) rather than rebuild every section, before scanning the store with grep/Read run
|
|
50
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate or related intents, then
|
|
51
|
+
open the authoritative intent file for any hit you act on. The command is a no-op when QMD is
|
|
52
|
+
absent, so fall back to the directory scan below.
|
|
53
|
+
|
|
46
54
|
### Rebuild Sections
|
|
47
55
|
Scan the active store's `store/` directory for intent files and rebuild each section:
|
|
48
56
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "plastic-managing-index",
|
|
3
|
+
"notes": "Intent 66a. Spec for the QMD-first step when locating a specific intent to reclassify/flag/cluster before grep/Read. Runner is intent 76; spec only.",
|
|
4
|
+
"evals": [
|
|
5
|
+
{
|
|
6
|
+
"id": 1,
|
|
7
|
+
"scope": "behavior",
|
|
8
|
+
"set": "validation",
|
|
9
|
+
"prompt": "QMD is present. The user says: move the intent about the statusline into the Completed section.",
|
|
10
|
+
"expected_output": "When locating one specific intent rather than rebuilding every section, before scanning the store with grep/Read runs `ruby ~/.plastic/scripts/qmd-sync search \"statusline\"` to surface the candidate intent, then opens the authoritative intent file for the hit it reclassifies. No-op fallback to the directory scan when QMD is absent.",
|
|
11
|
+
"files": [],
|
|
12
|
+
"assertions": [
|
|
13
|
+
{
|
|
14
|
+
"type": "human",
|
|
15
|
+
"check": "qmd-sync search is run before the directory scan when locating a specific intent; authoritative file opened for the hit",
|
|
16
|
+
"observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
|
|
17
|
+
"result": "pass"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
|
|
9
9
|
## Three Connection Types (Ranked)
|
|
10
10
|
|
|
11
|
-
1. **Direct links** (strongest)
|
|
11
|
+
1. **Direct links** (strongest): wikilinks in the `## Links` section, the projection of the
|
|
12
|
+
frontmatter graph. Each entry is `- [[id--slug|<target's full intent: text>]]` (cross-store:
|
|
13
|
+
`- [[store:id--slug|...]]`), a clickable `id--slug` target labeled with the target's full
|
|
14
|
+
`intent:` text. Ordering is mandatory: all `sources` first (top), then all `chain`,
|
|
15
|
+
frontmatter order preserved within each group. Sources never appear at the end. No
|
|
16
|
+
source/chain tags, no sub-grouping.
|
|
12
17
|
2. **Sources/Chain** (knowledge graph): `sources` = direct ascendants this was created from (formation, acyclic, must-load); `chain` = forward continuations and related successors (may cycle, lighter context). See `docs/concepts/how-plastic-sources-and-chains-intents.md` for the full model.
|
|
13
18
|
3. **Tags** (weakest) — shared tags, `project-<name>` for project membership
|
|
14
19
|
|
|
@@ -20,6 +20,7 @@ Project configuration drives the workflow - no hardcoded assumptions.
|
|
|
20
20
|
- [ ] Run post-push actions (GitHub release, npm publish, etc.)
|
|
21
21
|
- [ ] Verify release sync (npm dist-tag, GitHub "Latest", git tag all show the new version)
|
|
22
22
|
- [ ] Complete active intent
|
|
23
|
+
- [ ] Clean up the intent's worktrees (merge-then-remove)
|
|
23
24
|
|
|
24
25
|
## Workflow
|
|
25
26
|
|
|
@@ -84,6 +85,15 @@ git merge <branch-name> --no-ff -m "feat: merge intent [ID] - [description]"
|
|
|
84
85
|
|
|
85
86
|
Always `--no-ff` to preserve branch history in the merge commit.
|
|
86
87
|
|
|
88
|
+
**Worktree-isolated intents (intent 73c3).** When the intent was delivered in a Plastic
|
|
89
|
+
worktree (the bridge has a provisioned `worktree` block), its code lives on the branch
|
|
90
|
+
`plastic/{id}--{slug}` inside `<repo>/.claude/worktrees/{id}--{slug}`, not on a hand-made
|
|
91
|
+
feature branch. The merge-then-remove of that worktree is handled together with cleanup in
|
|
92
|
+
step 9, which merges `plastic/{id}--{slug}` into the default branch BEFORE removing the
|
|
93
|
+
worktree. If you already merged here by hand, step 9 is a clean no-op merge ("Already up to
|
|
94
|
+
date") and proceeds straight to removal. Do not delete the worktree before its branch is
|
|
95
|
+
merged, or the work is lost.
|
|
96
|
+
|
|
87
97
|
### 4. Bump Version
|
|
88
98
|
|
|
89
99
|
Determine which files to update from project.yml:
|
|
@@ -207,6 +217,28 @@ A release IS a delivery. The active intent that drove this work must be complete
|
|
|
207
217
|
|
|
208
218
|
**If no active intent exists for this release**, that itself is a problem - work happened outside the intent system. Log it and move on, but flag it.
|
|
209
219
|
|
|
220
|
+
### 9. Clean Up the Intent's Worktrees (merge-then-remove)
|
|
221
|
+
|
|
222
|
+
A release is the merge-then-remove path for the intent's worktrees (intent 73c3). This is the
|
|
223
|
+
one place the merge-vs-remove policy lands on "merge": the intent's code branch
|
|
224
|
+
(`plastic/{id}--{slug}`) is merged back into the repo's default branch BEFORE the worktree is
|
|
225
|
+
removed, so the integrated work is never lost. (The disarm path in `plastic-auto`, by contrast,
|
|
226
|
+
is a plain remove because no release is merging the branch.)
|
|
227
|
+
|
|
228
|
+
Drive it through `Worktree.finish` with `merge: true`, which merges the code branch, then
|
|
229
|
+
removes both worktrees (code + paired store), prunes both repos, and clears the worktree block
|
|
230
|
+
from the bridge:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
ruby -r ~/.plastic/scripts/lib/worktree -r ~/.plastic/scripts/lib/bridge -e \
|
|
234
|
+
'b = Bridge.read(ENV["CLAUDE_CODE_SESSION_ID"]); Worktree.finish(b, merge: true) if b'
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
`finish` is fail-open and idempotent: a conflicting merge is aborted and logged (the worktree
|
|
238
|
+
is still removed rather than stranded), and a second call with the block already cleared is a
|
|
239
|
+
no-op. Honor the worktree-cleanup rule: never leave an orphaned worktree, and run `git worktree
|
|
240
|
+
prune` in the affected repo if you hit a stale reference.
|
|
241
|
+
|
|
210
242
|
## Conventions
|
|
211
243
|
|
|
212
244
|
- **Annotated tags only** - `git tag -a`, never lightweight tags
|
package/skills/research/SKILL.md
CHANGED
|
@@ -17,6 +17,14 @@ Before proceeding, resolve the active intent:
|
|
|
17
17
|
2. **Find active intent:** Read `INDEX.md` from the detected store. Look under `## Active`. If exactly one → use it. If multiple → ask which. If none → refuse: "No active intent. Create one first with /plastic-creating-intent"
|
|
18
18
|
3. **Resolve intent directory:** `{store}/store/{id}--{slug}/`
|
|
19
19
|
|
|
20
|
+
## Check Prior Work First
|
|
21
|
+
|
|
22
|
+
QMD-first (when available): before scanning the store with grep/Read or searching the web, run
|
|
23
|
+
`ruby ~/.plastic/scripts/qmd-sync search "<terms>"` to surface candidate, prior, or related intents
|
|
24
|
+
and existing research, then open the authoritative intent file for any hit you act on. Reusing a
|
|
25
|
+
prior report beats re-deriving it. The command is a no-op when QMD is absent, so fall back to the
|
|
26
|
+
existing INDEX.md / file scan.
|
|
27
|
+
|
|
20
28
|
## Depth Decision
|
|
21
29
|
|
|
22
30
|
Before starting research, assess the question against these criteria:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "plastic-research",
|
|
3
|
+
"notes": "Intent 66a. Spec for the QMD-first step before researching (reuse prior intents/reports before grep/Read or web search). Runner is intent 76; spec only.",
|
|
4
|
+
"evals": [
|
|
5
|
+
{
|
|
6
|
+
"id": 1,
|
|
7
|
+
"scope": "behavior",
|
|
8
|
+
"set": "validation",
|
|
9
|
+
"prompt": "QMD is present. The user asks the agent to research installer patterns for the active intent.",
|
|
10
|
+
"expected_output": "Before scanning the store with grep/Read or searching the web, runs `ruby ~/.plastic/scripts/qmd-sync search \"installer patterns\"` to surface candidate, prior, or related intents and existing research, then opens the authoritative intent file for any hit it reuses. No-op fallback to INDEX.md / file scan when QMD is absent.",
|
|
11
|
+
"files": [],
|
|
12
|
+
"assertions": [
|
|
13
|
+
{
|
|
14
|
+
"type": "human",
|
|
15
|
+
"check": "qmd-sync search is run before grep/Read and web search; authoritative file opened for any prior report reused",
|
|
16
|
+
"observed": "SKILL.md (or agent file) carries the QMD-first step: run qmd-sync search before grep/Read, then open the authoritative file; no-op fallback when QMD is absent",
|
|
17
|
+
"result": "pass"
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plastic-writing-instructions
|
|
3
|
-
description: >
|
|
4
|
-
Write or restructure agent instructions, conventions files, and SKILL.md
|
|
5
|
-
content using progressive disclosure and the agentskills.io specification.
|
|
6
|
-
Use when creating PLASTIC.md, rewriting convention docs, authoring new
|
|
7
|
-
skills, restructuring large instruction files to fit context budgets,
|
|
8
|
-
or when instructions feel too long, too vague, or agents aren't following
|
|
9
|
-
them. Also use when the user says "progressive disclosure", "restructure
|
|
10
|
-
instructions", or "the instructions are too big".
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# Writing Agent Instructions
|
|
14
|
-
|
|
15
|
-
Based on the [agentskills.io specification](https://agentskills.io).
|
|
16
|
-
|
|
17
|
-
## Progressive Disclosure Architecture
|
|
18
|
-
|
|
19
|
-
All agent instructions follow three loading stages. Design for this — it's the
|
|
20
|
-
architecture, not a nice-to-have.
|
|
21
|
-
|
|
22
|
-
| Stage | What loads | Budget | Design for |
|
|
23
|
-
|-------|-----------|--------|------------|
|
|
24
|
-
| **Discovery** | name + description | ~100 tokens | Trigger accuracy |
|
|
25
|
-
| **Activation** | Full instruction body | <5000 tokens / <500 lines | Core procedures |
|
|
26
|
-
| **Execution** | references/, scripts/, assets/ | As needed | Deep detail |
|
|
27
|
-
|
|
28
|
-
**The description carries the entire burden of triggering.** If agents aren't
|
|
29
|
-
activating your skill, the description is the problem.
|
|
30
|
-
|
|
31
|
-
## Procedure
|
|
32
|
-
|
|
33
|
-
### Step 1: Audit the content
|
|
34
|
-
|
|
35
|
-
Before writing or restructuring, classify every piece of content:
|
|
36
|
-
|
|
37
|
-
| Classification | Where it goes | Example |
|
|
38
|
-
|---------------|---------------|---------|
|
|
39
|
-
| **Trigger context** | description field | "Use when...", keywords |
|
|
40
|
-
| **Core procedure** | SKILL.md body | Step-by-step workflows |
|
|
41
|
-
| **Gotchas** | SKILL.md body (early) | Facts that defy assumptions |
|
|
42
|
-
| **Deep reference** | references/ | API details, full schemas |
|
|
43
|
-
| **Templates** | assets/ or inline | Output format examples |
|
|
44
|
-
| **Executable logic** | scripts/ | Validation, data processing |
|
|
45
|
-
|
|
46
|
-
Ask for each piece: "Would the agent get this wrong without this?"
|
|
47
|
-
If no — cut it. If unsure — test it.
|
|
48
|
-
|
|
49
|
-
### Step 2: Write the description
|
|
50
|
-
|
|
51
|
-
The description must convey WHEN to use, not just WHAT it does.
|
|
52
|
-
|
|
53
|
-
**Rules:**
|
|
54
|
-
- Imperative phrasing: "Use this skill when..." not "This skill does..."
|
|
55
|
-
- Focus on user intent, not implementation
|
|
56
|
-
- Err on the side of being pushy — list contexts explicitly
|
|
57
|
-
- Include cases where user doesn't name the domain directly
|
|
58
|
-
- Under 1024 characters (hard limit)
|
|
59
|
-
- Include specific trigger keywords
|
|
60
|
-
|
|
61
|
-
**Template:**
|
|
62
|
-
```yaml
|
|
63
|
-
description: >
|
|
64
|
-
[One sentence: what it does]. Use when [primary trigger context],
|
|
65
|
-
[secondary trigger], or when [indirect trigger where user doesn't
|
|
66
|
-
name the domain]. Also use when [edge case trigger].
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Step 3: Write the body
|
|
70
|
-
|
|
71
|
-
**Principles (in priority order):**
|
|
72
|
-
|
|
73
|
-
1. **Procedures over declarations** — Teach HOW to approach a class of problems,
|
|
74
|
-
not WHAT to produce for a specific instance
|
|
75
|
-
2. **Defaults, not menus** — Pick one approach, mention alternatives briefly.
|
|
76
|
-
"Use X. For Y cases, use Z instead." Never present options as equals.
|
|
77
|
-
3. **Calibrate control to fragility** — Prescriptive for fragile/sequential tasks,
|
|
78
|
-
flexible when multiple approaches are valid. Most skills have a mix.
|
|
79
|
-
4. **Reasoning over rigid directives** — "Do X because Y tends to cause Z" beats
|
|
80
|
-
"ALWAYS do X, NEVER do Y"
|
|
81
|
-
5. **Add what the agent lacks, omit what it knows** — No explaining HTTP, PDFs,
|
|
82
|
-
or what a migration is. Jump to what's non-obvious.
|
|
83
|
-
|
|
84
|
-
**Structure:**
|
|
85
|
-
```markdown
|
|
86
|
-
# Title
|
|
87
|
-
|
|
88
|
-
[1-2 sentence purpose statement]
|
|
89
|
-
|
|
90
|
-
## Gotchas
|
|
91
|
-
- [Highest-value content first — facts that defy assumptions]
|
|
92
|
-
- [Each gotcha is a concrete correction, not general advice]
|
|
93
|
-
|
|
94
|
-
## Procedure
|
|
95
|
-
### Step 1: ...
|
|
96
|
-
### Step 2: ...
|
|
97
|
-
|
|
98
|
-
## Patterns
|
|
99
|
-
[Only if the skill covers multiple approaches to similar problems]
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Step 4: Extract to references/
|
|
103
|
-
|
|
104
|
-
Anything over 500 lines or 5000 tokens goes to `references/`. But tell the
|
|
105
|
-
agent WHEN to load each file — conditional references, not a generic "see
|
|
106
|
-
references/ for details."
|
|
107
|
-
|
|
108
|
-
**Good:** "Read `references/api-errors.md` if the API returns a non-200 status"
|
|
109
|
-
**Bad:** "See references/ for more information"
|
|
110
|
-
|
|
111
|
-
### Step 5: Validate
|
|
112
|
-
|
|
113
|
-
Run through this checklist:
|
|
114
|
-
|
|
115
|
-
- [ ] Description under 1024 chars
|
|
116
|
-
- [ ] Body under 500 lines / 5000 tokens
|
|
117
|
-
- [ ] Every instruction passes "would the agent get this wrong without it?"
|
|
118
|
-
- [ ] Gotchas are concrete corrections, not general advice
|
|
119
|
-
- [ ] Defaults chosen, not menus presented
|
|
120
|
-
- [ ] Control calibrated: prescriptive where fragile, flexible where tolerant
|
|
121
|
-
- [ ] References have conditional load triggers
|
|
122
|
-
- [ ] No explaining what the agent already knows
|
|
123
|
-
|
|
124
|
-
For structured evaluation beyond this checklist (paired evals, pass rate
|
|
125
|
-
tracking, regression testing), use `plastic-evaluating-skills`.
|
|
126
|
-
|
|
127
|
-
## Gotchas
|
|
128
|
-
|
|
129
|
-
- Hook `additionalContext` truncates at **10,000 characters**. If instructions
|
|
130
|
-
must load via hooks (not skills), they must fit this budget.
|
|
131
|
-
- `~/.claude/rules/*.md` files load fully with no truncation — use for
|
|
132
|
-
always-loaded conventions that don't fit in a skill.
|
|
133
|
-
- CLAUDE.md supports `@path/to/file` imports (max depth 4) — another way
|
|
134
|
-
to load large instruction sets without truncation.
|
|
135
|
-
- Agents only consult skills for tasks beyond what they can handle alone.
|
|
136
|
-
Simple one-step requests may not trigger even with a perfect description.
|
|
137
|
-
- Content from real domain expertise (runbooks, incident reports, code review)
|
|
138
|
-
dramatically outperforms LLM-generated instructions without project context.
|
|
139
|
-
- The most common cause of agents not following instructions: the instruction
|
|
140
|
-
was too vague, didn't apply to the current task, or presented too many
|
|
141
|
-
options without a clear default. Read execution traces to diagnose.
|
|
142
|
-
|
|
143
|
-
## For Convention Files (PLASTIC.md, CLAUDE.md)
|
|
144
|
-
|
|
145
|
-
Convention files aren't skills — they load differently. Apply progressive
|
|
146
|
-
disclosure by splitting:
|
|
147
|
-
|
|
148
|
-
| Layer | Mechanism | Budget | Content |
|
|
149
|
-
|-------|-----------|--------|---------|
|
|
150
|
-
| **Always-on** | `~/.claude/rules/` or hook | <10K chars | Core identity, gotchas, critical procedures |
|
|
151
|
-
| **On-demand** | Skills (SKILL.md) | <5K tokens each | Specific workflows activated by task |
|
|
152
|
-
| **Deep reference** | `references/` in skills | Unlimited | Full specs, schemas, examples |
|
|
153
|
-
|
|
154
|
-
**The always-on layer should answer: "What does this agent need to know about
|
|
155
|
-
every single task?"** Everything else activates on demand.
|
|
156
|
-
|
|
157
|
-
## References
|
|
158
|
-
|
|
159
|
-
- Read `references/agentskills-spec.md` for the complete agentskills.io specification including frontmatter fields, description optimization methodology, evaluation framework, and script design requirements
|