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-skills3description: Creates and audits agent skills with SKILL.md, references, scripts, and platform-scoped metadata. Use when creating, updating, or validating shared skills.4---5
6# Agent Skills
7
8Use this skill to create or modernize skill bundles without conflating the portable core contract with runtime-specific extensions.
9
10> **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.
11
12## Quick Reference
13
14| Task | Read or Run | Outcome |
15|------|-------------|---------|
16| Scaffold a new skill | `skill-creator` (standard skill) | Generates the boilerplate; then apply portability discipline from `references/frontmatter-reference.md` |
17| Modernize an existing skill | `python3 scripts/validate_skill.py <skill-dir>` | Finds contract drift, broken links, stale sources, and missing TOCs |
18| Add runtime-specific metadata | `references/frontmatter-reference.md` | Scopes extensions to the target runtime instead of treating them as universal |
19| Decide how to split content | `references/skill-patterns.md` | Keeps `SKILL.md` small and moves detail into `references/` or `scripts/` |
20| Validate behavior, not just syntax | `references/skill-validation.md` | Builds trigger, non-trigger, and navigation evals |
21| Check Anthropic-specific details | `references/anthropic-skills-guide.md` | Uses Anthropic guidance without treating it as the portable baseline |
22| Ship one skill to multiple runtimes without drift | `references/dual-distribution.md` | Single canonical system prompt + wrapper distributions + drift-check gate |
23| 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 |
24
25## Core Contract
26
27Portable baseline:
28
29- `skill-name/SKILL.md` is required.
30- `name` and `description` are the portable required frontmatter fields.
31- `license`, `compatibility`, and `metadata` are portable optional fields in the open spec.
32- `allowed-tools` is part of the open spec, but implementation support may vary by runtime.
33- `references/`, `scripts/`, `assets/`, and `data/sources.json` are optional support directories.
34- Keep the main skill body focused on workflow and navigation; move long detail into support files.
35
36Runtime extensions:
37
38- 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.
39- 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.
40- If you use runtime-specific fields, add a scoped `compatibility` note naming the target runtime.
41- 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.
42- 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.
43
44Repo-local Codex metadata:
45
46- 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".
47- Keep `SKILL.md` `description` trigger-rich and portable.
48- Keep `agents/openai.yaml` `short_description` brief enough for UI surfaces.
49- Keep `agents/openai.yaml` `default_prompt` focused on when Codex should load the skill.
50- Revalidate semantic alignment when the skill intent changes; do not require exact string equality between these fields.
51
52## Authoring Modes
53
54Shared skills in this repo should default to a **functional reference** style:
55
56- matter-of-fact
57- outcome-oriented
58- explicit about inputs, outputs, and navigation
59- light on persona, coaching voice, or motivational framing
60
61That is the safest portable baseline across runtimes, especially for Codex-style skill loading.
62
63Some runtimes also benefit from a **problem-approach overlay**:
64
65- how to think about the task
66- ambiguity-handling rules
67- coaching or teaching tone
68- richer behavioral framing
69
70Use that style only in runtime-specific layers, references, or scoped extensions. Do not let the portable core become a blend of incompatible authoring philosophies.
71
72## Workflow
73
741. Start with 2-3 concrete user tasks and write the evals first.
752. Draft the portable core: folder name, `SKILL.md`, `name`, `description`, and minimal instructions.
763. Keep the portable core functional and reference-like unless the runtime explicitly benefits from a richer overlay.
774. Add runtime-specific metadata only after choosing the target runtime.
785. Put reusable detail in `references/`, deterministic helpers in `scripts/`, and output templates in `assets/`.
796. Run static validation before review: links, frontmatter, TOCs, and `sources.json`.
807. Run behavioral evals: trigger, non-trigger, navigation, and runtime-specific checks.
818. Observe real usage and iterate based on under-triggering, over-triggering, or poor file navigation.
829. 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.
8310. 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.
8411. 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.
85
86## Typical Scenarios
87
88Each row maps a real request to the smallest correct action. Pick the row, load only what it names.
89
90| Scenario | First action | Then | Done when |
91|----------|-------------|------|-----------|
92| 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 |
93| 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 |
94| 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 |
95| 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 |
96| 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 |
97| 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 |
98| `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 |
99| 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 |
100| 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 |
101| 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 |
102
103If a request matches no row, treat it as "create" or "audit" and fall back to the `Workflow` section.
104
105## ASCII Flow
106
107```text
108Skill change request
109 -> Define 2-3 real trigger tasks
110 -> Draft portable core: folder, SKILL.md, name, description
111 -> Split support material
112 +-- reference detail -> references/
113 +-- deterministic helper -> scripts/
114 +-- templates/assets -> assets/
115 -> Add runtime metadata only in scoped layers
116 -> Validate structure, links, sources, and behavior
117 -> Update catalog when names, counts, or router ownership change
118```
119
120## Known Traps
121
122- claiming a skill is portable while relying on runtime-only fields, substitutions, or invocation semantics
123- packing reference material, examples, and policy prose into `SKILL.md` instead of progressive disclosure files
124- 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`)
125- writing descriptions that sound broad but fail to trigger on the real user language
126- keeping `data/sources.json` present but stale, secondary-only, or disconnected from the actual workflow
127- copying frontmatter or examples from one runtime into another without re-verifying current official docs
128- letting enrichment steps silently remove candidate skills, routes, or evidence instead of using a named filter with an explicit reason
129- choosing between adjacent skills before each candidate has been evaluated independently against the user request
130
131## Common Anti-Patterns
132
133- universal "do everything" skills with no bounded task shape
134- runtime-specific metadata treated as the portable baseline
135- support directories (`references/`, `scripts/`, `assets/`) created but not wired into navigation
136- validation limited to syntax and broken links, with no trigger/non-trigger behavior checks
137- source lists that encode rankings, prices, or volatile product claims as durable truth
138- routing by keyword pile-up instead of a stage contract with eligibility filters, independent scoring, post-selection validation, and traceable side effects
139- solving runtime discovery budget by deleting useful workflow context from mature skills instead of adding a compact generated discovery layer
140
141## Description Rules (repo delta)
142
143Generic 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:
144
145- 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.
146
147## Scaffolding
148
149Do 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:
150
151- Add `compatibility: Portable core only. Add runtime-specific notes if extensions are used.` unless the skill is deliberately runtime-scoped.
152- Wire every `references/`, `scripts/`, and `assets/` file into Navigation.
153- If targeting Codex too, add the `agents/openai.yaml` adjunct (see Core Contract).
154
155## Invocation Control (runtime-specific)
156
157Field 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:
158
159- These fields are **runtime-scoped, not portable.** A skill that uses any of them must carry a `compatibility` note and drop any portability claim.
160- Side-effecting workflows (deploy, production writes, sends) should set `disable-model-invocation: true` so the model cannot auto-trigger them.
161
162### Runtime Portability
163
164`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.
165
166## Compatibility Rules
167
168| Target | Safe assumptions | What to verify separately |
169|--------|------------------|---------------------------|
170| Portable core | `name`, `description`, optional `license` / `compatibility` / `metadata`, `SKILL.md`, support folders | Runtime-specific fields and any implementation-specific behavior |
171| 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 |
172| VS Code | Portable core and VS Code's documented skill packaging | Any metadata beyond the official VS Code docs |
173| Codex in this repo | Portable core; adjunct metadata may live outside frontmatter | Repo-local conventions such as `agents/openai.yaml` when present |
174
175Rules of thumb:
176
177- Keep the portable example clean. Do not mix Anthropic-only fields into the default example.
178- 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.
179- If a field is not confirmed by current official docs for the target runtime, label it as repo-local or provisional.
180- When supporting multiple runtimes, document the shared core first and the extensions second.
181
182## Support Files
183
184When to split:
185
186- Put reference material, decision trees, and variant-specific guidance in `references/`.
187- Put deterministic helpers, validators, and generators in `scripts/`.
188- Put templates, boilerplate, and artifacts used in final output in `assets/`.
189- Keep `SKILL.md` under 500 lines and bias toward navigation over duplication.
190
191## Validation Defaults
192
193Run the validator before handoff:
194
195```bash
196python3 scripts/validate_skill.py .
197python3 scripts/test_validate_skill.py
198python3 scripts/validate_catalog.py /path/to/skills/root
199python3 scripts/audit_skill_metadata.py /path/to/skills/root
200python3 scripts/build_skill_graph.py /path/to/skills/root --check
201```
202
203What the validator checks:
204
205- `SKILL.md` exists and has valid portable frontmatter
206- canonical core sections are present (`Quick Reference`, workflow, `Navigation`, `Fact-Checking`)
207- folder name matches `name`
208- runtime-specific fields do not appear alongside unscoped portability claims
209- markdown links resolve locally
210- long reference files include a table of contents
211- `data/sources.json` is valid and fresh enough to trust
212- project and domain skills do not cross-link
213- exact duplicate registry triggers are either removed or explicitly disambiguated
214- registry skill references resolve to real skill directories (gated by `scripts/audit-coverage.py --check`)
215- metadata and Codex UI descriptions stay within local budget targets
216- graph edges in `metadata.graph` resolve to real skill directories when graph metadata is present
217
218Behavioral checks still require human review. Use `references/skill-validation.md` for the eval matrix.
219
220Pilot benchmark commands:
221
222```bash
223# Deterministic harness check
224python3 frameworks/shared-skills/evals/test_run_skill_bench.py
225
226# Live Codex-backed pilot benchmark
227python3 frameworks/shared-skills/evals/run_skill_bench.py \
228 frameworks/shared-skills/evals/tasks/pilot-router-and-long-skills.json \
229 --adapter codex \
230 --repo-root . \
231 --output frameworks/shared-skills/evals/outputs/pilot-router-and-long-skills-codex-YYYY-MM-DD.jsonl
232```
233
234Store benchmark runs as JSONL artifacts in `frameworks/shared-skills/evals/outputs/`. Do not create standalone Markdown run summaries unless explicitly requested.
235
236## Navigation
237
238Resources:
239
240- [references/frontmatter-reference.md](references/frontmatter-reference.md) - Portable core and runtime-specific header guidance
241- [references/skill-patterns.md](references/skill-patterns.md) - Patterns for splitting, scripting, and compatibility scoping
242- [references/skill-validation.md](references/skill-validation.md) - Static checks plus behavioral evals
243- [references/anthropic-skills-guide.md](references/anthropic-skills-guide.md) - Anthropic-specific reference
244- [references/skill-vs-agent-decision.md](references/skill-vs-agent-decision.md) - Decision matrix: when to write a skill vs a subagent vs both
245- [data/sources.json](data/sources.json) - Official sources to verify against
246
247Scripts:
248
249- `scripts/validate_skill.py`
250- `scripts/validate_catalog.py`
251- `scripts/audit_skill_metadata.py`
252- `scripts/build_skill_graph.py`
253- `scripts/test_validate_skill.py`
254
255Standard skills to defer to (not in this repo; invoke via the Skill tool):
256
257- `skill-creator` - Scaffold, modify, and benchmark/eval skills (generic authoring mechanics)
258- `plugin-dev:skill-development` - Authoring skills inside plugins
259- Agent Skills open spec: https://agentskills.io/specification - Portable frontmatter and structure baseline
260
261Related skills:
262
263- `agents-subagents` - Agent creation and delegation contracts
264- [../agents-hooks/SKILL.md](../agents-hooks/SKILL.md) - Hook automation
265- [../agents-mcp/SKILL.md](../agents-mcp/SKILL.md) - MCP server integration
266
267Repo-local note:
268
269- If this repo also carries Codex system skills, check `.codex/skills/.system/skill-creator/SKILL.md` locally. Do not treat that path as portable.
270
271## Fact-Checking
272
273- 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.
274- Verify current external facts, field semantics, runtime limits, and packaging behavior before final answers.
275- Prefer primary sources and label runtime-specific guidance with platform and date when it may drift.
276- If web access is unavailable, state the limitation and mark any runtime-specific claim as unverified.
277
278## Learnings Loop
279
280Before applying this skill on a non-trivial task, read `learnings.consolidated.md` in this directory (and `learnings.md` if present).
281
282After 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.