This guide walks you from a fresh clone to a new skill discoverable through /agent-flywheel:<your-skill> in about 30 minutes. Read the whole page once before you start — the three moving parts (skill dir, commands dir, and built dist) must land in the same PR or CI will catch it.
- Node.js 18.18+ (see
mcp-server/package.jsonenginesfor the pinned minimum). - Claude Code (latest).
- Optional: br, bv, and agent-mail (Rust port — primary; the legacy Python build works too) if you want to exercise the full flywheel locally.
/agent-flywheel:flywheel-setupinstalls them.
Clone, install, and build once:
git clone https://github.com/burningportra/agent-flywheel-plugin.git
cd agent-flywheel-plugin
npm ci --prefix mcp-server
npm run build --prefix mcp-server
claude --plugin-dir .Run /agent-flywheel:flywheel-doctor to confirm your toolchain is green before making changes.
Adding a new skill to the plugin requires three artifacts that must ship together. Missing any one of them will either hide the skill from Claude Code or trip the dist-drift CI job.
- Copy the template to a new directory:
cp -r skills/_template skills/<your-skill-name>. - Edit
skills/<your-skill-name>/SKILL.md:- Set
name:in the frontmatter to match the directory name. - Write a one-sentence
description:— this is what Claude Code shows in the command palette and what the SKILL-selection heuristic matches against. - Replace the Step skeletons with your actual workflow.
- Set
- Keep the skill idempotent and read-only where possible. Destructive operations should ask via
AskUserQuestionfirst (seeskills/start/SKILL.mdUNIVERSAL RULE 1).
Skill bodies are Markdown. They are injected verbatim into Claude's system prompt when the skill is selected, so the prose IS the behavior — be precise.
Every skill needs a matching slash-command entry point in commands/. The slash command is how users (and other skills) invoke your skill.
- Create
commands/<your-skill-name>.md. - The frontmatter needs a short
description:— this shows up in the slash-command listing inside Claude Code. - The body instructs Claude Code to invoke the skill:
Skill(skill_name: "agent-flywheel:<your-skill-name>").
Namespace prefix — why agent-flywheel:? When Claude Code loads the plugin, every skill is namespaced under the plugin's manifest name (agent-flywheel). The Skill tool invocation MUST use the fully qualified form agent-flywheel:<your-skill-name>; the bare <your-skill-name> will either resolve to a different plugin's skill or fail to resolve at all. The slash command name itself does not carry the prefix in the filename (the file is commands/<name>.md, not commands/agent-flywheel:<name>.md) — the prefix is added when the command is invoked by the user (/agent-flywheel:<name>) and when the command body calls the Skill tool.
See commands/flywheel-doctor.md for a minimal reference.
Only required if you touched anything under mcp-server/src/. Pure docs and skill changes do not need a rebuild.
npm run build --prefix mcp-server
git add mcp-server/dist/The dist-drift CI job fails if mcp-server/dist/server.js is older than the newest file under mcp-server/src/. Commit the rebuilt dist/ in the same PR — never in a follow-up.
Do not hand-edit files in mcp-server/dist/. They are generated.
npm test --prefix mcp-serverIf you added a new MCP tool or touched a runner in mcp-server/src/tools/, add a matching test under mcp-server/src/__tests__/. The test suite runs on every PR.
The OpenCode port is generated from repo sources by scripts/sync-opencode.sh (see docs/opencode.md). If you change any managed source — anything under skills/, commands/, hooks/, or opencode/ — run the temp-home black-box suite before you push:
bats install/test/test-sync-opencode.bats and test-install-opencode.bats exercise the sync and installer against a throwaway $HOME/config dir, so they never touch your real ~/.config/opencode. They cover first install, no-op reruns, drift, local-edit backups, lock contention, JSONC preservation, and the --with-opencode installer path. CI runs them on every PR; running them locally catches ownership-boundary and transform regressions before review.
- Branch from
main. - Keep the PR scoped: one skill, or one bug fix, or one doc change. Multi-skill PRs are harder to review.
- Include
mcp-server/dist/changes if you rebuilt. - Run
/agent-flywheel:flywheel-doctorlocally — if it isred, fix the red checks before pushing. - The CI pipeline runs:
npm run build,npm test, dist-drift check, andlint-skillacross everySKILL.md.
skills/_template/SKILL.md— copy-paste scaffold with required frontmatter, step skeleton, and inline comments.skills/_template/commands-example.md— copy tocommands/<your-skill-name>.mdand edit.
For reference patterns, read skills/flywheel-doctor/SKILL.md (small, self-contained) or skills/start/SKILL.md (large, multi-phase, uses sub-files).