Agent Skills
Use this skill to create or modernize skill bundles without conflating the portable core contract with runtime-specific extensions.
Scope — this is a delta on the standard, not a replacement. Generic skill authoring, scaffolding, and eval mechanics are owned by the Agent Skills open spec and the standard skill-creator skill (and plugin-dev:skill-development). Use those for boilerplate. This skill owns only the repo-specific delta the standard cannot provide: dual-runtime portability (Claude Code + Codex), catalog/graph gating, and router/composition patterns. Do not replicate the standard here — link to it.
Quick Reference
| Task |
Read or Run |
Outcome |
| Scaffold a new skill |
skill-creator (standard skill) |
Generates the boilerplate; then apply portability discipline from references/frontmatter-reference.md |
| Modernize an existing skill |
python3 scripts/validate_skill.py <skill-dir> |
Finds contract drift, broken links, stale sources, and missing TOCs |
| Add runtime-specific metadata |
references/frontmatter-reference.md |
Scopes extensions to the target runtime instead of treating them as universal |
| Decide how to split content |
references/skill-patterns.md |
Keeps SKILL.md small and moves detail into references/ or scripts/ |
| Validate behavior, not just syntax |
references/skill-validation.md |
Builds trigger, non-trigger, and navigation evals |
| Check Anthropic-specific details |
references/anthropic-skills-guide.md |
Uses Anthropic guidance without treating it as the portable baseline |
| Ship one skill to multiple runtimes without drift |
references/dual-distribution.md |
Single canonical system prompt + wrapper distributions + drift-check gate |
| Design router/composable skill flow |
references/skill-patterns.md#pattern-10-stage-based-selection-pipeline |
Separates sources, enrichment, filters, scoring, selection, validation, and side effects |
Core Contract
Portable baseline:
skill-name/SKILL.md is required.
name and description are the portable required frontmatter fields.
license, compatibility, and metadata are portable optional fields in the open spec.
allowed-tools is part of the open spec, but implementation support may vary by runtime.
references/, scripts/, assets/, and data/sources.json are optional support directories.
- Keep the main skill body focused on workflow and navigation; move long detail into support files.
Runtime extensions:
- Treat fields such as
argument-hint, arguments, disable-model-invocation, user-invocable, when_to_use, context, agent, model, effort, hooks, paths, shell, and disallowed-tools as runtime-specific until verified in that runtime's current official docs.
- In Anthropic runtimes, also verify invocation semantics and substitutions before copying examples:
user-invocable, disable-model-invocation, $ARGUMENTS, $name (from arguments), ${CLAUDE_SESSION_ID}, ${CLAUDE_EFFORT}, ${CLAUDE_SKILL_DIR}, and ${CLAUDE_PROJECT_DIR} are not portable assumptions.
- If you use runtime-specific fields, add a scoped
compatibility note naming the target runtime.
- A skill that uses runtime-specific headers (
argument-hint, arguments, disable-model-invocation, context, agent, model, effort, hooks, paths, shell, disallowed-tools) is runtime-scoped: add a compatibility note naming the target runtime and remove any claim of portability.
- Even portable-baseline fields carry a nuance worth catching: the open spec requires
name and description, but Claude Code alone treats every frontmatter field (including those two) as optional and falls back to the directory name for display. Keep setting both explicitly — the portable contract is stricter than any single runtime's tolerance.
Repo-local Codex metadata:
- Treat
agents/openai.yaml as harness-facing config read natively by current Codex CLI (0.149.x), not as part of the portable core — SKILL.md must stay valid without it. Its policy.allow_implicit_invocation: false keeps explicit-only skills out of the per-session skills listing; see references/frontmatter-reference.md §"Repo-Local Codex Notes".
- Keep
SKILL.md description trigger-rich and portable.
- Keep
agents/openai.yaml short_description brief enough for UI surfaces.
- Keep
agents/openai.yaml default_prompt focused on when Codex should load the skill.
- Revalidate semantic alignment when the skill intent changes; do not require exact string equality between these fields.
Authoring Modes
Shared skills in this repo should default to a functional reference style:
- matter-of-fact
- outcome-oriented
- explicit about inputs, outputs, and navigation
- light on persona, coaching voice, or motivational framing
That is the safest portable baseline across runtimes, especially for Codex-style skill loading.
Some runtimes also benefit from a problem-approach overlay:
- how to think about the task
- ambiguity-handling rules
- coaching or teaching tone
- richer behavioral framing
Use that style only in runtime-specific layers, references, or scoped extensions. Do not let the portable core become a blend of incompatible authoring philosophies.
Workflow
- Start with 2-3 concrete user tasks and write the evals first.
- Draft the portable core: folder name,
SKILL.md, name, description, and minimal instructions.
- Keep the portable core functional and reference-like unless the runtime explicitly benefits from a richer overlay.
- Add runtime-specific metadata only after choosing the target runtime.
- Put reusable detail in
references/, deterministic helpers in scripts/, and output templates in assets/.
- Run static validation before review: links, frontmatter, TOCs, and
sources.json.
- Run behavioral evals: trigger, non-trigger, navigation, and runtime-specific checks.
- Observe real usage and iterate based on under-triggering, over-triggering, or poor file navigation.
- For engineering and debugging-oriented skills, explicitly require verification of known bugs, regressions, framework/compiler/runtime footguns, and version-specific crash or workaround guidance against current primary web sources before treating them as current fact.
- For routers, teams, and composable skills, model the workflow as a stage-based selection pipeline: gather candidates, enrich them, filter ineligible options with reasons, score remaining options independently, select the smallest correct output, run post-selection validation, then keep learning/eval updates as side effects.
- When discovery / routing structure changes, regenerate
frameworks/shared-skills/graph/ via scripts/graph-export.py and refresh audit-baseline.json; do not shorten full SKILL.md bodies to fit discovery budgets.
Typical Scenarios
Each row maps a real request to the smallest correct action. Pick the row, load only what it names.
| Scenario |
First action |
Then |
Done when |
| Create a new portable skill |
Copy Minimal Template above; set name + trigger-rich description |
Write 2-3 evals (references/skill-validation.md), then split detail into references/ |
Validator passes and a trigger eval fires on real user language |
| Audit / modernize an existing skill |
python3 scripts/validate_skill.py <skill-dir> |
Fix contract drift, broken links, stale sources.json; re-verify field semantics against live docs |
0 errors and no unscoped runtime field alongside a portability claim |
| Skill must use Claude-only fields |
Add the field (disable-model-invocation, paths, context: fork, agent, shell) |
Add a compatibility note naming the runtime; drop any portability claim |
Field appears only inside a runtime-scoped layer |
Turn a reference skill into a /command workflow |
Set disable-model-invocation: true + use $ARGUMENTS in the body |
Keep the body as the task prompt (see Invocation Control) |
/name arg runs the procedure; model no longer auto-triggers it |
| Ship one skill to Claude Code and Codex |
Keep portable core canonical; mirror intent into agents/openai.yaml |
Run drift gate from references/dual-distribution.md |
Both surfaces describe the same intent; no field copied across runtimes unverified |
| Build a router / composable skill |
Model it as Pattern 10 (stage-based selection pipeline) |
Keep sources → hydrators → filters → scorers → selector → validation → side effects separate |
Every dropped candidate has a named filter reason; selection is traceable |
SKILL.md grew past ~500 lines |
Apply progressive disclosure (references/skill-patterns.md) |
Move reference detail to references/, helpers to scripts/, templates to assets/; wire each into Navigation |
Body is navigation-first; no orphan support files |
| Skill under-triggers or over-triggers |
Rewrite description per Description Rules (what + when + real trigger words) |
Add a non-trigger eval for the over-fire case |
Trigger and non-trigger evals both pass |
| Discovery / routing structure changed |
Regenerate frameworks/shared-skills/graph/ via scripts/graph-export.py |
Refresh audit-baseline.json; do not shrink full bodies to fit budgets |
audit-coverage.py --check passes |
| Skill needs cross-session state |
Use Pattern 7; store under ${CLAUDE_PLUGIN_DATA}/ |
Degrade gracefully when state is missing; never store secrets |
First run works with no state present |
If a request matches no row, treat it as "create" or "audit" and fall back to the Workflow section.
ASCII Flow
Skill change request
-> Define 2-3 real trigger tasks
-> Draft portable core: folder, SKILL.md, name, description
-> Split support material
+-- reference detail -> references/
+-- deterministic helper -> scripts/
+-- templates/assets -> assets/
-> Add runtime metadata only in scoped layers
-> Validate structure, links, sources, and behavior
-> Update catalog when names, counts, or router ownership change
Known Traps
- claiming a skill is portable while relying on runtime-only fields, substitutions, or invocation semantics
- packing reference material, examples, and policy prose into
SKILL.md instead of progressive disclosure files
- over-constraining strong models with dense rule lists where a judgment statement suffices — Claude 5-gen models perform as well with ~80% less always-loaded instruction text; reserve hard ALWAYS/NEVER rules for observed failure modes and safety-critical steps (Anthropic context-engineering guidance, 2026-07-24; see
data/sources.json)
- writing descriptions that sound broad but fail to trigger on the real user language
- keeping
data/sources.json present but stale, secondary-only, or disconnected from the actual workflow
- copying frontmatter or examples from one runtime into another without re-verifying current official docs
- letting enrichment steps silently remove candidate skills, routes, or evidence instead of using a named filter with an explicit reason
- choosing between adjacent skills before each candidate has been evaluated independently against the user request
Common Anti-Patterns
- universal "do everything" skills with no bounded task shape
- runtime-specific metadata treated as the portable baseline
- support directories (
references/, scripts/, assets/) created but not wired into navigation
- validation limited to syntax and broken links, with no trigger/non-trigger behavior checks
- source lists that encode rankings, prices, or volatile product claims as durable truth
- routing by keyword pile-up instead of a stage contract with eligibility filters, independent scoring, post-selection validation, and traceable side effects
- solving runtime discovery budget by deleting useful workflow context from mature skills instead of adding a compact generated discovery layer
Description Rules (repo delta)
Generic description craft — third person, what + when, trigger words, single-line YAML, <1024 chars, good/bad examples — is owned by the open spec and skill-creator. Do not re-derive it here. This repo adds one rule on top:
- Keep descriptions inside shared discovery budgets: roughly 120-180 characters and about 25 words, unless the target runtime's docs require otherwise. Over-long descriptions inflate the always-loaded discovery layer for every other skill.
Scaffolding
Do not hand-author boilerplate. For a fresh SKILL.md skeleton (frontmatter, Quick Reference, Workflow, Navigation), invoke the standard skill-creator skill, then apply this skill's portability discipline before handoff:
- Add
compatibility: Portable core only. Add runtime-specific notes if extensions are used. unless the skill is deliberately runtime-scoped.
- Wire every
references/, scripts/, and assets/ file into Navigation.
- If targeting Codex too, add the
agents/openai.yaml adjunct (see Core Contract).
Invocation Control (runtime-specific)
Field mechanics — disable-model-invocation, user-invocable, paths, argument-hint, context: fork / agent, $ARGUMENTS — are Claude Code features. The when-to-disable decision and field semantics live in the Claude Code skills docs, references/frontmatter-reference.md, and skill-creator. Do not duplicate them here. The repo-specific rules:
- These fields are runtime-scoped, not portable. A skill that uses any of them must carry a
compatibility note and drop any portability claim.
- Side-effecting workflows (deploy, production writes, sends) should set
disable-model-invocation: true so the model cannot auto-trigger them.
Runtime Portability
disable-model-invocation, user-invocable, paths, disallowed-tools, and when_to_use are Claude Code fields. For Codex, the equivalent behavior comes from how you register the skill in the runtime layer. Keep the flag in the Claude frontmatter and document the Codex equivalent in a compatibility note if you're targeting both runtimes.
Compatibility Rules
| Target |
Safe assumptions |
What to verify separately |
| Portable core |
name, description, optional license / compatibility / metadata, SKILL.md, support folders |
Runtime-specific fields and any implementation-specific behavior |
| Anthropic / Claude Code |
Portable core plus: argument-hint, arguments, disable-model-invocation, user-invocable, when_to_use, allowed-tools, disallowed-tools, model, effort, context, agent, hooks, paths, shell |
Exact field semantics, hook behavior, model controls, UI behavior; verify each in current Claude Code docs |
| VS Code |
Portable core and VS Code's documented skill packaging |
Any metadata beyond the official VS Code docs |
| Codex in this repo |
Portable core; adjunct metadata may live outside frontmatter |
Repo-local conventions such as agents/openai.yaml when present |
Rules of thumb:
- Keep the portable example clean. Do not mix Anthropic-only fields into the default example.
- Keep the portable voice functional. If the target runtime wants more coaching or framing, add it in a scoped layer rather than inflating the shared core.
- If a field is not confirmed by current official docs for the target runtime, label it as repo-local or provisional.
- When supporting multiple runtimes, document the shared core first and the extensions second.
Support Files
When to split:
- Put reference material, decision trees, and variant-specific guidance in
references/.
- Put deterministic helpers, validators, and generators in
scripts/.
- Put templates, boilerplate, and artifacts used in final output in
assets/.
- Keep
SKILL.md under 500 lines and bias toward navigation over duplication.
Validation Defaults
Run the validator before handoff:
python3 scripts/validate_skill.py .
python3 scripts/test_validate_skill.py
python3 scripts/validate_catalog.py /path/to/skills/root
python3 scripts/audit_skill_metadata.py /path/to/skills/root
python3 scripts/build_skill_graph.py /path/to/skills/root --check
What the validator checks:
SKILL.md exists and has valid portable frontmatter
- canonical core sections are present (
Quick Reference, workflow, Navigation, Fact-Checking)
- folder name matches
name
- runtime-specific fields do not appear alongside unscoped portability claims
- markdown links resolve locally
- long reference files include a table of contents
data/sources.json is valid and fresh enough to trust
- project and domain skills do not cross-link
- exact duplicate registry triggers are either removed or explicitly disambiguated
- registry skill references resolve to real skill directories (gated by
scripts/audit-coverage.py --check)
- metadata and Codex UI descriptions stay within local budget targets
- graph edges in
metadata.graph resolve to real skill directories when graph metadata is present
Behavioral checks still require human review. Use references/skill-validation.md for the eval matrix.
Pilot benchmark commands:
# Deterministic harness check
python3 frameworks/shared-skills/evals/test_run_skill_bench.py
# Live Codex-backed pilot benchmark
python3 frameworks/shared-skills/evals/run_skill_bench.py \
frameworks/shared-skills/evals/tasks/pilot-router-and-long-skills.json \
--adapter codex \
--repo-root . \
--output frameworks/shared-skills/evals/outputs/pilot-router-and-long-skills-codex-YYYY-MM-DD.jsonl
Store benchmark runs as JSONL artifacts in frameworks/shared-skills/evals/outputs/. Do not create standalone Markdown run summaries unless explicitly requested.
Navigation
Resources:
- references/frontmatter-reference.md - Portable core and runtime-specific header guidance
- references/skill-patterns.md - Patterns for splitting, scripting, and compatibility scoping
- references/skill-validation.md - Static checks plus behavioral evals
- references/anthropic-skills-guide.md - Anthropic-specific reference
- references/skill-vs-agent-decision.md - Decision matrix: when to write a skill vs a subagent vs both
- data/sources.json - Official sources to verify against
Scripts:
scripts/validate_skill.py
scripts/validate_catalog.py
scripts/audit_skill_metadata.py
scripts/build_skill_graph.py
scripts/test_validate_skill.py
Standard skills to defer to (not in this repo; invoke via the Skill tool):
skill-creator - Scaffold, modify, and benchmark/eval skills (generic authoring mechanics)
plugin-dev:skill-development - Authoring skills inside plugins
- Agent Skills open spec: https://agentskills.io/specification - Portable frontmatter and structure baseline
Related skills:
Repo-local note:
- If this repo also carries Codex system skills, check
.codex/skills/.system/skill-creator/SKILL.md locally. Do not treat that path as portable.
Fact-Checking
- Known bugs, regressions, framework/compiler/runtime footguns, and version-specific crash or workaround guidance must be verified against current primary web sources before being treated as current fact.
- Verify current external facts, field semantics, runtime limits, and packaging behavior before final answers.
- Prefer primary sources and label runtime-specific guidance with platform and date when it may drift.
- If web access is unavailable, state the limitation and mark any runtime-specific claim as unverified.
Learnings Loop
Before applying this skill on a non-trivial task, read learnings.consolidated.md in this directory (and learnings.md if present).
After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to learnings.md via agents-skills-feedback-loop/scripts/append_learning.py. Do not modify SKILL.md itself.
1---
2name: agents-skills
3description: Creates and audits agent skills with SKILL.md, references, scripts, and platform-scoped metadata. Use when creating, updating, or validating shared skills.
4version: "1.1"
5last_validated: 2026-08-15
6---
7
8# Agent Skills
9
10Use this skill to create or modernize skill bundles without conflating the portable core contract with runtime-specific extensions.
11
12> **Scope — this is a delta on the standard, not a replacement.** Generic skill authoring, scaffolding, and eval mechanics are owned by the [Agent Skills open spec](https://agentskills.io/specification) and the standard `skill-creator` skill (and `plugin-dev:skill-development`). Use those for boilerplate. This skill owns only the repo-specific delta the standard cannot provide: dual-runtime portability (Claude Code + Codex), catalog/graph gating, and router/composition patterns. Do not replicate the standard here — link to it.
13
14## Quick Reference
15
16| Task | Read or Run | Outcome |
17|------|-------------|---------|
18| Scaffold a new skill | `skill-creator` (standard skill) | Generates the boilerplate; then apply portability discipline from `references/frontmatter-reference.md` |
19| Modernize an existing skill | `python3 scripts/validate_skill.py <skill-dir>` | Finds contract drift, broken links, stale sources, and missing TOCs |
20| Add runtime-specific metadata | `references/frontmatter-reference.md` | Scopes extensions to the target runtime instead of treating them as universal |
21| Decide how to split content | `references/skill-patterns.md` | Keeps `SKILL.md` small and moves detail into `references/` or `scripts/` |
22| Validate behavior, not just syntax | `references/skill-validation.md` | Builds trigger, non-trigger, and navigation evals |
23| Check Anthropic-specific details | `references/anthropic-skills-guide.md` | Uses Anthropic guidance without treating it as the portable baseline |
24| Ship one skill to multiple runtimes without drift | `references/dual-distribution.md` | Single canonical system prompt + wrapper distributions + drift-check gate |
25| Design router/composable skill flow | `references/skill-patterns.md#pattern-10-stage-based-selection-pipeline` | Separates sources, enrichment, filters, scoring, selection, validation, and side effects |
26
27## Core Contract
28
29Portable baseline:
30
31- `skill-name/SKILL.md` is required.
32- `name` and `description` are the portable required frontmatter fields.
33- `license`, `compatibility`, and `metadata` are portable optional fields in the open spec.
34- `allowed-tools` is part of the open spec, but implementation support may vary by runtime.
35- `references/`, `scripts/`, `assets/`, and `data/sources.json` are optional support directories.
36- Keep the main skill body focused on workflow and navigation; move long detail into support files.
37
38Runtime extensions:
39
40- Treat fields such as `argument-hint`, `arguments`, `disable-model-invocation`, `user-invocable`, `when_to_use`, `context`, `agent`, `model`, `effort`, `hooks`, `paths`, `shell`, and `disallowed-tools` as runtime-specific until verified in that runtime's current official docs.
41- In Anthropic runtimes, also verify invocation semantics and substitutions before copying examples: `user-invocable`, `disable-model-invocation`, `$ARGUMENTS`, `$name` (from `arguments`), `${CLAUDE_SESSION_ID}`, `${CLAUDE_EFFORT}`, `${CLAUDE_SKILL_DIR}`, and `${CLAUDE_PROJECT_DIR}` are not portable assumptions.
42- If you use runtime-specific fields, add a scoped `compatibility` note naming the target runtime.
43- A skill that uses runtime-specific headers (`argument-hint`, `arguments`, `disable-model-invocation`, `context`, `agent`, `model`, `effort`, `hooks`, `paths`, `shell`, `disallowed-tools`) is runtime-scoped: add a `compatibility` note naming the target runtime and remove any claim of portability.
44- Even portable-baseline fields carry a nuance worth catching: the open spec requires `name` and `description`, but Claude Code alone treats every frontmatter field (including those two) as optional and falls back to the directory name for display. Keep setting both explicitly — the portable contract is stricter than any single runtime's tolerance.
45
46Repo-local Codex metadata:
47
48- Treat `agents/openai.yaml` as harness-facing config read natively by current Codex CLI (0.149.x), not as part of the portable core — `SKILL.md` must stay valid without it. Its `policy.allow_implicit_invocation: false` keeps explicit-only skills out of the per-session skills listing; see [references/frontmatter-reference.md](references/frontmatter-reference.md) §"Repo-Local Codex Notes".
49- Keep `SKILL.md` `description` trigger-rich and portable.
50- Keep `agents/openai.yaml` `short_description` brief enough for UI surfaces.
51- Keep `agents/openai.yaml` `default_prompt` focused on when Codex should load the skill.
52- Revalidate semantic alignment when the skill intent changes; do not require exact string equality between these fields.
53
54## Authoring Modes
55
56Shared skills in this repo should default to a **functional reference** style:
57
58- matter-of-fact
59- outcome-oriented
60- explicit about inputs, outputs, and navigation
61- light on persona, coaching voice, or motivational framing
62
63That is the safest portable baseline across runtimes, especially for Codex-style skill loading.
64
65Some runtimes also benefit from a **problem-approach overlay**:
66
67- how to think about the task
68- ambiguity-handling rules
69- coaching or teaching tone
70- richer behavioral framing
71
72Use that style only in runtime-specific layers, references, or scoped extensions. Do not let the portable core become a blend of incompatible authoring philosophies.
73
74## Workflow
75
761. Start with 2-3 concrete user tasks and write the evals first.
772. Draft the portable core: folder name, `SKILL.md`, `name`, `description`, and minimal instructions.
783. Keep the portable core functional and reference-like unless the runtime explicitly benefits from a richer overlay.
794. Add runtime-specific metadata only after choosing the target runtime.
805. Put reusable detail in `references/`, deterministic helpers in `scripts/`, and output templates in `assets/`.
816. Run static validation before review: links, frontmatter, TOCs, and `sources.json`.
827. Run behavioral evals: trigger, non-trigger, navigation, and runtime-specific checks.
838. Observe real usage and iterate based on under-triggering, over-triggering, or poor file navigation.
849. For engineering and debugging-oriented skills, explicitly require verification of known bugs, regressions, framework/compiler/runtime footguns, and version-specific crash or workaround guidance against current primary web sources before treating them as current fact.
8510. For routers, teams, and composable skills, model the workflow as a stage-based selection pipeline: gather candidates, enrich them, filter ineligible options with reasons, score remaining options independently, select the smallest correct output, run post-selection validation, then keep learning/eval updates as side effects.
8611. When discovery / routing structure changes, regenerate `frameworks/shared-skills/graph/` via `scripts/graph-export.py` and refresh `audit-baseline.json`; do not shorten full `SKILL.md` bodies to fit discovery budgets.
87
88## Typical Scenarios
89
90Each row maps a real request to the smallest correct action. Pick the row, load only what it names.
91
92| Scenario | First action | Then | Done when |
93|----------|-------------|------|-----------|
94| Create a new portable skill | Copy `Minimal Template` above; set `name` + trigger-rich `description` | Write 2-3 evals (`references/skill-validation.md`), then split detail into `references/` | Validator passes and a trigger eval fires on real user language |
95| Audit / modernize an existing skill | `python3 scripts/validate_skill.py <skill-dir>` | Fix contract drift, broken links, stale `sources.json`; re-verify field semantics against live docs | 0 errors and no unscoped runtime field alongside a portability claim |
96| Skill must use Claude-only fields | Add the field (`disable-model-invocation`, `paths`, `context: fork`, `agent`, `shell`) | Add a `compatibility` note naming the runtime; drop any portability claim | Field appears only inside a runtime-scoped layer |
97| Turn a reference skill into a `/command` workflow | Set `disable-model-invocation: true` + use `$ARGUMENTS` in the body | Keep the body as the task prompt (see `Invocation Control`) | `/name arg` runs the procedure; model no longer auto-triggers it |
98| Ship one skill to Claude Code **and** Codex | Keep portable core canonical; mirror intent into `agents/openai.yaml` | Run drift gate from `references/dual-distribution.md` | Both surfaces describe the same intent; no field copied across runtimes unverified |
99| Build a router / composable skill | Model it as Pattern 10 (stage-based selection pipeline) | Keep sources → hydrators → filters → scorers → selector → validation → side effects separate | Every dropped candidate has a named filter reason; selection is traceable |
100| `SKILL.md` grew past ~500 lines | Apply progressive disclosure (`references/skill-patterns.md`) | Move reference detail to `references/`, helpers to `scripts/`, templates to `assets/`; wire each into Navigation | Body is navigation-first; no orphan support files |
101| Skill under-triggers or over-triggers | Rewrite `description` per `Description Rules` (what + when + real trigger words) | Add a non-trigger eval for the over-fire case | Trigger and non-trigger evals both pass |
102| Discovery / routing structure changed | Regenerate `frameworks/shared-skills/graph/` via `scripts/graph-export.py` | Refresh `audit-baseline.json`; do not shrink full bodies to fit budgets | `audit-coverage.py --check` passes |
103| Skill needs cross-session state | Use Pattern 7; store under `${CLAUDE_PLUGIN_DATA}/` | Degrade gracefully when state is missing; never store secrets | First run works with no state present |
104
105If a request matches no row, treat it as "create" or "audit" and fall back to the `Workflow` section.
106
107## ASCII Flow
108
109```text
110Skill change request
111 -> Define 2-3 real trigger tasks
112 -> Draft portable core: folder, SKILL.md, name, description
113 -> Split support material
114 +-- reference detail -> references/
115 +-- deterministic helper -> scripts/
116 +-- templates/assets -> assets/
117 -> Add runtime metadata only in scoped layers
118 -> Validate structure, links, sources, and behavior
119 -> Update catalog when names, counts, or router ownership change
120```
121
122## Known Traps
123
124- claiming a skill is portable while relying on runtime-only fields, substitutions, or invocation semantics
125- packing reference material, examples, and policy prose into `SKILL.md` instead of progressive disclosure files
126- over-constraining strong models with dense rule lists where a judgment statement suffices — Claude 5-gen models perform as well with ~80% less always-loaded instruction text; reserve hard ALWAYS/NEVER rules for observed failure modes and safety-critical steps (Anthropic context-engineering guidance, 2026-07-24; see `data/sources.json`)
127- writing descriptions that sound broad but fail to trigger on the real user language
128- keeping `data/sources.json` present but stale, secondary-only, or disconnected from the actual workflow
129- copying frontmatter or examples from one runtime into another without re-verifying current official docs
130- letting enrichment steps silently remove candidate skills, routes, or evidence instead of using a named filter with an explicit reason
131- choosing between adjacent skills before each candidate has been evaluated independently against the user request
132
133## Common Anti-Patterns
134
135- universal "do everything" skills with no bounded task shape
136- runtime-specific metadata treated as the portable baseline
137- support directories (`references/`, `scripts/`, `assets/`) created but not wired into navigation
138- validation limited to syntax and broken links, with no trigger/non-trigger behavior checks
139- source lists that encode rankings, prices, or volatile product claims as durable truth
140- routing by keyword pile-up instead of a stage contract with eligibility filters, independent scoring, post-selection validation, and traceable side effects
141- solving runtime discovery budget by deleting useful workflow context from mature skills instead of adding a compact generated discovery layer
142
143## Description Rules (repo delta)
144
145Generic description craft — third person, what + when, trigger words, single-line YAML, `<1024` chars, good/bad examples — is owned by the open spec and `skill-creator`. Do not re-derive it here. This repo adds one rule on top:
146
147- Keep descriptions inside shared discovery budgets: roughly 120-180 characters and about 25 words, unless the target runtime's docs require otherwise. Over-long descriptions inflate the always-loaded discovery layer for every other skill.
148
149## Scaffolding
150
151Do not hand-author boilerplate. For a fresh `SKILL.md` skeleton (frontmatter, Quick Reference, Workflow, Navigation), invoke the standard `skill-creator` skill, then apply this skill's portability discipline before handoff:
152
153- Add `compatibility: Portable core only. Add runtime-specific notes if extensions are used.` unless the skill is deliberately runtime-scoped.
154- Wire every `references/`, `scripts/`, and `assets/` file into Navigation.
155- If targeting Codex too, add the `agents/openai.yaml` adjunct (see Core Contract).
156
157## Invocation Control (runtime-specific)
158
159Field mechanics — `disable-model-invocation`, `user-invocable`, `paths`, `argument-hint`, `context: fork` / `agent`, `$ARGUMENTS` — are Claude Code features. The when-to-disable decision and field semantics live in the Claude Code skills docs, `references/frontmatter-reference.md`, and `skill-creator`. Do not duplicate them here. The repo-specific rules:
160
161- These fields are **runtime-scoped, not portable.** A skill that uses any of them must carry a `compatibility` note and drop any portability claim.
162- Side-effecting workflows (deploy, production writes, sends) should set `disable-model-invocation: true` so the model cannot auto-trigger them.
163
164### Runtime Portability
165
166`disable-model-invocation`, `user-invocable`, `paths`, `disallowed-tools`, and `when_to_use` are Claude Code fields. For Codex, the equivalent behavior comes from how you register the skill in the runtime layer. Keep the flag in the Claude frontmatter and document the Codex equivalent in a compatibility note if you're targeting both runtimes.
167
168## Compatibility Rules
169
170| Target | Safe assumptions | What to verify separately |
171|--------|------------------|---------------------------|
172| Portable core | `name`, `description`, optional `license` / `compatibility` / `metadata`, `SKILL.md`, support folders | Runtime-specific fields and any implementation-specific behavior |
173| Anthropic / Claude Code | Portable core plus: `argument-hint`, `arguments`, `disable-model-invocation`, `user-invocable`, `when_to_use`, `allowed-tools`, `disallowed-tools`, `model`, `effort`, `context`, `agent`, `hooks`, `paths`, `shell` | Exact field semantics, hook behavior, model controls, UI behavior; verify each in current Claude Code docs |
174| VS Code | Portable core and VS Code's documented skill packaging | Any metadata beyond the official VS Code docs |
175| Codex in this repo | Portable core; adjunct metadata may live outside frontmatter | Repo-local conventions such as `agents/openai.yaml` when present |
176
177Rules of thumb:
178
179- Keep the portable example clean. Do not mix Anthropic-only fields into the default example.
180- Keep the portable voice functional. If the target runtime wants more coaching or framing, add it in a scoped layer rather than inflating the shared core.
181- If a field is not confirmed by current official docs for the target runtime, label it as repo-local or provisional.
182- When supporting multiple runtimes, document the shared core first and the extensions second.
183
184## Support Files
185
186When to split:
187
188- Put reference material, decision trees, and variant-specific guidance in `references/`.
189- Put deterministic helpers, validators, and generators in `scripts/`.
190- Put templates, boilerplate, and artifacts used in final output in `assets/`.
191- Keep `SKILL.md` under 500 lines and bias toward navigation over duplication.
192
193## Validation Defaults
194
195Run the validator before handoff:
196
197```bash
198python3 scripts/validate_skill.py .
199python3 scripts/test_validate_skill.py
200python3 scripts/validate_catalog.py /path/to/skills/root
201python3 scripts/audit_skill_metadata.py /path/to/skills/root
202python3 scripts/build_skill_graph.py /path/to/skills/root --check
203```
204
205What the validator checks:
206
207- `SKILL.md` exists and has valid portable frontmatter
208- canonical core sections are present (`Quick Reference`, workflow, `Navigation`, `Fact-Checking`)
209- folder name matches `name`
210- runtime-specific fields do not appear alongside unscoped portability claims
211- markdown links resolve locally
212- long reference files include a table of contents
213- `data/sources.json` is valid and fresh enough to trust
214- project and domain skills do not cross-link
215- exact duplicate registry triggers are either removed or explicitly disambiguated
216- registry skill references resolve to real skill directories (gated by `scripts/audit-coverage.py --check`)
217- metadata and Codex UI descriptions stay within local budget targets
218- graph edges in `metadata.graph` resolve to real skill directories when graph metadata is present
219
220Behavioral checks still require human review. Use `references/skill-validation.md` for the eval matrix.
221
222Pilot benchmark commands:
223
224```bash
225# Deterministic harness check
226python3 frameworks/shared-skills/evals/test_run_skill_bench.py
227
228# Live Codex-backed pilot benchmark
229python3 frameworks/shared-skills/evals/run_skill_bench.py \
230 frameworks/shared-skills/evals/tasks/pilot-router-and-long-skills.json \
231 --adapter codex \
232 --repo-root . \
233 --output frameworks/shared-skills/evals/outputs/pilot-router-and-long-skills-codex-YYYY-MM-DD.jsonl
234```
235
236Store benchmark runs as JSONL artifacts in `frameworks/shared-skills/evals/outputs/`. Do not create standalone Markdown run summaries unless explicitly requested.
237
238## Navigation
239
240Resources:
241
242- [references/frontmatter-reference.md](references/frontmatter-reference.md) - Portable core and runtime-specific header guidance
243- [references/skill-patterns.md](references/skill-patterns.md) - Patterns for splitting, scripting, and compatibility scoping
244- [references/skill-validation.md](references/skill-validation.md) - Static checks plus behavioral evals
245- [references/anthropic-skills-guide.md](references/anthropic-skills-guide.md) - Anthropic-specific reference
246- [references/skill-vs-agent-decision.md](references/skill-vs-agent-decision.md) - Decision matrix: when to write a skill vs a subagent vs both
247- [data/sources.json](data/sources.json) - Official sources to verify against
248
249Scripts:
250
251- `scripts/validate_skill.py`
252- `scripts/validate_catalog.py`
253- `scripts/audit_skill_metadata.py`
254- `scripts/build_skill_graph.py`
255- `scripts/test_validate_skill.py`
256
257Standard skills to defer to (not in this repo; invoke via the Skill tool):
258
259- `skill-creator` - Scaffold, modify, and benchmark/eval skills (generic authoring mechanics)
260- `plugin-dev:skill-development` - Authoring skills inside plugins
261- Agent Skills open spec: https://agentskills.io/specification - Portable frontmatter and structure baseline
262
263Related skills:
264
265- `agents-subagents` - Agent creation and delegation contracts
266- [../agents-hooks/SKILL.md](../agents-hooks/SKILL.md) - Hook automation
267- [../agents-mcp/SKILL.md](../agents-mcp/SKILL.md) - MCP server integration
268
269Repo-local note:
270
271- If this repo also carries Codex system skills, check `.codex/skills/.system/skill-creator/SKILL.md` locally. Do not treat that path as portable.
272
273## Fact-Checking
274
275- Known bugs, regressions, framework/compiler/runtime footguns, and version-specific crash or workaround guidance must be verified against current primary web sources before being treated as current fact.
276- Verify current external facts, field semantics, runtime limits, and packaging behavior before final answers.
277- Prefer primary sources and label runtime-specific guidance with platform and date when it may drift.
278- If web access is unavailable, state the limitation and mark any runtime-specific claim as unverified.
279
280## Learnings Loop
281
282Before applying this skill on a non-trivial task, read `learnings.consolidated.md` in this directory (and `learnings.md` if present).
283
284After applying it, if you encountered a pattern worth remembering, a mistake worth preventing, or a domain fact that surprised you, append one dated bullet to `learnings.md` via `agents-skills-feedback-loop/scripts/append_learning.py`. Do not modify `SKILL.md` itself.