@zalom/plastic 1.0.0-beta.3 → 1.0.0-beta.30

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 (102) hide show
  1. package/PLASTIC.md +293 -7
  2. package/README.md +10 -0
  3. package/agents/plastic-brainstorming.md +2 -2
  4. package/agents/plastic-enforcer.md +17 -2
  5. package/agents/plastic-executor.md +3 -3
  6. package/agents/plastic-future-intent-researcher.md +2 -1
  7. package/agents/plastic-intent-curator.md +15 -7
  8. package/agents/plastic-intent-discovery.md +37 -0
  9. package/agents/plastic-planner.md +2 -2
  10. package/agents/plastic-spec-specialist.md +2 -2
  11. package/hooks/code-gate +10 -1
  12. package/hooks/hooks.json +28 -3
  13. package/hooks/lock-gate +21 -0
  14. package/hooks/retrieval-gate +10 -0
  15. package/hooks/savepoint-pre +10 -0
  16. package/hooks/statusline +150 -41
  17. package/package.json +1 -1
  18. package/scripts/agent-report +21 -0
  19. package/scripts/doctor.rb +404 -5
  20. package/scripts/hook-auto-arm +1 -1
  21. package/scripts/hook-bash-gate +22 -4
  22. package/scripts/hook-code-gate +11 -6
  23. package/scripts/hook-create-gate +45 -9
  24. package/scripts/hook-gate-check +24 -23
  25. package/scripts/hook-lock-gate +83 -0
  26. package/scripts/hook-retrieval-gate +148 -0
  27. package/scripts/hook-savepoint-pre +32 -0
  28. package/scripts/hook-session-start +1 -1
  29. package/scripts/insight-append +51 -0
  30. package/scripts/lib/agent_models.rb +43 -0
  31. package/scripts/lib/bridge.rb +625 -47
  32. package/scripts/lib/frontmatter_writer.rb +130 -0
  33. package/scripts/lib/graph_rebuild.rb +328 -0
  34. package/scripts/lib/hook_registry.rb +95 -0
  35. package/scripts/lib/insights.rb +86 -0
  36. package/scripts/lib/installer_core.rb +64 -54
  37. package/scripts/lib/link_suggestions.rb +319 -0
  38. package/scripts/lib/links_projection.rb +160 -0
  39. package/scripts/lib/links_section.rb +207 -0
  40. package/scripts/lib/lock.rb +375 -0
  41. package/scripts/lib/power_tools.rb +75 -0
  42. package/scripts/lib/qmd_hook.rb +38 -25
  43. package/scripts/lib/qmd_sync.rb +36 -0
  44. package/scripts/lib/retrieval_gate.rb +211 -0
  45. package/scripts/lib/worktree.rb +384 -0
  46. package/scripts/link-suggest +213 -0
  47. package/scripts/new-intent +138 -29
  48. package/scripts/plastic-lock +164 -0
  49. package/scripts/project-links +287 -0
  50. package/scripts/qmd-sync +50 -3
  51. package/scripts/read-config +4 -0
  52. package/scripts/rebuild-graph +244 -0
  53. package/scripts/spawn-preamble +11 -3
  54. package/skills/auto/SKILL.md +98 -16
  55. package/skills/auto/evals/evals.json +48 -0
  56. package/skills/auto/references/agent-architecture.md +7 -4
  57. package/skills/auto/references/agent-report-contract.md +36 -1
  58. package/skills/brainstorming/SKILL.md +1 -0
  59. package/skills/brainstorming/evals/evals.json +22 -0
  60. package/skills/continuing/SKILL.md +30 -8
  61. package/skills/continuing/evals/evals.json +9 -0
  62. package/skills/creating-intent/SKILL.md +16 -2
  63. package/skills/creating-intent/evals/evals.json +16 -0
  64. package/skills/creating-intent/references/lifecycle.md +9 -4
  65. package/skills/creating-skills/SKILL.md +65 -0
  66. package/skills/creating-skills/evals/evals.json +108 -0
  67. package/skills/creating-skills/references/agents.md +168 -0
  68. package/skills/creating-skills/references/evals.md +41 -0
  69. package/skills/creating-skills/references/hooks.md +248 -0
  70. package/skills/creating-skills/references/progressive-disclosure.md +176 -0
  71. package/skills/creating-skills/references/scripts.md +166 -0
  72. package/skills/creating-skills/references/skills.md +165 -0
  73. package/skills/creating-skills/scripts/scaffold.rb +313 -0
  74. package/skills/dashboard/SKILL.md +5 -0
  75. package/skills/dashboard/evals/evals.json +22 -0
  76. package/skills/doctor/SKILL.md +4 -1
  77. package/skills/executing-plan/SKILL.md +4 -4
  78. package/skills/humanizer/SKILL.md +39 -0
  79. package/skills/humanizer/evals/evals.json +70 -0
  80. package/skills/humanizer/references/always-on-snippet.md +9 -0
  81. package/skills/humanizer/references/examples.md +48 -0
  82. package/skills/intent-curator/SKILL.md +7 -1
  83. package/skills/intent-curator/evals/evals.json +22 -0
  84. package/skills/intent-discovery/SKILL.md +46 -0
  85. package/skills/intent-starting/SKILL.md +127 -0
  86. package/skills/intent-starting/evals/evals.json +117 -0
  87. package/skills/intent-starting/references/boarding-matrix.md +35 -0
  88. package/skills/linking-intents/SKILL.md +54 -12
  89. package/skills/linking-intents/evals/evals.json +22 -0
  90. package/skills/linking-intents/references/zettelkasten.md +7 -0
  91. package/skills/lock/SKILL.md +41 -0
  92. package/skills/managing-index/SKILL.md +12 -0
  93. package/skills/managing-index/evals/evals.json +22 -0
  94. package/skills/managing-index/references/zettelkasten-linking.md +6 -1
  95. package/skills/releasing/SKILL.md +32 -0
  96. package/skills/research/SKILL.md +8 -0
  97. package/skills/research/evals/evals.json +22 -0
  98. package/templates/config.yml +8 -0
  99. package/templates/outcome.md +3 -0
  100. package/templates/revisions.md +58 -0
  101. package/skills/writing-instructions/SKILL.md +0 -159
  102. package/skills/writing-instructions/references/agentskills-spec.md +0 -135
@@ -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) — wikilinks in `## Links` section
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
@@ -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
+ }
@@ -11,3 +11,11 @@ agent:
11
11
  parallel_mode: linear
12
12
  architect:
13
13
  style:
14
+
15
+ # Per-agent model override (intent 116). Uncomment and set to a Claude Code
16
+ # alias (opus, sonnet, haiku) to override the shipped tier for one agent. With
17
+ # no entry, the shipped default applies. Never resolves to Fable.
18
+ # agents:
19
+ # models:
20
+ # plastic-executor: sonnet
21
+ # plastic-enforcer: opus
@@ -1,3 +1,6 @@
1
+ ---
2
+ disposition: delivered|abandoned
3
+ ---
1
4
  # Outcome: <intent name>
2
5
 
3
6
  ## Summary
@@ -0,0 +1,58 @@
1
+ # revisions.md
2
+
3
+ <!--
4
+ FORM reference. A live revisions.md exists in an intent directory ONLY when structural
5
+ maintenance actually happened. It is never scaffolded at intent birth, it carries no
6
+ placeholder sentinel, and its mere presence signals that this intent underwent structural
7
+ (not conceptual) change.
8
+
9
+ Rules:
10
+ - Append-only. Newest entry at the BOTTOM. Never edit or reorder past entries.
11
+ - One entry per relocated item (one section, one file, or one ref per entry).
12
+ - Move-and-record: remove the misplaced thing from its artifact and preserve it IN FULL
13
+ here. Never rewrite, summarize, or reinterpret delivered meaning. A change to delivered
14
+ meaning is a new intent, not a revision.
15
+ - Header form: "## Revision vN - YYYY-MM-DD-HH:MM" (N increments by one per entry).
16
+
17
+ Fields:
18
+ - Why: one sentence naming the broken rule, ending with "[rule: <tag>]".
19
+ - Prior location: the artifact plus the section or path the content came from.
20
+ - Content held: the verbatim removed content, as an indented block (block form), OR
21
+ - Change: a one-line "removed X (before: ... -> after: ...)" for a frontmatter
22
+ edit, used instead of a Content held block.
23
+
24
+ Stray file: embed the file's full content as the Content held block and delete the
25
+ original; Prior location names the filename. revisions.md is the single container.
26
+
27
+ Violation-tag catalog (starter set; free-text tags are allowed):
28
+ - unsanctioned-section : a top-level section the sanctioned-section rule now rejects
29
+ - phantom-section : a section referenced but not present or not sanctioned
30
+ - stray-file : a file that does not belong in the intent directory
31
+ - dangling-ref : a link or reference to something that no longer exists
32
+ - broken-chain : a chain frontmatter edge to an intent that no longer exists
33
+ - broken-source : a sources frontmatter edge to an intent that no longer exists
34
+ - misplaced-content : content that belongs in a different artifact or section
35
+
36
+ The examples below show the three variants. Delete them when you write the first real
37
+ entry; keep the "# revisions.md" title line above.
38
+ -->
39
+
40
+ ## Revision v1 - 2026-06-30-14:35
41
+ - Why: unsanctioned top-level section left over from an early draft [rule: unsanctioned-section]
42
+ - Prior location: intent.md - ## Scope
43
+ - Content held:
44
+
45
+ ## Scope
46
+ <the full content that was removed, verbatim>
47
+
48
+ ## Revision v2 - 2026-06-30-15:02
49
+ - Why: chain edge to an intent that no longer exists [rule: broken-chain]
50
+ - Prior location: intent.md frontmatter - chain
51
+ - Change: removed "99x" (before: ["4a1a", "99x"] -> after: ["4a1a"])
52
+
53
+ ## Revision v3 - 2026-06-30-15:20
54
+ - Why: a stray notes file that does not belong in the intent directory [rule: stray-file]
55
+ - Prior location: notes-old.md
56
+ - Content held:
57
+
58
+ <the full content of notes-old.md, verbatim; the original file is then deleted>
@@ -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
@@ -1,135 +0,0 @@
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