@zalom/plastic 1.0.0-alpha.2 → 1.0.0-alpha.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.
Files changed (76) hide show
  1. package/PLASTIC.md +128 -473
  2. package/README.md +90 -58
  3. package/agents/future-intent-researcher.md +1 -1
  4. package/agents/intent-curator.md +1 -1
  5. package/bin/plastic.js +57 -0
  6. package/bin/test +28 -0
  7. package/deprecations.yml +7 -6
  8. package/hooks/auto-arm +5 -0
  9. package/hooks/bash-gate +3 -0
  10. package/hooks/check-update +12 -8
  11. package/hooks/code-gate +10 -0
  12. package/hooks/hooks.json +25 -4
  13. package/hooks/statusline +50 -10
  14. package/package.json +2 -2
  15. package/scripts/dashboard.rb +480 -0
  16. package/scripts/doctor.rb +973 -0
  17. package/scripts/hook-auto-arm +52 -0
  18. package/scripts/hook-bash-gate +53 -0
  19. package/scripts/hook-code-gate +39 -0
  20. package/scripts/hook-continue +15 -114
  21. package/scripts/hook-gate-check +19 -4
  22. package/scripts/hook-session-start +76 -31
  23. package/scripts/install.rb +91 -480
  24. package/scripts/lib/bridge.rb +255 -0
  25. package/scripts/lib/installer_core.rb +760 -0
  26. package/scripts/migrate-to-global +1 -1
  27. package/scripts/select-update-target +93 -0
  28. package/scripts/uninstall.rb +53 -0
  29. package/scripts/update.rb +142 -0
  30. package/scripts/versions.rb +141 -0
  31. package/skills/_active-intent-gate.md +26 -0
  32. package/skills/auto/SKILL.md +62 -9
  33. package/skills/auto/evals/evals.json +92 -0
  34. package/skills/auto/references/agent-architecture.md +60 -0
  35. package/skills/brainstorming/SKILL.md +143 -0
  36. package/skills/brainstorming-grill-me/SKILL.md +5 -5
  37. package/skills/continuing/SKILL.md +102 -77
  38. package/skills/continuing/evals/evals.json +136 -0
  39. package/skills/continuing/references/context-management.md +32 -0
  40. package/skills/creating-intent/SKILL.md +16 -1
  41. package/skills/creating-intent/references/lifecycle.md +74 -0
  42. package/skills/creating-intent/references/wikilinks.md +8 -0
  43. package/skills/creating-project/SKILL.md +8 -4
  44. package/skills/creating-project/references/hubs-projects.md +55 -0
  45. package/skills/dashboard/SKILL.md +92 -0
  46. package/skills/doctor/SKILL.md +116 -0
  47. package/skills/doctor/references/gates-stuck-detection.md +38 -0
  48. package/skills/doctor/report.md +96 -0
  49. package/skills/evaluating-skills/SKILL.md +140 -0
  50. package/skills/evaluating-skills/assets/eval-template.json +12 -0
  51. package/skills/evaluating-skills/evals/evals.json +75 -0
  52. package/skills/evaluating-skills/references/convention-checks.md +76 -0
  53. package/skills/evaluating-skills/references/eval-methodology.md +154 -0
  54. package/skills/executing-plan/SKILL.md +3 -3
  55. package/skills/install/SKILL.md +56 -8
  56. package/skills/intent-curator/SKILL.md +3 -3
  57. package/skills/linking-intents/SKILL.md +5 -1
  58. package/skills/linking-intents/references/zettelkasten.md +33 -0
  59. package/skills/managing-index/SKILL.md +5 -1
  60. package/skills/releasing/SKILL.md +119 -18
  61. package/skills/releasing/references/deprecations.md +44 -0
  62. package/skills/research/SKILL.md +114 -0
  63. package/skills/savepoint/SKILL.md +46 -37
  64. package/skills/savepoint/references/context-management.md +32 -0
  65. package/skills/uninstall/SKILL.md +39 -28
  66. package/skills/update/SKILL.md +41 -36
  67. package/skills/versions/SKILL.md +65 -0
  68. package/skills/writing-instructions/SKILL.md +159 -0
  69. package/skills/writing-instructions/references/agentskills-spec.md +135 -0
  70. package/skills/writing-plans/SKILL.md +183 -0
  71. package/templates/agents.md +16 -0
  72. package/templates/outcome.md +13 -0
  73. package/templates/project.yml +5 -0
  74. package/templates/savepoint.md +14 -13
  75. package/templates/spec.md +25 -0
  76. package/bin/install.js +0 -29
@@ -1,6 +1,6 @@
1
1
  ---
2
- name: update
3
- description: Use when updating Plastic after a plugin update, or when the user says "update plastic". Runs the npx installer to sync core files and re-register agent adapters.
2
+ name: plastic-update
3
+ description: Use when updating Plastic. Runs the `update` verb, which reads the installed VERSION, derives its channel, queries npm dist-tags, and advances to the next version on that channel (or switches channel with a flag).
4
4
  ---
5
5
 
6
6
  # Update Plastic
@@ -8,62 +8,67 @@ description: Use when updating Plastic after a plugin update, or when the user s
8
8
  ## When to Use
9
9
  - User says "update plastic", "sync plastic", or "upgrade plastic"
10
10
  - Statusline shows "Plastic update available"
11
- - After a version bump notification
11
+ - After a version-bump notification
12
12
 
13
- ## Prerequisites
13
+ ## What it does
14
14
 
15
- Global install must exist (`~/.plastic/INDEX.md` present). If not, tell the
16
- user to run `npx @zalom/plastic@latest` first.
15
+ `update` is a single deterministic command. It reads `~/.plastic/VERSION`, derives the
16
+ channel from the version string (`-alpha`/`-beta`/none → stable), queries `npm` dist-tags,
17
+ and advances to the **next version on the current channel**. "Already up to date" is a
18
+ clean no-op. You do not compute the target yourself — the script does.
17
19
 
18
- ## Procedure
20
+ ## Flags
19
21
 
20
- ### Step 1: Verify global install exists
22
+ | Flag | Behaviour |
23
+ |------|-----------|
24
+ | (none) | Advance to the next version on the **current** channel |
25
+ | `--latest` | Switch to / advance the **stable** channel (toward stability — frictionless) |
26
+ | `--beta` | Switch to / advance the **beta** channel |
27
+ | `--alpha` | Switch to / advance the **alpha** channel (bleeding edge — confirmed if moving down in stability) |
21
28
 
22
- ```bash
23
- if [ ! -f ~/.plastic/INDEX.md ]; then
24
- echo "No global install found. Run: npx @zalom/plastic@latest"
25
- exit
26
- fi
27
- ```
29
+ Switching toward a more stable channel is frictionless; switching toward bleeding edge is
30
+ confirmed. To roll **back** to a previously-installed version, use `plastic-versions`.
31
+
32
+ ## Prerequisites
28
33
 
29
- ### Step 2: Run the installer
34
+ Plastic must be installed (`~/.plastic/VERSION` present). If not, run
35
+ `npx @zalom/plastic install --claude` first.
36
+
37
+ ## Procedure
38
+
39
+ ### Step 1: Run the update
30
40
 
31
41
  ```bash
32
- npx @zalom/plastic@latest --claude
42
+ npx @zalom/plastic update # next version on the current channel
43
+ # or: npx @zalom/plastic update --beta / --latest / --alpha
33
44
  ```
34
45
 
35
- This re-runs the installer which:
36
- - Downloads the latest version from npm
37
- - Syncs core files (PLASTIC.md, scripts, hooks) to ~/.plastic/
38
- - Re-registers hooks and skills into Claude Code's ~/.claude/
39
- - Preserves all user data (INDEX.md, config.yml, projects.yml, store/)
46
+ Append the agent flag(s) if not just Claude (`--codex`, `--hermes`, `--all`).
47
+ The command prints the transition (`vX vY`) or "already up to date", and records the
48
+ move in the append-only `~/.plastic/versions.json` ledger.
40
49
 
41
- ### Step 3: Announce key changes
50
+ ### Step 2: Announce key changes
42
51
 
43
- After the installer completes, read `~/.plastic/PLASTIC.md` and announce any
44
- convention changes that affect the current session. This corrects the agent's
45
- in-context understanding without needing /clear.
52
+ After it completes, read `~/.plastic/PLASTIC.md` and announce convention changes that
53
+ affect the current session:
46
54
 
47
- Format:
48
55
  ```
49
- Plastic updated to vX.Y.Z.
56
+ Plastic updated to vX.Y.Z (channel).
50
57
 
51
- Key changes in this version:
52
- - [list notable convention changes if any]
58
+ Key changes:
59
+ - [notable convention changes, if any]
53
60
 
54
61
  Recommendation: run /clear for a clean session with all new conventions loaded.
55
62
  ```
56
63
 
57
- ### Step 4: Commit
64
+ ### Step 3: Health check
58
65
 
59
- ```bash
60
- cd ~/.plastic && git add PLASTIC.md scripts/ AGENTS.md VERSION 2>/dev/null && git commit -m "chore: update Plastic core files" --allow-empty
61
- ```
66
+ Invoke `plastic-doctor`. If all checks pass: **"Health check: all clear."** Otherwise show
67
+ the report and offer to fix.
62
68
 
63
- ### Step 5: Clear update cache
69
+ ### Step 4: Commit + clear update cache
64
70
 
65
71
  ```bash
72
+ cd ~/.plastic && git add PLASTIC.md scripts/ AGENTS.md VERSION versions.json 2>/dev/null && git commit -m "chore: update Plastic to $(cat ~/.plastic/VERSION)" --allow-empty
66
73
  rm -f ~/.plastic/.cache/update-check.json
67
74
  ```
68
-
69
- This removes the statusline warning since the update is now applied.
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: plastic-versions
3
+ description: Use when the user wants to see their Plastic version history or roll back to a previously-installed version after a bad release. Manages the local, append-only versions.json ledger and steps between versions the user has actually run. For moving to a brand-new release, use plastic-update instead.
4
+ ---
5
+
6
+ # Plastic Versions — local version time-machine
7
+
8
+ ## When to Use
9
+ - "show plastic versions", "version history", "what versions have I run"
10
+ - "roll back plastic", "downgrade", "go back to the version that worked", "revert plastic"
11
+ - A new version broke something and the user wants their last known-good build
12
+
13
+ For upgrading to a **new** release, use `plastic-update`. This skill only navigates
14
+ versions you have **already installed** — the ones recorded in the ledger.
15
+
16
+ ## The ledger
17
+
18
+ `~/.plastic/versions.json` is an **append-only JSONL** ledger — one line per version
19
+ change, never modified or deleted:
20
+
21
+ ```json
22
+ {"version":"1.0.0-alpha.17","action":"install","at":"..."}
23
+ {"version":"1.0.0-alpha.18","action":"update","at":"..."}
24
+ ```
25
+
26
+ `action` ∈ `install | reinstall | update | downgrade` (derived from version direction; the
27
+ channel is derived from the version string, never stored). It is a troubleshooting record.
28
+
29
+ ## Procedure
30
+
31
+ ### Show history
32
+
33
+ ```bash
34
+ npx @zalom/plastic versions
35
+ ```
36
+
37
+ Prints the table with the currently-installed version marked. If the most recent action was
38
+ a `downgrade`, it asks whether to keep rolling back.
39
+
40
+ ### Roll back
41
+
42
+ ```bash
43
+ npx @zalom/plastic versions --downgrade # one step back
44
+ npx @zalom/plastic versions --downgrade --version 1.0.0-alpha.15 # to a specific run
45
+ ```
46
+
47
+ Rollback targets are restricted to versions in the ledger (only builds you have actually
48
+ run, so you only ever return to something known-good for you). The chosen version is
49
+ re-fetched from npm and re-synced; your intent store, config, and the ledger are untouched.
50
+
51
+ ### Step forward (after a rollback)
52
+
53
+ ```bash
54
+ npx @zalom/plastic versions --upgrade # one step forward in your history
55
+ ```
56
+
57
+ ### After any change
58
+
59
+ Run `plastic-doctor` to confirm health, and suggest `/clear` so the session picks up the
60
+ swapped conventions.
61
+
62
+ ## Notes
63
+ - The ledger is **never** edited or pruned — it is the audit trail.
64
+ - Downgrades cannot un-migrate a store-format change; if a warning appears, surface it to
65
+ the user rather than forcing the rollback.
@@ -0,0 +1,159 @@
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
@@ -0,0 +1,135 @@
1
+ # agentskills.io Full Reference
2
+
3
+ Source: https://agentskills.io (all sections, verified June 2026)
4
+
5
+ ## Specification Details
6
+
7
+ ### Frontmatter Fields
8
+
9
+ | Field | Required | Constraints |
10
+ |-------|----------|-------------|
11
+ | name | Yes | 1-64 chars. Lowercase alphanumeric + hyphens. No leading/trailing/consecutive hyphens. Must match directory name. |
12
+ | description | Yes | 1-1024 chars. Non-empty. What + when. |
13
+ | license | No | Short — name or filename reference |
14
+ | compatibility | No | 1-500 chars. Environment requirements only when needed. |
15
+ | metadata | No | String→string map. Use unique key names. |
16
+ | allowed-tools | No | Space-separated. Experimental. |
17
+
18
+ ### Progressive Disclosure Token Budgets
19
+
20
+ - Discovery: ~100 tokens per skill (name + description only)
21
+ - Activation: <5000 tokens / <500 lines recommended for SKILL.md body
22
+ - Execution: Unbounded — files in scripts/, references/, assets/ load as needed
23
+
24
+ ### File References
25
+
26
+ - Use relative paths from skill root
27
+ - Keep one level deep from SKILL.md
28
+ - Agent resolves paths automatically
29
+
30
+ ## Description Optimization
31
+
32
+ ### Evaluation Methodology
33
+
34
+ 1. Create ~20 eval queries (8-10 should-trigger, 8-10 should-not)
35
+ 2. Split 60/40 train/validation (proportional mix in each)
36
+ 3. Run each query 3 times, compute trigger rate
37
+ 4. Pass threshold: 0.5
38
+ 5. Near-miss negatives are most valuable (share keywords, need different thing)
39
+ 6. Iterate on train set only, validate on held-out set
40
+ 7. Select best by validation pass rate, not last iteration
41
+ 8. 5 iterations usually sufficient
42
+
43
+ ### Description Anti-patterns
44
+
45
+ - "Helps with PDFs" — too vague, no trigger context
46
+ - "Process CSV files" — no when/why, no user-intent focus
47
+ - Implementation details instead of user intent
48
+ - Missing edge case triggers (user doesn't name the domain)
49
+
50
+ ## Instruction Best Practices
51
+
52
+ ### Gotchas — Highest-Value Content
53
+
54
+ Concrete corrections, not general advice:
55
+
56
+ ```markdown
57
+ ## Gotchas
58
+ - The `users` table uses soft deletes. Queries must include
59
+ `WHERE deleted_at IS NULL`.
60
+ - User ID is `user_id` in DB, `uid` in auth, `accountId` in billing.
61
+ All three refer to the same value.
62
+ - The `/health` endpoint returns 200 even if DB is down. Use `/ready`.
63
+ ```
64
+
65
+ ### Calibrating Control
66
+
67
+ Prescriptive when:
68
+ - Operations are fragile
69
+ - Consistency matters
70
+ - Specific sequence must be followed
71
+
72
+ Flexible when:
73
+ - Multiple approaches are valid
74
+ - Task tolerates variation
75
+ - Explaining WHY is more effective than rigid rules
76
+
77
+ ### Instruction Patterns
78
+
79
+ 1. **Validation loops**: Do work → validate → fix → repeat
80
+ 2. **Plan-validate-execute**: Create plan → validate vs source of truth → execute
81
+ 3. **Checklists**: Track progress, enforce dependencies, validation gates
82
+ 4. **Bundled scripts**: If agent reinvents same logic each run, bundle it
83
+ 5. **Templates**: Concrete output structures > prose descriptions
84
+
85
+ ## Script Design
86
+
87
+ ### Hard Requirements
88
+ - No interactive prompts (hard requirement — agents hang indefinitely)
89
+ - All input via flags, env vars, or stdin
90
+
91
+ ### Agent-Friendly Design
92
+ - --help as primary interface documentation
93
+ - Helpful error messages: what wrong + what expected + what to try
94
+ - Structured output (JSON/CSV/TSV), data on stdout, diagnostics on stderr
95
+ - Idempotent operations (agents may retry)
96
+ - Dry-run for destructive operations
97
+ - Meaningful exit codes documented in --help
98
+ - Output size control: default to summaries, support --offset pagination
99
+ - Agent harnesses truncate at 10-30K characters
100
+
101
+ ## Evaluation Framework
102
+
103
+ ### Test Case Structure
104
+ ```json
105
+ {
106
+ "skill_name": "name",
107
+ "evals": [{
108
+ "id": 1,
109
+ "prompt": "realistic user message",
110
+ "expected_output": "what success looks like",
111
+ "files": ["evals/files/input.csv"],
112
+ "assertions": ["specific, verifiable checks"]
113
+ }]
114
+ }
115
+ ```
116
+
117
+ ### Running Evals
118
+ - With-skill vs without-skill (or previous version) comparison
119
+ - Clean context per run (subagents or separate sessions)
120
+ - Capture timing: total_tokens, duration_ms
121
+ - Start with 2-3 test cases, expand after first results
122
+
123
+ ### Assertion Quality
124
+ Good: Programmatically verifiable, specific, countable
125
+ Weak: Vague ("the output is good")
126
+ Brittle: Exact phrase matching
127
+
128
+ Principle: Require concrete evidence for PASS. No benefit of the doubt.
129
+
130
+ ### Iteration Loop
131
+ 1. Run evals → grade assertions → aggregate benchmarks
132
+ 2. Identify failures (assertions, human feedback, execution transcripts)
133
+ 3. Feed all three + SKILL.md to LLM for proposed changes
134
+ 4. Apply changes → re-run → compare
135
+ 5. Stop when consistently empty feedback or no meaningful improvement
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: plastic-writing-plans
3
+ description: "Write implementation plans from a spec. Produces plan.md, checklist.md, and actions/ in the active intent directory."
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ ## Overview
9
+
10
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
11
+
12
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
13
+
14
+ **Announce at start:** "I'm using the writing-plans skill to plan intent {id} — {name}."
15
+
16
+ ## Active Intent Gate
17
+
18
+ Before proceeding, resolve the active intent:
19
+
20
+ 1. **Detect store:** Read `~/.plastic/projects.yml`, match CWD against registered project paths. If match → project store at `~/.plastic/projects/{slug}/store/`. If no match → global store at `~/.plastic/store/`.
21
+ 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"
22
+ 3. **Resolve intent directory:** `{store}/store/{id}--{slug}/`
23
+ 4. **Read spec:** Load `{intent_dir}/spec.md`. If no spec exists → refuse: "No spec found. Run /plastic-brainstorming first."
24
+
25
+ All artifacts go to the intent directory. Never write to external paths.
26
+
27
+ ## Scope Check
28
+
29
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
30
+
31
+ ## File Structure
32
+
33
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
34
+
35
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
36
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
37
+ - Files that change together should live together. Split by responsibility, not by technical layer.
38
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
39
+
40
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
41
+
42
+ ## Bite-Sized Task Granularity
43
+
44
+ **Each step is one action (2-5 minutes):**
45
+ - "Write the failing test" - step
46
+ - "Run it to make sure it fails" - step
47
+ - "Implement the minimal code to make the test pass" - step
48
+ - "Run the tests and make sure they pass" - step
49
+ - "Commit" - step
50
+
51
+ ## Plan Document Header
52
+
53
+ **Every plan MUST start with this header:**
54
+
55
+ ```markdown
56
+ # [Feature Name] Implementation Plan
57
+
58
+ > **For agentic workers:** Use `plastic-executing-plan` to implement this plan task-by-task.
59
+
60
+ **Goal:** [One sentence describing what this builds]
61
+
62
+ **Architecture:** [2-3 sentences about approach]
63
+
64
+ **Tech Stack:** [Key technologies/libraries]
65
+
66
+ **Intent:** {id} — {name}
67
+
68
+ ---
69
+ ```
70
+
71
+ ## Task Structure
72
+
73
+ ````markdown
74
+ ### Task N: [Component Name]
75
+
76
+ **Files:**
77
+ - Create: `exact/path/to/file.rb`
78
+ - Modify: `exact/path/to/existing.rb:123-145`
79
+ - Test: `test/exact/path/to/test.rb`
80
+
81
+ - [ ] **Step 1: Write the failing test**
82
+
83
+ ```ruby
84
+ def test_specific_behavior
85
+ result = function(input)
86
+ assert_equal expected, result
87
+ end
88
+ ```
89
+
90
+ - [ ] **Step 2: Run test to verify it fails**
91
+
92
+ Run: `ruby -Itest test/path/test.rb --name test_specific_behavior`
93
+ Expected: FAIL with "undefined method"
94
+
95
+ - [ ] **Step 3: Write minimal implementation**
96
+
97
+ ```ruby
98
+ def function(input)
99
+ expected
100
+ end
101
+ ```
102
+
103
+ - [ ] **Step 4: Run test to verify it passes**
104
+
105
+ Run: `ruby -Itest test/path/test.rb --name test_specific_behavior`
106
+ Expected: PASS
107
+
108
+ - [ ] **Step 5: Commit**
109
+
110
+ ```bash
111
+ git add test/path/test.rb lib/path/file.rb
112
+ git commit -m "feat: add specific feature"
113
+ ```
114
+ ````
115
+
116
+ ## No Placeholders
117
+
118
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
119
+ - "TBD", "TODO", "implement later", "fill in details"
120
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
121
+ - "Write tests for the above" (without actual test code)
122
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
123
+ - Steps that describe what to do without showing how (code blocks required for code steps)
124
+ - References to types, functions, or methods not defined in any task
125
+
126
+ ## Remember
127
+ - Exact file paths always
128
+ - Complete code in every step — if a step changes code, show the code
129
+ - Exact commands with expected output
130
+ - DRY, YAGNI, TDD, frequent commits
131
+
132
+ ## Self-Review
133
+
134
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
135
+
136
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
137
+
138
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
139
+
140
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clear_layers` in Task 3 but `clear_full_layers` in Task 7 is a bug.
141
+
142
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
143
+
144
+ ## Plastic Artifacts
145
+
146
+ After writing `plan.md`, create two additional artifacts in the intent directory:
147
+
148
+ ### checklist.md
149
+
150
+ Execution registry with one checkbox per task. Format:
151
+
152
+ ```markdown
153
+ # Checklist — Intent {id}: {name}
154
+
155
+ - [ ] Task 1: {task title}
156
+ - [ ] Task 2: {task title}
157
+ - [ ] Task 3: {task title}
158
+ ...
159
+ ```
160
+
161
+ ### actions/ACTION_N.md
162
+
163
+ One file per task. Each action is self-contained — a subagent can execute it without reading the plan.
164
+
165
+ ```markdown
166
+ # Action {N}: {task title}
167
+
168
+ {Full task text copied from plan.md — all steps, all code, all commands. Nothing omitted.}
169
+ ```
170
+
171
+ Create the `actions/` directory inside the intent directory: `{intent_dir}/actions/`
172
+
173
+ ## Git Commit
174
+
175
+ After writing all artifacts (plan.md, checklist.md, actions/), commit to the store:
176
+
177
+ ```bash
178
+ cd {store_root} && git add . && git commit -m "docs: plan for intent {id} — {name}"
179
+ ```
180
+
181
+ ## Execution Handoff
182
+
183
+ Plan complete. Invoke `plastic-executing-plan` to begin execution.
@@ -41,6 +41,22 @@ Active/Future/Completed placement is managed in INDEX.md, not in frontmatter.
41
41
  4. Set frontmatter: `id`, `intent`, `sources` (array — link to governing intent), `chain` (starts empty), `created`, `author`, `tags`
42
42
  5. Add `[[global:ID]]` backlink in `## Links`
43
43
 
44
+ ## Lifecycle Skills
45
+
46
+ Plastic has its own lifecycle skills. When a Plastic skill exists for the current phase, use it instead of any external skill (superpowers, superpowers-ruby, etc.).
47
+
48
+ | Phase | Skill | Produces |
49
+ |-------|-------|----------|
50
+ | What | `plastic-creating-intent` | Intent file |
51
+ | Why | `plastic-brainstorming` | `spec.md` |
52
+ | Why | `plastic-research` | `resources/*.md` |
53
+ | Why | `plastic-brainstorming-grill-me` | Deep interrogation |
54
+ | How | `plastic-writing-plans` | `plan.md`, `checklist.md`, `actions/` |
55
+ | Exec | `plastic-executing-plan` | Code + `outcome.md` |
56
+ | Done | `plastic-intent-curator` | Lifecycle transition |
57
+
58
+ **Artifact convention:** ALL lifecycle artifacts go to the active intent directory (`store/{id}--{slug}/`). Never write specs to `docs/superpowers/specs/` or plans to `docs/superpowers/plans/`.
59
+
44
60
  ## When You're Done
45
61
 
46
62
  When this project satisfies the governing intent's goal, report back. The orchestrator will complete the strategic intent.