agentleFS
osmonteroosmontero/opencode-skills/AGENTS.md

opencode-skills

AGENTS.md14 starsChanged 4 months agoMITView on GitHub

Org overview: ../../AGENTS.md This repository contains opencode skills and global agents — Markdown-based instruction files installed into ~/.config/opencode/. There is no application to run, no tests to execute, and no CI pipeline. Each skill is a skills/<name>/SKILL.md with YAML frontmatter (name, description). The agent reads this file and follows its instructions. Bundled resources live alongside: scripts/ (Python), references/ (docs), assets/ (templates). Editing a skill means editing its SKILL.md and any bundled files. There is no compilation or build step. ./install.sh…

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Do not run npm test, pytest, make, or similar — there are none.

    line 175
  2. Distinctive:

    Do not create CI workflows — this repo has none and doesn't need them.

    line 176
  3. Very specific:

    Do not commit uv.lock, .venv/, node_modules/, or .egg-info/ — they are gitignored.

    line 177
  4. Very specific:

    Do not edit skills directly in ~/.config/opencode/ — edit in the repo, then run the install script.

    line 178

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Org overview: ../../AGENTS.md

AGENTS.md

This repository contains opencode skills and global agents — Markdown-based instruction files installed into ~/.config/opencode/. There is no application to run, no tests to execute, and no CI pipeline.

Repository Structure

skills/          — 34 skill directories (each: SKILL.md + optional scripts/, references/, assets/)
agents/          — 11 agent definition files (YAML-frontmatter Markdown, *.md) + LICENSE.txt
.opencode/       — Local opencode config (opencode.json, prompts/, command/)

Key Facts

Skills are Markdown files, not code

Each skill is a skills/<name>/SKILL.md with YAML frontmatter (name, description). The agent reads this file and follows its instructions. Bundled resources live alongside: scripts/ (Python), references/ (docs), assets/ (templates).

Editing a skill means editing its SKILL.md and any bundled files. There is no compilation or build step.

install.sh / install.ps1 is the deployment mechanism

./install.sh (Linux/macOS) or ./install.ps1 (Windows) copies skills, agents, MCP servers, commands, and config to ~/.config/opencode/. It also removes stale skills/agents/MCP servers/commands no longer in the repo, installs Python deps via uv, replaces the global opencode.json, and copies prompt files. After editing files in this repo, run the install script to apply changes to the active opencode configuration.

Both installers must stay in sync. A new deployable directory added to one is a bug in the other.

Python dependencies are managed by uv

pyproject.toml lists dependencies (pdfplumber, pypdf, pypdfium2, pillow, playwright, etc.). The virtual environment is installed at ~/.local/opencode-venv/ by the install script. Before running any Python scripts:

source ~/.local/opencode-venv/bin/activate

Agent files use YAML frontmatter

Each agents/<name>.md has frontmatter with description, mode: subagent, and optionally permission and model fields. The body is Markdown instructions. The description triggers the agent — keep it specific and actionable. agents/LICENSE.txt is not an agent file.

.opencode/ contains local config

.opencode/opencode.json configures providers, models, MCP servers, agent prompts, and the instructions files that carry memory. It references prompts/plan.txt and prompts/build.txt for the plan and build workflows.

Prompt overrides are general-purpose by design

.opencode/prompts/{build,plan,compaction}.txt are custom prompts, wired via agent.<name>.prompt in opencode.json. They replaced opencode's defaults, which were coding-specific.

The governing rule: these prompts carry methodology, not domain knowledge. How to work — task management, evidence before assertion, scope discipline, delegation, communication. Domain technique belongs in skills. That split only holds because each prompt opens with a Skills Come First section instructing the agent to check for an applicable skill and to let it govern; removing that section reopens the gap that stripping the coding guidance created. Anything added here that is specific to code, or to any one domain, is in the wrong file.

  • build.txt and plan.txt deliberately diverge. build is execution methodology; plan is investigation methodology (explore → constraints → options → agreement) with a definition of what a plan must contain. Upstream has no separate plan prompt — plan mode is enforced by injected <system-reminder> blocks and by permissions — so this divergence is ours, and both files still defer enforcement to those reminders rather than restating prohibitions.
  • Task Management is load-bearing, not boilerplate. The upstream variant these replaced (Ta, the generic fallback) ships with no task-management section, which is why the agents did not maintain todo lists. Both prompts now specify: list before starting, one in_progress, complete immediately without batching, discovered work becomes new items, re-read before claiming done.
  • compaction.txt cooperates with a contract it cannot override. opencode supplies its own user-side prompt demanding a fixed five-section structure wrapped in <summary> tags. The system prompt cannot change that, so it adds fidelity rules inside it: standing user instructions and unreconstructable literals (keys, IDs, paths, versions, exact commands) are copied verbatim, and narrative is what gets cut when space runs short. Do not add competing section structures here — they will fight the user prompt.
  • Overriding bypasses model-family selection. opencode picks a default system prompt by substring-matching the model id (claude, gpt/codex, gemini-, kimi, trinity, muse-spark), falling through to a generic variant — which is what the ThreatWinds qwen-*/silas-* ids resolve to. With an override set, that selection no longer happens at all, for any model.
  • A prompt override replaces the model-family prompt entirely, but not everything: the merge is agent.prompt ? [agent.prompt] : provider(model), and the environment block plus any user system prompt are still appended after it.
  • Emptying a file is the revert. That truthiness check means a 0-byte file falls back to opencode's default.
  • Prompt file references resolve against the config file's directory, not CWD or home. Per the config docs, {file:./prompts/x.txt} resolves relative to the opencode.json that contains it — so this repo's .opencode/opencode.json (auto-loaded as project config, which outranks the global one) reads .opencode/prompts/ (what you edit), and the installed global config reads ~/.config/opencode/prompts/ (what install.sh placed there). Do not "fix" the references to {file:~/.config/opencode/prompts/...}: this repo would then silently use the installed copies and repo prompt edits would be ignored until the next reinstall. Verified empirically against the 1.18.23 binary with marker files: resolution is config-file-relative, from the project root and subdirectories alike.

Re-extract a current default after upgrading opencode (this prints the live resolved prompt, so run it from a directory whose config does not override the agent):

opencode debug agent compaction    # also: build, plan, title, summary

Config keys are schema-verified against https://opencode.ai/config.json: agent accepts the named built-ins plan, build, general, explore, title, summary, and compaction, each taking a full AgentConfig (prompt, model, variant, temperature, top_p, steps, permission).

The separate top-level compaction block (auto, prune, reserved, tail_turns, preserve_recent_tokens) controls when and how much to compact and is unrelated to the prompt.

Memory is two MEMORY.md files wired through instructions

build.txt has a Memory section telling the agent to record durable lessons on its own initiative — corrections, standing preferences, undocumented failure modes — into ~/.config/opencode/MEMORY.md (global) or .opencode/MEMORY.md (per project). Global writes are autonomous; project writes are proposed first, because they land in the user's repository. This replaces the plugin-based memory system in docs/specs/2026-08-05-local-memory-design.md, which is superseded.

"instructions": ["~/.config/opencode/MEMORY.md", ".opencode/MEMORY.md"]
  • One line here enables memory in every project, because the install scripts copy this file over the global ~/.config/opencode/opencode.json. No per-project setup.
  • Relative entries resolve per-project, not against the config file. Instruction.systemPaths sends them to globUp(pattern, session.directory, worktree), which scans the session cwd and every ancestor up to the worktree root, with dot: true — that is why .opencode/MEMORY.md matches. ~/-prefixed and absolute entries resolve against home instead. Missing files are silently skipped and empty ones are filtered out of the prompt, so no project needs the file to exist.
  • MEMORY.md rather than AGENTS.md, deliberately. Built-in global discovery takes the first existing of ~/.config/opencode/AGENTS.md then ~/.claude/CLAUDE.md and then breaks — so creating a global AGENTS.md silently displaces a user's ~/.claude/CLAUDE.md. Project discovery takes the first matching of AGENTS.md, CLAUDE.md, CONTEXT.md via findUp and breaks likewise. Keeping agent writes out of AGENTS.md also keeps them clear of /init, which rewrites that file.
  • opencode's own built-in prompt points agents at AGENTS.md for the same purpose ("proactively suggest writing it to AGENTS.md so that you will know to run it next time"). The split here is a deliberate divergence, not an oversight: AGENTS.md stays human-owned.
  • Long content is split into a detail file next to MEMORY.md, not inlined. Because both MEMORY.md files are auto-injected on every session, every line costs tokens whether or not the topic is relevant. So when an entry would run more than a few lines (a table, a procedure, a cluster of related facts), the agent keeps one line in MEMORY.md — the key fact plus a pointer — and writes the full detail to a file in the same directory: ~/.config/opencode/memory/ for global, .opencode/memory/ for project (kebab-case, named for the topic). These detail files are not auto-loaded; the agent reads one only when the topic is in play. This is why memory/ subdirectories exist and why a MEMORY.md may point to files that are not otherwise part of the config. Project detail files are proposed, not written silently — they land in the user's repo. build.txt's Memory section owns the operational rules; this bullet is the "why" for future sessions.
  • Plan mode writes only docs/plans/* and docs/specs/*. The plan agent's edit: deny * is overridden by a narrow allowlist in .opencode/opencode.json so planning can persist its own deliverable (spec + plan) instead of leaving it in chat. Everything else stays denied. plan.txt's Memory section says plan mode cannot write MEMORY.md either (it's not in the allowlist), so durable facts found while planning go into a "Memory to record" note at the end of the plan; build.txt tells the build session to work that note first when it picks up the plan.

Design and UX is a four-skill cluster

designing-frontend-interfaces (visual craft, 5 reference files) → designing-user-experience (flows and states) → building-accessible-interfaces (WCAG 2.2 AA) → reviewing-interface-quality (audit rubric). applying-themes supplies contrast-verified palettes; the interface-reviewer agent runs the audit as a subagent.

When editing any of them, keep the cross-references intact — they name each other by skill name and by reference-file path, and the design skills are written to compose rather than duplicate. Contrast values in applying-themes/themes/*.md are machine-checked:

source ~/.local/opencode-venv/bin/activate
python3 skills/applying-themes/scripts/check_contrast.py skills/applying-themes/themes/*.md

That script exits non-zero on failure, so it works as a gate after editing any palette.

skills/applying-themes/theme-showcase.pdf predates the current palettes and no longer matches the theme files. The markdown files are authoritative; regenerate or delete the PDF rather than treating it as a preview.

Engineering rigor is a four-skill cluster

reviewing-security (+ security-reviewer agent), evolving-apis-and-schemas, investigating-performance, and writing-release-notes. Each is built around a single refusal stated as an Iron Law, and the value is in the refusal — an edit that softens one into advice removes the reason the skill exists:

SkillIron Law
reviewing-securityNo finding without a path from attacker-controlled input to impact
evolving-apis-and-schemasAdditive first, destructive last — never in the same deploy
investigating-performanceNo optimization without a measurement that names the bottleneck
writing-release-notesEvery entry states what changed for the reader, not what changed in the code

The first three carry a references/ file each (vulnerability patterns, migration recipes, profiling tools) linked one level deep from SKILL.md. Keep them one level deep — nested references get partially read.

building-finetuning-datasets is gate-shaped, not checklist-shaped

The only ML skill in the repo, and the only one whose SKILL.md is mostly two decision gates plus a required-parts contract, with all technique detail pushed into five references/ files (choosing-technique, synthetic-generation, data-quality, lora-configuration, avoiding-degradation).

That shape came out of the baseline run, not from taste. Without the skill, the agent produced a thorough 935-line plan that nonetheless: treated "know our service names and runbook facts" as a fine-tuning target with zero mention of retrieval; set lora_alpha to half the rank, calling alpha/r = 0.5 "the standard starting point"; and never once mentioned forgetting, replay, dedup, decontamination, loss masking, chat templates, EOS, or measuring the base model first. The failure was never refusal — it was a complete-looking deliverable with required parts missing. Per creating-skills, omitted elements call for a structural contract rather than prohibitions, which is why "The deliverable" section enumerates six required artifacts in build order instead of warning against skipping them.

Two facts in there are load-bearing and get "corrected" by well-meaning edits: alpha = 2r (not 0.5r), and facts belong in RAG because training on unknown facts linearly increases hallucination rather than merely failing to stick. Both are cited to their papers in the skill; keep the citations.

Several claims were cross-checked against a real fine-tuning operation (threatwinds/llm-finetune, a sibling repo) and adjusted where field evidence disagreed with the literature: lora_dropout and a validation split are documented there as regression levers, not just anti-overfitting ones (their v13→v14 narrowed a benchmark regression with that single change), so the skill promotes them; packing is framed as off-by-default for small/multi-turn data because their agentic runs disable it; and their practice of probing the base model and dropping slices it already passes became "Gate 3." That repo's per-behavior mix-share findings (≈33% fixes a hard prior, ≈18% regresses) are in data-quality.md. The anonymized "documented ~750-row case" phrasing in the references points at that work — keep it anonymized; the skill is general and their redteam/exploit specifics are sensitive.

Custom commands override built-ins by name

.opencode/command/<name>.md defines a slash command. opencode globs {command,commands}/**/*.md from its config directories and merges each by name with c.template = a.template — an unconditional assignment, so a file named init.md replaces the built-in /init entirely. This is the same override surface as agent.<name>, and it is how /init in this repo is customized.

The file is frontmatter (description, optionally agent, model, subtask) plus a body that becomes the template. Templates support $ARGUMENTS and positional $1, $2. They do not support ${path} — that appears in opencode's built-in prompts but is JS interpolation resolved at build time, not template syntax.

Recover a built-in command's original text by extracting it from the opencode binary; opencode debug has no command inspector, and there is no debug command equivalent to debug agent.

Frontmatter conventions

Skills take name (must equal the directory name) and description only — plus license for Anthropic-derived skills and compatibility: opencode for superpowers-derived ones. mode, permission, and tools are agent-only fields and must not appear on a skill. Agents require mode: subagent; permission.edit: deny is correct for read-only reviewer agents.

Descriptions start with "Use when…" and describe triggering conditions only — never the skill's workflow. A description that summarizes the process gives the agent a shortcut it will take instead of reading the skill.

README contains license attribution info and full skill/agent lists

The README documents third-party licenses and attributions, plus tables of all skills and agents. Keep it synchronized if you add/remove skills, agents, or change attribution sources.

customize-opencode is built-in

The customize-opencode skill appears in the available skills list as <built-in> and is not in the repo. However, it triggers for editing opencode.json, opencode.jsonc, files under .opencode/, and files under ~/.config/opencode/. Use it when working on opencode's own configuration.

creating-skills is the meta-skill

skills/creating-skills/ contains the full skill development lifecycle: drafting, testing, eval viewer, benchmarking, and description optimization. Its scripts (scripts/aggregate_benchmark.py, scripts/run_loop.py, etc.) and eval viewer (eval-viewer/) are the primary tooling for this repo.

grader, comparator, and analyzer are skill-specific

These three agents are used exclusively by skills/creating-skills/ for eval/benchmarking. They are not general-purpose and should remain specialized to that workflow.

What NOT to do

  • Do not run npm test, pytest, make, or similar — there are none.
  • Do not create CI workflows — this repo has none and doesn't need them.
  • Do not commit uv.lock, .venv/, node_modules/, or .egg-info/ — they are gitignored.
  • Do not edit skills directly in ~/.config/opencode/ — edit in the repo, then run the install script.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.