@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
@@ -0,0 +1,74 @@
1
+ # Building an Intent — Full Lifecycle Detail
2
+
3
+ ## What → `## Intent` section
4
+
5
+ The desire. One paragraph. What the human or agent wants.
6
+ This exists from the moment the intent is created.
7
+
8
+ **Deliverable:** `{ID}--{slug}.md`
9
+
10
+ ## Why → `## Context` + `### Decisions` sections
11
+
12
+ Why this intent exists. Grows over time through brainstorming and exploration.
13
+
14
+ - **Context** — what we knew going in + what we decided along the way
15
+ - **Decisions** — main premises derived from Context plus decisions from brainstorming/grilling
16
+ - Decisions are Why-level: "status belongs on actions because multiple workstreams", not How-level: "use ACTION_N.md files"
17
+
18
+ **Deliverable:** `spec.md` (consolidated specification from Context + Decisions + brainstorming)
19
+
20
+ ## How → Planning and preparation
21
+
22
+ Research decisions, create the implementation plan, define actions.
23
+
24
+ **Deliverable:** `plan.md` + `actions/` + `checklist.md` (execution registry with checkboxes covering all actions)
25
+
26
+ ## Exec → Execute actions
27
+
28
+ Execute actions from the plan, track progress via checklist.
29
+
30
+ **Deliverable:** `outcome.md` (detailed result). `## Outcome` in intent.md = short summary written as last step.
31
+
32
+ ## `## Insights` — Append-only work log
33
+
34
+ Captured throughout ALL stages. One-liner bullet points.
35
+ Never modified, only appended.
36
+
37
+ Tracks: stage transitions, decisions, shifts, blocks, cancellations, material for future intents.
38
+ This is how execution is tracked. When this intent completes, Insights
39
+ is where to look for what comes next. New intents spawned from Insights
40
+ appear in the `chain` field.
41
+
42
+ ## `## Links`
43
+
44
+ Wikilinks for Obsidian graph navigation. Human-facing counterpart to the
45
+ frontmatter knowledge graph.
46
+
47
+ ## Conventions — Filesystem as Schema
48
+
49
+ State is derived from what exists, not from what's declared.
50
+
51
+ | Convention | Signal |
52
+ |---|---|
53
+ | No `## Context` | Intent is fleeting (quick capture, non-actionable) |
54
+ | `## Context` has content | Intent is permanent (developed, actionable) |
55
+ | `## Outcome` has content | Intent is done |
56
+ | `## Insights` has `(autonomous)` entries | Intent is/was being delivered autonomously |
57
+
58
+ ### Transitions
59
+
60
+ - Fleeting → permanent: add `## Context` (one-way, also makes it actionable)
61
+ - There is no separate "non-actionable → actionable" transition — permanence implies actionability
62
+ - Even research intents are actionable: the research itself is the action, the conclusion is the outcome
63
+
64
+ ## Creating an Intent — Full Steps
65
+
66
+ 1. Determine the target store: `~/.plastic/store/` for global intents (default), `~/.plastic/projects/{slug}/store/` for project intents
67
+ 2. Determine the Folgezettel ID: If root (no parent), find highest root number +1. If branch, run `"${CLAUDE_PLUGIN_ROOT}/scripts/folgezettel-id" <parent_id> <store_path>`
68
+ 3. Create the intent directory in the chosen store (e.g., `ID--three-to-five-words`)
69
+ 4. Create `{ID}--{slug}.md` with frontmatter (id, intent, sources, chain, created, author, tags)
70
+ 5. Write `## Intent` — the What
71
+ 6. Add remaining sections: `## Context`, `## Outcome`, `## Insights`, `## Links`
72
+ 7. Update the appropriate `INDEX.md` — add to Active section and appropriate cluster
73
+
74
+ A fleeting intent can skip `## Context` — just `## Intent` and empty sections.
@@ -0,0 +1,8 @@
1
+ # Wikilink Conventions
2
+
3
+ | Syntax | Meaning |
4
+ |--------|---------|
5
+ | `[[ID]]` | Link to intent in same store (e.g., `[[1a1]]`) |
6
+ | `[[ID\|display text]]` | Link with human-readable label |
7
+ | `[[global:ID]]` | Link to intent in `~/.plastic/store/` |
8
+ | `[[project-slug:ID]]` | Link to intent in `~/.plastic/projects/{slug}/store/` |
@@ -1,8 +1,8 @@
1
1
  ---
2
- name: plastic:creating-project
2
+ name: plastic-creating-project
3
3
  description: >-
4
4
  Create a new project from an implementation intent. Sets up project directory,
5
- git init, AGENTS.md with founding intent decisions, plastic:install --local,
5
+ git init, AGENTS.md with founding intent decisions, plastic-install --local,
6
6
  tactical mirror, projects.yml registration, and framework scaffolding.
7
7
  Use when an implementation intent spawns a project, or manually by user.
8
8
  ---
@@ -31,9 +31,9 @@ cd <project_root>/<slug>
31
31
  git init
32
32
  ```
33
33
 
34
- ### 3. Run `plastic:install --local`
34
+ ### 3. Run `plastic-install --local`
35
35
 
36
- Invoke `plastic:install --local` in the project directory. This creates:
36
+ Invoke `plastic-install --local` in the project directory. This creates:
37
37
  ```
38
38
  .plastic/
39
39
  ├── store/
@@ -164,3 +164,7 @@ Log in `## Insights` of each founding intent:
164
164
 
165
165
  Announce to user:
166
166
  > "Project `<slug>` created at `<path>`. AGENTS.md populated with [N] decisions from [founding intent IDs]. Tactical mirror `1` is now the active intent in the project store."
167
+
168
+ ## References
169
+
170
+ - Read `references/hubs-projects.md` for the full hub/project relationship model, project creation flow, and cross-linking conventions
@@ -0,0 +1,55 @@
1
+ # Hubs and Projects
2
+
3
+ ## Hubs
4
+
5
+ A Hub is a cloud of intents around related topics. Hubs emerge naturally from
6
+ Folgezettel branching — intents that spawn in the same direction cluster.
7
+
8
+ - A Hub can spawn a Project. The Hub holds the founding ideas.
9
+ - A single intent can also spawn a Project.
10
+ - Hub-spawned projects revolve around different ideas around related topics.
11
+ - Intent-spawned projects revolve around the single founding intent.
12
+ - A Project is the deliverable outcome of one or more intents.
13
+
14
+ Hubs are represented as clusters in INDEX.md.
15
+
16
+ ## Projects — Full Detail
17
+
18
+ A Project is a deliverable grouping of intents. Projects have two stores:
19
+
20
+ - **Global store** (`~/.plastic/store/`): strategic intents
21
+ - **Project store** (`~/.plastic/projects/{slug}/store/`): tactical intents
22
+
23
+ `projects.yml` maps project slugs to codebase paths:
24
+ ```yaml
25
+ projects:
26
+ plastic:
27
+ path: "/path/to/plastic"
28
+ remote: "git@github.com:org/plastic.git"
29
+ registered: '2026-05-26'
30
+ status: active
31
+ ```
32
+
33
+ Config resolution: `~/.plastic/projects/{slug}/config.yml` overrides `~/.plastic/config.yml`.
34
+
35
+ Cross-linking: project intents reference global intents via `[[global:ID]]`. Global intents reference project intents via `[[project-slug:ID]]`.
36
+
37
+ ## Privacy and Collaboration
38
+
39
+ **Plastic is personal.** All intent data lives under `~/.plastic/` — one location,
40
+ one git repo, never pushed. Each person has their own intent store.
41
+
42
+ Collaboration happens through pull requests and project conventions, not shared intents.
43
+ When an intent delivers something that changes how a project works, the decision gets
44
+ written into the project's shared files (README, docs, config). The intents themselves
45
+ are private working memory.
46
+
47
+ ## Project Creation Flow
48
+
49
+ When an implementation intent spawns a project:
50
+ 1. Determine project path from config `project_roots` or intent context
51
+ 2. `gh repo create --private` (agent-created repos are always private by default)
52
+ 3. Set up project directory, git init, AGENTS.md with founding intent decisions
53
+ 4. Register in `projects.yml`
54
+ 5. Create tactical mirror in project store
55
+ 6. The global intent completes; the tactical mirror becomes the active intent
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: plastic-dashboard
3
+ description: Use when the user wants an overview of intents, asks "where are we", "what's next", "what should I work on", "show the dashboard", or invokes /plastic-dashboard. Renders a deterministic Value×Effort work cockpit across the global store and all projects, and emits a machine-readable queue that auto mode consumes.
4
+ ---
5
+
6
+ # Dashboard — Plastic Work Cockpit
7
+
8
+ A deterministic, template-driven overview of the intent store(s). It answers three
9
+ questions at a glance — **where we are** (active + last touched), **where we go next**
10
+ (a Value×Effort matrix), and **how to conduct it** (a disposition verb per intent) — and
11
+ emits a JSON manifest that `plastic-auto` reads to pick the next dispatchable intent.
12
+
13
+ The script does the rendering. The LLM is **never** in the rendering path: same store
14
+ state → byte-identical output, regardless of model. Do not hand-summarize intents when
15
+ this skill applies — run the script and show its output verbatim.
16
+
17
+ ## When to Use
18
+
19
+ - User invokes `/plastic-dashboard`
20
+ - User asks "where are we", "what's next", "what should I work on", "show me the intents"
21
+ - `plastic-continuing` embeds the `continue` view on resume
22
+ - `plastic-auto` reads `--json` to choose the next dispatchable intent
23
+
24
+ ## Procedure
25
+
26
+ ### Step 1 — Run the script
27
+
28
+ ```bash
29
+ ruby ~/.plastic/scripts/dashboard.rb [continue|project <slug>|all] [--json]
30
+ ```
31
+
32
+ | Mode | Shows |
33
+ |------|-------|
34
+ | `continue` (default) | Cross-scope: active + last touched, then the Value×Effort matrix for all scopes |
35
+ | `project <slug>` | One project: active line + its Value×Effort matrix |
36
+ | `all` | Per-scope roll-up summary |
37
+ | `--json` | The auto-mode manifest (any mode); machine-readable, not for humans |
38
+
39
+ The script is **read-only**. Print its stdout verbatim — do not reformat, re-sort, or
40
+ re-summarize. That is what keeps the output uniform.
41
+
42
+ ### Step 2 — Read the matrix
43
+
44
+ ```
45
+ small effort big effort
46
+ high value QUICK WIN ★ NEXT BIG THING
47
+ low value DEFER → agent TRIAGE / question
48
+ (type=research/exploration → RESEARCH band, regardless of quadrant)
49
+ ```
50
+
51
+ Disposition verbs: `▸ drive` (human leads), `⇢ defer` (agent knocks off),
52
+ `⊙ research` (research/explore agent), `⚑ triage` (human review / maybe abandon).
53
+ Flags: `⇡ unblocked` (a dependency just completed), `(Nd)` stale age.
54
+
55
+ ### Step 3 — Act on it
56
+
57
+ - **★ Next big thing** and `▸ drive` / `⚑ triage` items → the human leads (brainstorm → plan → exec).
58
+ - `⇢ defer` and `⊙ research` items → dispatchable to agents.
59
+ - In auto mode, read `--json` and work `dispatchable_queue` in `rank` order; leave
60
+ `human_only` for the user.
61
+
62
+ ## JSON contract
63
+
64
+ ```json
65
+ { "generated_for": "auto-mode", "scope": "<scope|all>",
66
+ "next_big_thing": "<id|null>",
67
+ "dispatchable_queue": [ {"id","scope","disposition","type","value","effort","flags","rank"} ],
68
+ "human_only": ["<id>", "..."] }
69
+ ```
70
+
71
+ ## How classification works (deterministic)
72
+
73
+ - **Effort** — small for `research`/`exploration`/`bugfix`, for already-scoped intents
74
+ (plan/checklist exists), or deep refinement branches; big otherwise.
75
+ - **Value** — high only for an explicit `value: high` frontmatter field, or a
76
+ human-authored root intent that has spawned follow-on work (`chain` non-empty); low otherwise.
77
+ - **Override** — a `value: high|normal|low` field in an intent's frontmatter wins. This is
78
+ the only place model judgment enters, and only as pre-stamped data (never at render time).
79
+
80
+ ## Eval
81
+
82
+ This skill's eval is **render the template**: run the engine against the test fixture
83
+ store and assert byte-identical text + JSON output against the golden snapshots in
84
+ `test/fixtures/dashboard/`. See `test/dashboard_test.rb`. If output drifts from the
85
+ golden files without an intentional template change, the skill is broken.
86
+
87
+ ## Notes
88
+
89
+ - Clusters (Zettelkasten grouping in INDEX.md) are intentionally **not** rendered — they
90
+ are orthogonal to "what to work on next."
91
+ - Glyphs are monochrome Unicode (no emoji); they render in standard terminal emulators.
92
+ - This is additive: it changes no core lifecycle, gate, or cycle logic.
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: plastic-doctor
3
+ description: Use when diagnosing Plastic installation health, after updates, or when something seems broken. Runs checks and reports findings with fix options.
4
+ ---
5
+
6
+ # Doctor — Plastic Health Check
7
+
8
+ ## When to Use
9
+
10
+ - User invokes `/plastic-doctor`
11
+ - After `plastic-update` completes (automatically)
12
+ - When hooks aren't firing, skills aren't loading, or something seems broken
13
+ - When the user says "check plastic", "diagnose", "what's wrong with plastic"
14
+
15
+ ## Procedure
16
+
17
+ ### Step 1: Run the diagnostic script
18
+
19
+ ```bash
20
+ ruby ~/.plastic/scripts/doctor.rb --agent claude
21
+ ```
22
+
23
+ Replace `claude` with the current agent type if known (`codex`, `hermes`).
24
+
25
+ Parse the JSON output from stdout. The script is read-only and never modifies
26
+ files. Errors go to stderr.
27
+
28
+ Exit codes indicate check results, not script failure:
29
+ - `0` — all checks passed
30
+ - `1` — warnings found
31
+ - `2` — failures found
32
+
33
+ All three exit codes mean the script ran successfully. Do not treat non-zero
34
+ as an error.
35
+
36
+ ### Step 2: Determine overall status
37
+
38
+ Read the `status` field from the JSON root:
39
+
40
+ | Status | Meaning |
41
+ |--------|---------|
42
+ | `pass` | Everything is healthy |
43
+ | `warn` | Warnings found but Plastic works normally |
44
+ | `fail` | Blocking issues that prevent Plastic from operating |
45
+
46
+ ### Step 3: Fill the report template
47
+
48
+ Read `report.md` from the same directory as this SKILL.md
49
+ (`~/.plastic/skills/doctor/report.md` at runtime, or the plugin source
50
+ `skills/doctor/report.md` during development).
51
+
52
+ Group checks by category. For each category, list the checks with their
53
+ status icon and message. If a check has `details`, list them as sub-items.
54
+
55
+ Present the filled template to the user.
56
+
57
+ ### Step 4: Offer fixes (if applicable)
58
+
59
+ If any checks have `fixable: true` AND status is not `pass`:
60
+
61
+ 1. Group fixable items by category
62
+ 2. Show what each fix would do (from `fix_hint`)
63
+ 3. Ask the user: **"Fix all / Select individually / Skip"**
64
+
65
+ If no fixable issues exist, skip this step.
66
+
67
+ ### Step 5: Apply fixes
68
+
69
+ Use the `fix_hint` value to determine the correct action:
70
+
71
+ | Fix hint pattern | Agent action |
72
+ |---|---|
73
+ | "chmod +x on the listed files" | Run `chmod +x` on each file listed in `details` |
74
+ | "Create missing directory" | Run `mkdir -p` on the path |
75
+ | "Create INDEX.md with required sections" | Write INDEX.md with the 5 sections: Active, Future, Clusters, Abandoned, Completed |
76
+ | "Add missing entries to INDEX.md" | Add orphaned intents to the appropriate INDEX.md section |
77
+ | "Remove stale references from INDEX.md" | Edit INDEX.md to remove ghost references |
78
+ | "Re-run installer" | Run `npx @zalom/plastic@latest --agent` |
79
+
80
+ For fixes the agent cannot handle automatically, explain what the user needs
81
+ to do manually.
82
+
83
+ ### Step 6: Verify
84
+
85
+ After applying fixes, re-run the diagnostic script:
86
+
87
+ ```bash
88
+ ruby ~/.plastic/scripts/doctor.rb --agent claude
89
+ ```
90
+
91
+ Show the updated results.
92
+
93
+ - If all checks pass: announce success.
94
+ - If issues remain: explain what is still wrong and what the user can do.
95
+
96
+ ## Post-Update Mode
97
+
98
+ When invoked from `plastic-update` (not directly by the user):
99
+
100
+ 1. Run the diagnostic script as in Step 1.
101
+ 2. If all checks pass: show a single line — **"Health check: all clear."**
102
+ 3. If issues are found: show the full report (Steps 3-6).
103
+
104
+ This keeps the update flow clean when nothing is wrong.
105
+
106
+ ## Important Notes
107
+
108
+ - The script is **read-only**. It inspects but never modifies files.
109
+ All fixes are performed by the agent using standard tools.
110
+ - The script outputs JSON to stdout. Any diagnostic errors go to stderr.
111
+ - Non-zero exit codes mean "issues found", not "script crashed".
112
+ Always parse stdout regardless of exit code.
113
+
114
+ ## References
115
+
116
+ - Read `references/gates-stuck-detection.md` for the full gate enforcement table, bridge file pattern, and stuck detection thresholds when diagnosing gate failures or stuck agents
@@ -0,0 +1,38 @@
1
+ # Gate Enforcement and Stuck Detection
2
+
3
+ ## Bridge File Pattern
4
+
5
+ `/tmp/plastic-{session}.json` is the hot cache; the filesystem is the authority.
6
+ SessionStart rebuilds the bridge file from the filesystem — the bridge is always disposable.
7
+
8
+ ## Gate Taxonomy
9
+
10
+ | Gate type | Purpose |
11
+ |---|---|
12
+ | **Pre-flight** | Prerequisites exist? |
13
+ | **Revision** | New info invalidated prior work? |
14
+ | **Escalation** | Blocked items surface to user |
15
+ | **Abort** | Inconsistent state detected |
16
+
17
+ ## Full Gate Enforcement
18
+
19
+ | Gate | Blocked action | Required prerequisite |
20
+ |---|---|---|
21
+ | Pre-flight | Cannot write `plan.md` | `spec.md` must exist |
22
+ | Pre-flight | Cannot create `actions/` | `spec.md` must exist |
23
+ | Pre-flight | Cannot write `outcome.md` | `checklist.md` must exist with all items checked |
24
+ | Revision | Cannot proceed to Exec | Context changed after spec.md — re-derive spec |
25
+ | Abort | Cannot complete intent | `outcome.md` exists but checklist has unchecked items |
26
+
27
+ Hard blocking — hooks exit with code 2 when gates fail.
28
+
29
+ ## Stuck Detection
30
+
31
+ | Condition | Threshold | Action |
32
+ |---|---|---|
33
+ | Consecutive gate failures | 3+ | Warning |
34
+ | Consecutive gate failures | 5+ | Force savepoint + escalate |
35
+ | No activity | 5+ min | Warning |
36
+ | No activity | 10+ min | Force savepoint + escalate |
37
+ | Context pressure | 80% | Warning |
38
+ | Context pressure | 90% | Force savepoint |
@@ -0,0 +1,96 @@
1
+ # Plastic Doctor Report
2
+
3
+ <!-- =======================================================================
4
+ AGENT INSTRUCTIONS -- How to fill this template
5
+ =========================================================================
6
+ 1. Run the doctor script. It outputs JSON with check results.
7
+ 2. Replace every {{placeholder}} below with the corresponding JSON value.
8
+ 3. For the category sections: the template shows ONE example section.
9
+ Repeat that pattern for each unique category in the checks array.
10
+ The six known categories and their display names are:
11
+ global_store -> "Global Store"
12
+ conventions -> "Conventions"
13
+ agent_registration -> "Agent Registration"
14
+ core_files -> "Core Files"
15
+ project_stores -> "Project Stores"
16
+ deprecations -> "Deprecations"
17
+ 4. For each check within a category, emit one line with the status icon
18
+ and the check message. If the check has non-empty details, list them
19
+ as indented sub-items.
20
+ 5. The "Fixable Issues" section should ONLY appear if at least one check
21
+ has fixable=true AND status is not "pass". Omit the entire section
22
+ otherwise.
23
+ 6. Status icons (plain text, no emoji):
24
+ pass -> [PASS]
25
+ warn -> [WARN]
26
+ fail -> [FAIL]
27
+ 7. The overall status icon in the header uses the same mapping.
28
+ 8. After filling, remove all HTML comments -- they are instructions only.
29
+ ======================================================================= -->
30
+
31
+ ## {{overall_status_icon}} Overall: {{status}} -- Plastic v{{version}}
32
+
33
+ Checked at: {{timestamp}}
34
+
35
+ ### Summary
36
+
37
+ {{pass}} passed, {{warn}} warnings, {{fail}} failed -- {{total}} checks total
38
+
39
+ ---
40
+
41
+ <!-- =====================================================================
42
+ CATEGORY SECTIONS
43
+ ======================================================================
44
+ Repeat the block below ONCE PER CATEGORY present in the checks array.
45
+ Group checks by their "category" field. Use the display name mapping
46
+ above for the heading. Within each category, list every check as a
47
+ single line: status icon + message. If a check has non-empty "details",
48
+ list each detail as an indented bullet beneath.
49
+
50
+ Example category section (for agent_registration with two checks):
51
+ ===================================================================== -->
52
+
53
+ ### Agent Registration
54
+
55
+ - [PASS] Claude Code adapter registered
56
+ - [FAIL] 2 hook scripts not executable
57
+ - ~/.claude/hooks/plastic-session-start
58
+ - ~/.claude/hooks/plastic-gate-check
59
+
60
+ <!-- =====================================================================
61
+ Repeat the above pattern for each category found in the checks array.
62
+ Only include categories that have at least one check.
63
+ Order categories as they appear in the checks array.
64
+ ===================================================================== -->
65
+
66
+ ---
67
+
68
+ <!-- =====================================================================
69
+ FIXABLE ISSUES SECTION
70
+ ======================================================================
71
+ Include this section ONLY if one or more checks have fixable=true AND
72
+ status is "warn" or "fail". If no fixable issues exist, omit everything
73
+ from the "Fixable Issues" heading through the end of the horizontal
74
+ rule that follows the table.
75
+
76
+ For each fixable check that is not "pass", emit one table row:
77
+ | status_icon | check_message | fix_hint |
78
+ ===================================================================== -->
79
+
80
+ ### Fixable Issues
81
+
82
+ | Status | Issue | Fix |
83
+ |--------|-------|-----|
84
+ | [FAIL] | 2 hook scripts not executable | chmod +x on the listed files |
85
+
86
+ <!-- =====================================================================
87
+ Repeat one row per fixable non-pass check.
88
+ ===================================================================== -->
89
+
90
+ ---
91
+
92
+ <!-- =====================================================================
93
+ FOOTER -- always include this line exactly as written.
94
+ ===================================================================== -->
95
+
96
+ Run `plastic doctor --fix` to auto-fix all fixable issues, or ask me to fix them now.
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: plastic-evaluating-skills
3
+ description: >
4
+ Evaluate Plastic skills for correctness, convention compliance, and
5
+ progressive disclosure. Use when testing whether a skill produces good
6
+ outputs, verifying convention compliance after changes, running evals
7
+ against skills or instructions, creating evals for a new or updated
8
+ skill, checking if a description triggers correctly, or assessing
9
+ whether a skill is still needed. Also use when the user says "evaluate",
10
+ "test the skill", "run evals", "check conventions", or "write evals".
11
+ ---
12
+
13
+ # Evaluating Skills
14
+
15
+ Eval methodology for Plastic skills, based on
16
+ [agentskills.io](https://agentskills.io/skill-creation/evaluating-skills)
17
+ and [Anthropic's eval guide](https://www.anthropic.com/engineering/demystifying-evals-for-ai-agents).
18
+
19
+ ## Gotchas
20
+
21
+ - Assertions written before observing output are almost always wrong — run
22
+ the eval first, observe actual output, THEN write assertions
23
+ - Near-miss negative test cases are the most valuable — prompts that share
24
+ keywords with should-trigger cases but need a different skill entirely
25
+ - Select the best skill iteration by validation pass rate, not the last one
26
+ - Grade outcomes, not execution paths — if the agent solved the task via an
27
+ unexpected route but produced correct output, that is a pass
28
+ - Same skill can behave differently across agent frameworks — test on each
29
+ target agent (Claude Code, Hermes, OpenClaw, Codex)
30
+
31
+ ## Procedure
32
+
33
+ ### Step 1: Choose eval scope
34
+
35
+ Determine what you are evaluating:
36
+
37
+ - **Description triggering** — does the agent activate the right skill for
38
+ a given prompt? Tests the description field effectiveness.
39
+ - **Output quality** — does the skill produce correct results when activated?
40
+ Tests the skill body and references.
41
+ - **Convention compliance** — does the output follow Plastic conventions?
42
+ Read `references/convention-checks.md` for the full assertion library.
43
+
44
+ Multiple scopes can apply to the same skill. Start with the scope that
45
+ addresses your immediate concern, add others as needed.
46
+
47
+ ### Step 2: Design test cases
48
+
49
+ Create `evals/evals.json` in the skill being evaluated. Copy the starter
50
+ template from `assets/eval-template.json` in this skill.
51
+
52
+ **For description triggering:**
53
+ - Write ~20 queries: 8-10 should-trigger, 8-10 should-not-trigger
54
+ - Split 60/40 into train and validation sets (proportional mix in each)
55
+ - Include near-miss negatives that share keywords but need a different skill
56
+ - In `expected_output`, describe whether the skill should or should not activate
57
+ and why
58
+
59
+ **For output quality:**
60
+ - Start with 2-3 test cases, expand after first results
61
+ - Use realistic user prompts with varied phrasing, detail level, and formality
62
+ - In `expected_output`, describe what correct output looks like — not exact text
63
+ - Use `files` array for any input files the test needs
64
+
65
+ **For convention compliance:**
66
+ - Start with 2-3 test cases targeting specific convention areas
67
+ - In `expected_output`, describe which conventions must be met
68
+ - Read `references/convention-checks.md` for the full assertion library
69
+
70
+ Leave `assertions` arrays empty. They are populated after Step 4.
71
+
72
+ ### Step 3: Run paired evals
73
+
74
+ Dispatch a subagent per test case to ensure clean context — no leakage
75
+ between test runs. Run each case twice:
76
+
77
+ 1. **With skill** — the skill is available and loaded
78
+ 2. **Without skill** — the skill is not available (baseline comparison)
79
+
80
+ The delta between with-skill and without-skill measures what the skill adds.
81
+ If the delta is negligible, the skill may not be adding value for that case.
82
+
83
+ Grade outcomes, not paths. An unexpected tool-call sequence that produces
84
+ correct output is still a pass.
85
+
86
+ ### Step 4: Write assertions after observing
87
+
88
+ Review actual outputs from Step 3. Write specific, verifiable assertions
89
+ based on what you observed — not what you expected beforehand.
90
+
91
+ Choose the grader type that fits each assertion:
92
+ - **Code-based** — structure, file existence, format validity, counts
93
+ - **LLM-as-judge** — quality, completeness, tone, semantic correctness
94
+ - **Human** — edge cases, calibration, judgment calls
95
+
96
+ Read `references/eval-methodology.md` for the full grader taxonomy and
97
+ LLM-judge calibration protocol.
98
+
99
+ Good assertions are specific, verifiable, and countable:
100
+ "Output includes at least 3 concrete recommendations."
101
+
102
+ Weak assertions are vague: "Output is good."
103
+ Brittle assertions use exact phrase matching.
104
+
105
+ Require concrete evidence for PASS. No benefit of the doubt.
106
+
107
+ ### Step 5: Grade and iterate
108
+
109
+ Compute pass rates per test case and aggregate across the eval suite.
110
+
111
+ Track two metrics separately:
112
+ - **pass@k** — succeeded at least once in k trials (capability)
113
+ - **pass^k** — succeeded every time in k trials (reliability)
114
+
115
+ Read `references/eval-methodology.md` for formulas and interpretation.
116
+
117
+ Three signal sources for skill improvement:
118
+ 1. **Failed assertions** — specific gaps in the skill
119
+ 2. **Human feedback** — broader quality issues not captured by assertions
120
+ 3. **Execution transcripts** — reveals WHY things went wrong
121
+
122
+ Feed all three plus the current SKILL.md to propose targeted changes.
123
+ Iterate on the train set only. Check the validation set for generalization.
124
+ 5 iterations is usually enough. If not improving after 5, the test cases
125
+ themselves may be the problem — revisit Step 2.
126
+
127
+ ### Step 6: Graduate and monitor
128
+
129
+ Once a skill hits ~100% on capability evals (pass@k = 1.0 for 3+
130
+ consecutive runs):
131
+
132
+ 1. **Graduate** capability evals into regression tests — run them on every
133
+ skill change to protect against backsliding
134
+ 2. **Monitor** the with/without delta over time — if it shrinks to zero
135
+ across 3+ runs, the model may have internalized the skill
136
+ 3. **Retire** cautiously — archive the skill, do not delete. Re-test after
137
+ model updates in case capabilities regress.
138
+
139
+ Read `references/eval-methodology.md` for graduation criteria, retirement
140
+ detection, and the three-layer eval taxonomy.
@@ -0,0 +1,12 @@
1
+ {
2
+ "skill_name": "",
3
+ "evals": [
4
+ {
5
+ "id": 1,
6
+ "prompt": "",
7
+ "expected_output": "",
8
+ "files": [],
9
+ "assertions": []
10
+ }
11
+ ]
12
+ }