chore: update opencode workflow and local config

This commit is contained in:
alex wiesner
2026-03-12 12:14:33 +00:00
parent 86fca23261
commit 95974224f8
31 changed files with 1058 additions and 52 deletions

View File

@@ -0,0 +1,66 @@
---
name: creating-agents
description: Create or update opencode agents in this repository, including dispatch permissions and roster alignment requirements
permalink: opencode-config/skills/creating-agents/skill
---
# Creating Agents
Use this skill when you need to add or revise an agent definition in this repo.
## Agents vs Skills
- **Agents** define runtime behavior and permissions in `agents/*.md`.
- **Skills** are reusable instruction modules under `skills/*/SKILL.md`.
- Do not treat agent creation as skill creation; each has different files and checks.
## Source of Truth
1. Agent definition file: `agents/<agent-name>.md`
2. Dispatch permissions for new dispatchable agents: `agents/lead.md`
- `permission.task.<agent-name>: allow` must be present for lead dispatch.
3. Human-readable roster: `AGENTS.md`
- Keep the roster table synchronized with actual agent files.
4. Runtime overrides: `opencode.jsonc`
- May override/disable agent behavior.
- Does **not** register a new agent.
## Agent File Conventions
For `agents/<agent-name>.md`:
- Use frontmatter first, then concise role instructions.
- Keep tone imperative and operational.
- Include only permissions and behavior needed for the role.
- Align with existing files such as `agents/lead.md` and `agents/coder.md`.
Typical frontmatter fields in this repo include:
- `description`
- `mode`
- `model` (for subagents where needed)
- `temperature`
- `permission`
- `permalink`
Mirror nearby agent files instead of inventing new metadata patterns.
Note: `agents/lead.md` is the only `mode: primary` agent. New agents should normally mirror a comparable subagent and use `mode: subagent` with an explicit `model`.
## Practical Workflow (Create or Update)
1. Inspect `agents/lead.md` and at least one similar `agents/*.md` file.
2. Create or edit `agents/<agent-name>.md` with matching local structure.
3. If the agent must be dispatchable, add `permission.task.<agent-name>: allow` in `agents/lead.md`.
4. Update `AGENTS.md` roster entry to match the new/updated agent.
5. Review `opencode.jsonc` for conflicting overrides/disable flags.
## Manual Verification Checklist (No Validation Script)
Run this checklist before claiming completion:
- [ ] `agents/<agent-name>.md` exists and frontmatter is valid/consistent with peers.
- [ ] Agent instructions clearly define role, scope, and constraints.
- [ ] `agents/lead.md` includes `permission.task.<agent-name>: allow` if dispatch is required.
- [ ] `AGENTS.md` roster row exists and matches agent name/role/model.
- [ ] `opencode.jsonc` does not unintentionally disable or override the new agent.
- [ ] Terminology stays consistent: agents in `agents/*.md`, skills in `skills/*/SKILL.md`.

View File

@@ -0,0 +1,64 @@
---
name: creating-skills
description: Create or update opencode skills in this repository using the required SKILL.md format and concise, trigger-focused guidance
permalink: 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`, or `scripts/references/assets` conventions from the old source model.
- A skill is discovered from `skills/*/SKILL.md` only.
## Required Structure
1. Create a folder at `skills/<skill-name>/`.
2. Add `skills/<skill-name>/SKILL.md`.
3. Keep `<skill-name>` equal to frontmatter `name`.
Frontmatter must contain only:
```yaml
---
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 `name` exactly.
## 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.
## 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.md` as the operational entrypoint.
- Link companion files directly from `SKILL.md` with clear “when to read” guidance.
- Do not create extra docs by default.
## Practical Workflow (Create or Update)
1. Inspect 23 nearby skills for local style and brevity.
2. Pick/update `<skill-name>` and folder path under `skills/`.
3. Write or revise `SKILL.md` frontmatter (`name`, `description`, `permalink` only).
4. Draft concise body sections: purpose, load conditions, workflow, red flags/checks.
5. Add minimal companion `.md` files only if needed; link them from `SKILL.md`.
6. Verify discovery path and naming consistency:
- file exists at `skills/<name>/SKILL.md`
- folder name == frontmatter `name`
- no OpenAI/Codex-only artifacts introduced