3.9 KiB
3.9 KiB
name, description, permalink
| name | description | permalink |
|---|---|---|
| creating-skills | Create or update opencode skills in this repository using the required SKILL.md format and concise, trigger-focused guidance | opencode-config/skills/creating-skills/skill |
Creating Skills
Use this skill when you need to add or revise an opencode skill under skills/.
Skills vs OpenAI/Codex Source Model
- Treat this repo as opencode-native.
- Do not use OpenAI/Codex-specific artifacts such as
agents/openai.yaml,init_skill.py,quick_validate.py, orscripts/references/assetsconventions from the old source model. - A skill is discovered from
skills/*/SKILL.mdonly.
Required Structure
- Create a folder at
skills/<skill-name>/. - Add
skills/<skill-name>/SKILL.md. - Keep
<skill-name>equal to frontmattername.
Frontmatter must contain only:
---
name: <skill-name>
description: <what it does and when to load>
permalink: opencode-config/skills/<skill-name>/skill
---
Naming Rules
- Use lowercase kebab-case.
- Keep names short and action-oriented.
- Match folder name and
nameexactly.
Body Writing Rules
- Write concise, imperative instructions.
- Lead with when to load and the core workflow.
- Prefer short checklists over long prose.
- Include only repo-relevant guidance.
- Keep the planner/builder operating model in mind when a skill touches workflow behavior.
Companion Notes (*.md in skill folder)
Add companion markdown files only when detail would bloat SKILL.md (examples, deep procedures, edge-case references).
- Keep
SKILL.mdas the operational entrypoint. - Link companion files directly from
SKILL.mdwith clear “when to read” guidance. - Do not create extra docs by default.
Practical Workflow (Create or Update)
- Inspect 2–3 nearby skills for local style and brevity.
- Pick/update
<skill-name>and folder path underskills/. - Write or revise
SKILL.mdfrontmatter (name,description,permalinkonly). - Draft concise body sections: purpose, load conditions, workflow, red flags/checks.
- Add minimal companion
.mdfiles only if needed; link them fromSKILL.md. - Verify discovery path and naming consistency:
- file exists at
skills/<name>/SKILL.md - folder name == frontmatter
name - no OpenAI/Codex-only artifacts introduced
- file exists at
- If the skill changes agent workflow or command behavior:
- Update the Skills table, Agent Skill-Loading Contract, and TDD Default Policy in
AGENTS.md. - Confirm
commands/*.mdand any affectedagents/*.mdprompts stay aligned. - If the skill involves parallelization, verify it enforces safe-parallelization rules (no parallel mutation on shared files, APIs, schemas, or verification steps).
- If the skill involves code changes, verify it references the TDD default policy and its narrow exceptions.
- Update the Skills table, Agent Skill-Loading Contract, and TDD Default Policy in
Language/Ecosystem Skill Pattern
When adding a new language or ecosystem skill (e.g., rust-development, go-development), follow this template:
- Name:
<language>-development(kebab-case). - Load trigger: presence of the language's project file(s) or source files as primary source.
- Defaults table: one row per concern — package manager, linter/formatter, test runner, type checker (if applicable).
- Core workflow: numbered steps for bootstrap, lint, format, test, add-deps, and any lock/check step.
- Conventions: 3–5 bullets on config file preferences, execution patterns, and version pinning.
- Docker integration: one paragraph on base image and cache strategy.
- Red flags: 3–5 bullets on common anti-patterns.
- AGENTS.md updates: add the skill to the Ecosystem Skills table and add load triggers for
planner,builder,coder, andtesterin the Agent Skill-Loading Contract. - Agent prompt updates: add the skill trigger to
agents/planner.md,agents/builder.md,agents/coder.md, andagents/tester.md.