Generate 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
SKILL.md under ~500 lines; use progressive disclosure).
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.
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
name must be ≤ 64 chars and match its directory name.
- Longest suffix is
-mode-qa-tester (15 chars), so {slug} must be ≤ 49 chars.
Read the bundled templates
- Read:
assets/planner-template.md
assets/debugger-template.md
assets/qa-tester-template.md
Generate three mode skills
For each template:
- Adapt it to the project by adding:
- the
{slug} mode name
- links to relevant memories (do not paste memory contents)
- project-specific verification commands (link to
suggested_commands-skl for the canonical list)
- 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
Make the modes selectable via $switching-modes
- If
./.{AGENT_NAME}/skills/switching-modes/ exists, update its mode registry to include the three new modes.
- Prefer editing an explicit “Mode registry” list in
./.{AGENT_NAME}/skills/switching-modes/SKILL.md (if present).
- If it does not exist, create a project-local
./.{AGENT_NAME}/skills/switching-modes/SKILL.md that:
- writes
./.{AGENT_NAME}/state.json with { "mode": "<mode-name>" }
- documents both baseline modes (if used) and the three new project modes
- start from
assets/switching-modes-stub.md to avoid bikeshedding
- After this, switching is done by running:
$switching-modes {slug}-mode-planner
$switching-modes {slug}-mode-debugger
$switching-modes {slug}-mode-qa-tester
Validate the generated skills
- Minimum manual checks:
- Each generated directory name exactly matches its SKILL frontmatter
name.
- Each generated
description is third-person and includes “Use when …”.
- Optional (if available): run
skills-ref validate on each generated skill directory.
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.
../memories/project_overview-skl/SKILL.md, not copy/paste.
- 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
{AGENT_NAME}: infer from the local agent folder present (e.g. .claude, .codex). If none exist, ask the user what agent folder to use.
- Mode name collisions: if a target directory already exists, do not overwrite silently. Either append a suffix (e.g.
-v2) or ask the user which to keep.
- No reliable test commands: link to
suggested_commands-skl and ask the user to confirm the correct test command(s) if missing.
1---2name: generate-modes3description: 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.4---5
6# Generate modes
7
8## Goal
9
10Create three **project-specific, behavioral** mode skills under `./.{AGENT_NAME}/skills/`:
11
12* `{slug}-mode-planner`
13* `{slug}-mode-debugger`
14* `{slug}-mode-qa-tester`
15
16Each mode must:
17
181. Always state **acceptance criteria** and **how to verify locally**.
192. Never change or weaken existing tests without explicit approval.
203. When drafting skills, follow the Agent Skills spec (valid frontmatter; keep `SKILL.md` under ~500 lines; use progressive disclosure).
21
22The 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.
23
24For concrete “golden” examples of what the generated mode `SKILL.md` files should look like after adaptation, see `references/examples.md`.
25
26## Quick start
27
281. **Activate memories**
29 - Run `$activating-memories`.
30 - Ensure baseline memory skills exist under `./.{AGENT_NAME}/skills/memories/`
31 - If memories are missing or stale, update them before generating modes.
32
332. **Choose a project slug**
34 - Prefer a slug stated in `project_overview`.
35 - Otherwise derive from the repository folder name.
36 - Slug rules: lowercase, digits, hyphens; no leading/trailing hyphen; no consecutive hyphens.
37 - **Length rule (spec compliance):** generated skill `name` must be ≤ 64 chars and match its directory name.
38 - Longest suffix is `-mode-qa-tester` (15 chars), so `{slug}` must be **≤ 49 chars**.
39
403. **Read the bundled templates**
41 - Read:
42 - `assets/planner-template.md`
43 - `assets/debugger-template.md`
44 - `assets/qa-tester-template.md`
45
464. **Generate three mode skills**
47 For each template:
48 - Adapt it to the project by adding:
49 - the `{slug}` mode name
50 - links to relevant memories (do not paste memory contents)
51 - project-specific verification commands (link to `suggested_commands-skl` for the canonical list)
52 - Write the resulting skill to:
53 - `./.{AGENT_NAME}/skills/{slug}-mode-planner/SKILL.md`
54 - `./.{AGENT_NAME}/skills/{slug}-mode-debugger/SKILL.md`
55 - `./.{AGENT_NAME}/skills/{slug}-mode-qa-tester/SKILL.md`
56
575. **Make the modes selectable via `$switching-modes`**
58 - If `./.{AGENT_NAME}/skills/switching-modes/` exists, update its mode registry to include the three new modes.
59 - Prefer editing an explicit “Mode registry” list in `./.{AGENT_NAME}/skills/switching-modes/SKILL.md` (if present).
60 - If it does not exist, create a **project-local** `./.{AGENT_NAME}/skills/switching-modes/SKILL.md` that:
61 - writes `./.{AGENT_NAME}/state.json` with `{ "mode": "<mode-name>" }`
62 - documents both baseline modes (if used) and the three new project modes
63 - start from `assets/switching-modes-stub.md` to avoid bikeshedding
64 - After this, switching is done by running:
65 - `$switching-modes {slug}-mode-planner`
66 - `$switching-modes {slug}-mode-debugger`
67 - `$switching-modes {slug}-mode-qa-tester`
68
696. **Validate the generated skills**
70 - Minimum manual checks:
71 - Each generated directory name exactly matches its SKILL frontmatter `name`.
72 - Each generated `description` is third-person and includes “Use when …”.
73 - Optional (if available): run `skills-ref validate` on each generated skill directory.
74
75## Required structure of each generated mode skill
76
77Each mode skill must be a valid Agent Skill.
78
79### Frontmatter
80
81Example for planner:
82
83```yaml
84---
85name: {slug}-mode-planner
86description: Behavioral mode for planning and design work in {slug}. Use when scoping changes, producing design docs, or deciding between approaches.
87---
88```
89
90### Body
91
92Include these sections (in any order):
93
94* **When to use** (triggers)
95* **Operating loop** (the step-by-step behavior)
96* **Question protocol** (how to ask questions; allow questions in all modes)
97* **Output discipline** (acceptance criteria + local verification; test-change guardrail)
98* **Project context pointers** (links to memories)
99
100Keep the body concise. If the mode needs lengthy reference material, create `references/` files and link them.
101
102## Adaptation rules
103
104When adapting templates:
105
106* Prefer links to memories, e.g. `../memories/project_overview-skl/SKILL.md`, not copy/paste.
107* Use the project’s terminology: module names, CLI names, test runner names, etc.
108* Avoid generic fluff. Encode actionable guardrails, checks, and concrete steps.
109* Ensure the mode is usable standalone by a future agent who has access to the memories.
110
111## Failure modes and how to handle them
112
113* **Unknown `{AGENT_NAME}`**: infer from the local agent folder present (e.g. `.claude`, `.codex`). If none exist, ask the user what agent folder to use.
114* **Mode name collisions**: if a target directory already exists, do not overwrite silently. Either append a suffix (e.g. `-v2`) or ask the user which to keep.
115* **No reliable test commands**: link to `suggested_commands-skl` and ask the user to confirm the correct test command(s) if missing.