Claude-skill-registry generate-modes
Generates three project-specific behavioral mode skills (planner, debugger, qa-tester) from project memories and bundled templates, and makes them selectable via switching-modes. Use when creating project-local agent modes for a repository.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/generate-modes" ~/.claude/skills/majiayu000-claude-skill-registry-generate-modes && rm -rf "$T"
skills/data/generate-modes/SKILL.mdGenerate modes
Goal
Create three project-specific, behavioral mode skills under
./.{AGENT_NAME}/skills/:
{slug}-mode-planner{slug}-mode-debugger{slug}-mode-qa-tester
Each mode must:
- Always state acceptance criteria and how to verify locally.
- Never change or weaken existing tests without explicit approval.
- When drafting skills, follow the Agent Skills spec (valid frontmatter; keep
under ~500 lines; use progressive disclosure).SKILL.md
The modes must be written so they do not reference any specific benchmark, puzzle set, or domain-specific toy terms. They must read as general-purpose operating procedures.
For concrete “golden” examples of what the generated mode
SKILL.md files should look like after adaptation, see references/examples.md.
Quick start
-
Activate memories
- Run
.$activating-memories - Ensure baseline memory skills exist under
./.{AGENT_NAME}/skills/memories/ - If memories are missing or stale, update them before generating modes.
- Run
-
Choose a project slug
- Prefer a slug stated in
.project_overview - Otherwise derive from the repository folder name.
- Slug rules: lowercase, digits, hyphens; no leading/trailing hyphen; no consecutive hyphens.
- Length rule (spec compliance): generated skill
must be ≤ 64 chars and match its directory name.name- Longest suffix is
(15 chars), so-mode-qa-tester
must be ≤ 49 chars.{slug}
- Longest suffix is
- Prefer a slug stated in
-
Read the bundled templates
- Read:
assets/planner-template.mdassets/debugger-template.mdassets/qa-tester-template.md
- Read:
-
Generate three mode skills For each template:
- Adapt it to the project by adding:
- the
mode name{slug} - links to relevant memories (do not paste memory contents)
- project-specific verification commands (link to
for the canonical list)suggested_commands-skl
- the
- Write the resulting skill to:
./.{AGENT_NAME}/skills/{slug}-mode-planner/SKILL.md./.{AGENT_NAME}/skills/{slug}-mode-debugger/SKILL.md./.{AGENT_NAME}/skills/{slug}-mode-qa-tester/SKILL.md
- Adapt it to the project by adding:
-
Make the modes selectable via
$switching-modes- If
exists, update its mode registry to include the three new modes../.{AGENT_NAME}/skills/switching-modes/- Prefer editing an explicit “Mode registry” list in
(if present)../.{AGENT_NAME}/skills/switching-modes/SKILL.md
- Prefer editing an explicit “Mode registry” list in
- If it does not exist, create a project-local
that:./.{AGENT_NAME}/skills/switching-modes/SKILL.md- writes
with./.{AGENT_NAME}/state.json{ "mode": "<mode-name>" } - documents both baseline modes (if used) and the three new project modes
- start from
to avoid bikesheddingassets/switching-modes-stub.md
- writes
- After this, switching is done by running:
$switching-modes {slug}-mode-planner$switching-modes {slug}-mode-debugger$switching-modes {slug}-mode-qa-tester
- If
-
Validate the generated skills
- Minimum manual checks:
- Each generated directory name exactly matches its SKILL frontmatter
.name - Each generated
is third-person and includes “Use when …”.description
- Each generated directory name exactly matches its SKILL frontmatter
- Optional (if available): run
on each generated skill directory.skills-ref validate
- Minimum manual checks:
Required structure of each generated mode skill
Each mode skill must be a valid Agent Skill.
Frontmatter
Example for planner:
--- name: {slug}-mode-planner description: Behavioral mode for planning and design work in {slug}. Use when scoping changes, producing design docs, or deciding between approaches. ---
Body
Include these sections (in any order):
- When to use (triggers)
- Operating loop (the step-by-step behavior)
- Question protocol (how to ask questions; allow questions in all modes)
- Output discipline (acceptance criteria + local verification; test-change guardrail)
- Project context pointers (links to memories)
Keep the body concise. If the mode needs lengthy reference material, create
references/ files and link them.
Adaptation rules
When adapting templates:
- Prefer links to memories, e.g.
, not copy/paste.../memories/project_overview-skl/SKILL.md - Use the project’s terminology: module names, CLI names, test runner names, etc.
- Avoid generic fluff. Encode actionable guardrails, checks, and concrete steps.
- Ensure the mode is usable standalone by a future agent who has access to the memories.
Failure modes and how to handle them
- Unknown
: infer from the local agent folder present (e.g.{AGENT_NAME}
,.claude
). If none exist, ask the user what agent folder to use..codex - Mode name collisions: if a target directory already exists, do not overwrite silently. Either append a suffix (e.g.
) or ask the user which to keep.-v2 - No reliable test commands: link to
and ask the user to confirm the correct test command(s) if missing.suggested_commands-skl