Writing Skills
Build skills as small, testable behavior contracts. Optimize discovery separately from the full procedure: the description routes; the body instructs; references hold conditional detail; scripts make repeated deterministic work verifiable.
Read anthropic-best-practices.md only when Claude-specific behavior or a deep authoring review is needed. Read testing-skills-with-subagents.md only when the current host and instructions permit isolated agent evaluations. Never spawn agents solely because this reference mentions them.
1. Recover the contract
Before editing, record:
- Trigger intents and explicit non-triggers
- User outcome and output shape
- Required inputs, tools and supporting files
- Side effects, authorization and safety boundaries
- Verification and failure behavior
- Target hosts and discovery roots
Inspect every existing variant before deciding which is canonical. Preserve useful behavior unless evidence supports removal.
2. Decide add, modify, split, merge or remove
- Add only for a recurring need with no adequate owner.
- Modify when the owner is correct but routing, procedure, safety or verification is weak.
- Split when trigger domains, permissions, dependencies or outputs differ materially.
- Merge only when triggers, dependencies, safety and output contract substantially overlap.
- Remove only for exact duplicates, broken stubs, superseded copies or unsafe behavior after backup and evidence.
Do not merge by topic name alone. Do not keep duplicate IDs across discovery roots unless a host override is intentional and documented.
3. Write portable frontmatter
Use a lowercase kebab-case directory and matching name. Keep description within the target host's limit and front-load:
- Exact capability/domain
- Natural use cases and symptoms
- High-value English and Turkish intents when the audience needs both
- A concise false-positive boundary for overlapping skills
Descriptions should make selection discriminating, not reproduce the workflow. Provider-specific invocation controls belong only in host variants:
- OpenAI:
agents/openai.yaml
- Claude Code manual-only:
disable-model-invocation: true
- OpenCode V2 manual-only:
metadata.opencode/autoinvoke: false
4. Structure the body
Keep the entrypoint focused and use progressive disclosure:
- Scope and owner boundary
- Inputs and routing
- Ordered workflow
- Hard rules and authorization limits
- Output contract
- Links to one-hop references/scripts/templates
Move long, conditional material to references/. Put repeatable deterministic calculations or validation in scripts/. Do not hide a critical safety or trigger rule only in a reference.
5. Build safe supporting files
- Prefer standard-library, read-only scripts when sufficient.
- Validate paths, encodings, schemas, units and invalid inputs.
- Never execute imported/community code during review merely to see what it does.
- Never bundle credentials, personal identifiers, machine-specific paths or undocumented network calls.
- State model limits; a script's precise output is not precise confidence.
6. Evaluate
Every changed skill needs, at minimum:
- Structural validation: frontmatter, name/folder, description length, encoding and links
- Positive trigger cases in natural English and Turkish when bilingual
- Negative cases for the nearest competing skill
- Boundary/failure cases for missing inputs, unsafe actions and stale evidence
- Deterministic script fixtures where scripts exist
- Host-specific invocation-policy checks
- Regression comparison against the previous accepted contract
For a new discipline-enforcing skill, use a no-skill baseline and skill-enabled test when an allowed fresh-context harness exists. If the host or current instructions forbid subagents, use static cases and deterministic checks; do not violate higher-level rules to satisfy a testing technique. For a batch corpus, every skill still receives structural and trigger checks, while full pressure tests focus on new or high-risk behavior owners.
7. Package and verify
- Build all host variants from one validated common source.
- Back up every destination before sync.
- Generate manifests and SHA-256 hashes.
- Re-enumerate each local/cloud/repository destination separately.
- Never claim account/cloud installation, a push, or an upload without read-back evidence.
Acceptance result
Return PASS, CONDITIONAL, or FAIL with changed skills, preserved behavior, trigger collisions, host differences, tests, unresolved limits and rollback location.
1---2name: writing-skills3description: Create, edit, split, merge, port, or validate agent skills and SKILL.md packages. Use for skill architecture, trigger descriptions, supporting references/scripts, host variants, regression checks, or Turkish intents such as “skill yaz/geliştir”, “becerileri birleştir/böl”, “tetikleyicileri düzelt”, “ChatGPT-Claude-OpenCode skill paketi”. Do not use for ordinary project documentation that is not an agent skill.4---56# Writing Skills78Build skills as small, testable behavior contracts. Optimize discovery separately from the full procedure: the description routes; the body instructs; references hold conditional detail; scripts make repeated deterministic work verifiable.910Read [anthropic-best-practices.md](anthropic-best-practices.md) only when Claude-specific behavior or a deep authoring review is needed. Read [testing-skills-with-subagents.md](testing-skills-with-subagents.md) only when the current host and instructions permit isolated agent evaluations. Never spawn agents solely because this reference mentions them.1112## 1. Recover the contract1314Before editing, record:1516- Trigger intents and explicit non-triggers17- User outcome and output shape18- Required inputs, tools and supporting files19- Side effects, authorization and safety boundaries20- Verification and failure behavior21- Target hosts and discovery roots2223Inspect every existing variant before deciding which is canonical. Preserve useful behavior unless evidence supports removal.2425## 2. Decide add, modify, split, merge or remove2627- **Add** only for a recurring need with no adequate owner.28- **Modify** when the owner is correct but routing, procedure, safety or verification is weak.29- **Split** when trigger domains, permissions, dependencies or outputs differ materially.30- **Merge** only when triggers, dependencies, safety and output contract substantially overlap.31- **Remove** only for exact duplicates, broken stubs, superseded copies or unsafe behavior after backup and evidence.3233Do not merge by topic name alone. Do not keep duplicate IDs across discovery roots unless a host override is intentional and documented.3435## 3. Write portable frontmatter3637Use a lowercase kebab-case directory and matching `name`. Keep `description` within the target host's limit and front-load:38391. Exact capability/domain402. Natural use cases and symptoms413. High-value English and Turkish intents when the audience needs both424. A concise false-positive boundary for overlapping skills4344Descriptions should make selection discriminating, not reproduce the workflow. Provider-specific invocation controls belong only in host variants:4546- OpenAI: `agents/openai.yaml`47- Claude Code manual-only: `disable-model-invocation: true`48- OpenCode V2 manual-only: `metadata.opencode/autoinvoke: false`4950## 4. Structure the body5152Keep the entrypoint focused and use progressive disclosure:5354- Scope and owner boundary55- Inputs and routing56- Ordered workflow57- Hard rules and authorization limits58- Output contract59- Links to one-hop references/scripts/templates6061Move long, conditional material to `references/`. Put repeatable deterministic calculations or validation in `scripts/`. Do not hide a critical safety or trigger rule only in a reference.6263## 5. Build safe supporting files6465- Prefer standard-library, read-only scripts when sufficient.66- Validate paths, encodings, schemas, units and invalid inputs.67- Never execute imported/community code during review merely to see what it does.68- Never bundle credentials, personal identifiers, machine-specific paths or undocumented network calls.69- State model limits; a script's precise output is not precise confidence.7071## 6. Evaluate7273Every changed skill needs, at minimum:7475- Structural validation: frontmatter, name/folder, description length, encoding and links76- Positive trigger cases in natural English and Turkish when bilingual77- Negative cases for the nearest competing skill78- Boundary/failure cases for missing inputs, unsafe actions and stale evidence79- Deterministic script fixtures where scripts exist80- Host-specific invocation-policy checks81- Regression comparison against the previous accepted contract8283For a new discipline-enforcing skill, use a no-skill baseline and skill-enabled test when an allowed fresh-context harness exists. If the host or current instructions forbid subagents, use static cases and deterministic checks; do not violate higher-level rules to satisfy a testing technique. For a batch corpus, every skill still receives structural and trigger checks, while full pressure tests focus on new or high-risk behavior owners.8485## 7. Package and verify86871. Build all host variants from one validated common source.882. Back up every destination before sync.893. Generate manifests and SHA-256 hashes.904. Re-enumerate each local/cloud/repository destination separately.915. Never claim account/cloud installation, a push, or an upload without read-back evidence.9293## Acceptance result9495Return `PASS`, `CONDITIONAL`, or `FAIL` with changed skills, preserved behavior, trigger collisions, host differences, tests, unresolved limits and rollback location.