Skip to content
Back to skills

Whip Add Skills

ASecurity

Role skill + manifest generator. Detects the repository's stack and writes each missing role skill (.claude/skills/{role}/SKILL.md, which /go runs on the whippet worker) with its Priority 1/2/3 manifest and quality-gate docs, following ACF conventions. Never writes agent files. --migrate converts the project's existing specialist agents into role skills.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 7, 2026
developmentjavascripttypescriptpythonrustgojavabashsqlreactvue

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 7, 2026

npx -y skills add fib7/acf-tools --skill whip-add-skills --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Whip Add Skills?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Whip Add Skills
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fib7-whip-add-skills/badge)](https://www.skillsdirectory.com/skills/fib7-whip-add-skills)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: whip-add-skills
description: Role skill + manifest generator. Detects the repository's stack and writes each missing role skill (.claude/skills/{role}/SKILL.md, which /go runs on the whippet worker) with its Priority 1/2/3 manifest and quality-gate docs, following ACF conventions. Never writes agent files. --migrate converts the project's existing specialist agents into role skills.
argument-hint: "[--backend=… --frontend=… --data=… --infrastructure=…] [devops] | --migrate [--dry-run] [agent-names…]"
allowed-tools:
  - Bash
  - Read
  - Write
  - Edit
  - Glob
  - Grep
  - mcp__perplexity__perplexity_search
---

# /whip-add-skills - Role Skill + Manifest Generator

This skill writes new role skills; it does not install prebuilt ones. For each role the repository's
stack needs and the project does not have yet, it writes a short role skill and a manifest that tells
whoever runs the role which docs to read for which kind of task. That split is the ACF manifest
convention (the 58-74% token-reduction pattern).

**What a role is.** A task's `Assigned Agent` field names its role. `/go` runs the task on the
installed agent of that name (`.claude/agents/<role>.md`) when there is one. Otherwise it runs the
task on the generic `whippet` worker and tells it to load the role skill
`.claude/skills/<role>/SKILL.md` first. An installed agent wins over a skill of the same name, so a
project that still has specialist agents keeps running them until it converts them with
`--migrate` (below).

**This skill never writes `.claude/agents/`.** The process rules (the worktree, code-only commits,
the `ACFW-RESULT` marker) live in `whippet` and in `/go`'s dispatch prompt. A role skill says only how
this kind of work is done in this repository: its domain, its scope and its quality gates.

## Two modes

```bash
/whip-add-skills [--backend=… --frontend=… --data=… --infrastructure=…] [devops]   # write missing role skills (Steps 1-8)
/whip-add-skills --migrate [--dry-run] [agent-names…]                       # convert specialist agents (Migrate mode)
```

---

## Purpose

For each missing role:
1. **Create the role skill**: `.claude/skills/{role}/SKILL.md` (short: domain, scope, gate commands)
2. **Create its manifest**: `docs/agents/{role}.md` (the full reference: Priority 1/2/3 docs)
3. **Generate quality gates** (if missing): each role gets its own stack's gates at its
   `{gates_path}` (Step 2B). The backend role reads `docs/development/quality-gates-{gate_stack}.md`.
   A frontend role (React, Vue, Next.js) reads `docs/development/quality-gates-nodejs.md`, even
   when the backend is Go or Python. A stack with no shipped doc (Rust) gets
   `quality-gates-{stack}.md` from the Step 6 template.
4. **Update configuration**: `.backlog/README.md`, `CLAUDE.md` (if exists)

**User arguments take priority over auto-detection.**

---

## Migrate mode: `--migrate`

Converts the project's specialist agents into role skills. A project set up before acf-whip 3.7.0
runs this once; a fresh `/whip-init` never writes specialist agents.

```bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/whip-add-skills/bin/migrate-agents.sh" [--dry-run] [name ...]
```

Run it from inside the repository (or add `--repo <root>`), and pass the user's agent names through
verbatim. **Always run it with `--dry-run` first**, show the user every line it prints, and run it for
real only after the user confirms that list (a dry run the user already saw in this conversation
counts). Converting deletes agent files. With no names it converts only the agents named like acf-whip specialists,
`*-engineer` and `devops`. Any other agent may serve the project outside acf-whip, so it is reported
(`SKIPPED|<name>|not named like an acf-whip specialist …`) and left alone; name it to convert it.

For each agent it converts, the script:
1. Writes `.claude/skills/<name>/SKILL.md`. The frontmatter is `name`, `description` (the agent's own,
   or a generated one when it has none) and `user-invocable: false`. A provenance comment follows,
   then the agent's body, verbatim. `model`, `color` and `tools` belong to an agent and are dropped.
2. Deletes the agent file.

It commits nothing: both changes stay in the working tree for review. The name is unchanged, so every
task's `Assigned Agent` keeps resolving; `/go` now runs those tasks on `whippet` with the skill loaded.

It never converts:
- **whip's process agents**: task-engineer, quality-reviewer, lean-architect, precommit, retro,
  research-agent and whippet. Named on the command line, each prints
  `SKIPPED|<name>|a whip process agent, not a role`; otherwise they are passed over silently.
- **workflow-architect**, which nothing uses since 3.7.0. Delete it instead:
  `git rm .claude/agents/workflow-architect.md` (`/whip-doctor` reports it as WARN `unused-agent`).
- **an agent file git does not track** (new, or gitignored): converting deletes it, and git is the only
  undo. Commit it first.
- **an agent whose frontmatter opens with `---` and never closes**: there is no body to carry over.
- **an agent whose skill already exists.** It never overwrites `.claude/skills/<name>/SKILL.md`. It
  prints SKIPPED and leaves the agent in place, and the agent keeps running the role until you merge
  it into the skill by hand and delete the agent file.

Output: one line per agent, then a summary.

```
MIGRATED|<name>|.claude/skills/<name>/SKILL.md
SKIPPED|<name>|<reason>
MIGRATE|migrated=N|skipped=M
```

Under `--dry-run` each `MIGRATED` line ends with `(dry run: nothing written)` and nothing changes.
Exit codes: 0 ok (also when there was nothing to do) · 1 usage (unknown flag) · 3 not a git repository, or a `--repo` that is not a directory.

Then:
1. Relay every line verbatim.
2. Show what changed: `git status --short -- .claude/agents .claude/skills`.
3. If `.claude/agents/whippet.md` is missing, say so: a migrated role then runs on the runtime's
   default subagent (`/whip-doctor` WARN `worker-not-installed`). `/whip-init` installs `whippet`.
4. Point out the model change. A specialist's `model:` frontmatter no longer applies: its tasks now
   run on `whippet`'s model (`model: sonnet` in `.claude/agents/whippet.md`). A role that needs a
   different model can stay an agent.
5. Tell the user to review and commit. The manifests in `docs/agents/` need no change; the skill
   reads the same file the agent did. A migrated body that still carries process steps (Step 0
   clean-checkout, the `ACFW-RESULT` marker) is harmless, since `whippet` carries the same rules.
   To undo one conversion of a tracked agent: `git checkout -- .claude/agents/<name>.md` and
   `rm -r .claude/skills/<name>`.
6. Run `/whip-doctor`. No `unknown-agent` FATAL should name a migrated role.

Migrate mode stops here. It does not run Steps 1-8.

---

## Execution Flow

### Step 1: Parse User Arguments

Flags override auto-detection. For example:

```bash
/whip-add-skills --backend=go --frontend=nextjs
/whip-add-skills --backend=python --data=dagster
/whip-add-skills --infrastructure=k8s
```

**Supported Flags**:
- `--backend=go|python|nodejs|rust`
- `--frontend=react|nextjs|vue|angular`
- `--data=dagster|bentoml|airflow`
- `--infrastructure=k8s|docker|terraform`
- `devops` (a bare word): add the `devops` role, which no detected slot produces. Fill its template
  from the deployment, CI and monitoring the repository shows (`/whip-init` Step 5.5 lists the
  signals). Set `want_devops=1` for Step 2F.

A flag decides its own slot outright, whatever the repository looks like: `--backend=python` makes a
python-engineer role with the Python gates in a repo whose only manifest is `package.json`.
Auto-detection fills only the slots no flag names (see Mixed below). Store the flags in `FLAGS` (for
example `FLAGS='--backend=python --frontend=nextjs'`): the Step 2B, 6 and 7C blocks pass them to the
detector, which applies `--backend=` and `--frontend=` and ignores the rest. Apply `--data=` and
`--infrastructure=` yourself, as the values of `data` and `infra` in Step 2B.

### Step 2: Repository Analysis (for the slots no flag names)

#### A. Codebase Exploration

Scan the directory tree, 3-4 levels deep:

```bash
# Directory scan
tree -L 3 -d

# File type analysis
find . -type f -name "*.go" | wc -l
find . -type f -name "*.py" | wc -l
find . -type f -name "*.ts" -o -name "*.tsx" | wc -l
```

#### B. Tech Stack Indicators

**Backend and Frontend Detection**: the same detector `/whip-init` runs, so the two skills never
disagree about a stack. It prints `key='value'` lines from a fixed vocabulary (the key table is in
`/whip-init` Step 1 and in the script's header):

```bash
FLAGS=''   # Step 1's flags, verbatim; empty when the user gave none
eval "$(bash "${CLAUDE_PLUGIN_ROOT}/content/quality-gates/detect-stack.sh" "$FLAGS")"
echo "backend=${backend:-none} (gates: ${gate_stack:-none}, ${gates_doc:-none})"
echo "frontend=${frontend:-none} (gates: ${frontend_gate_stack:-none}, ${frontend_gates_doc:-none})"
[ -n "$node_framework" ] && echo "node: framework=$node_framework test=$node_test_runner typescript=$node_typescript linter=$node_linter formatter=$node_formatter"

# Framework hints the detector does not report (Go/Python only):
if [ "$backend" = go ] && [ -f go.mod ]; then
  grep -q "github.com/gin-gonic/gin" go.mod && framework="gin"
  grep -q "github.com/labstack/echo" go.mod && framework="echo"
fi
if [ "$backend" = python ]; then
  for m in requirements.txt requirements-dev.txt pyproject.toml setup.py setup.cfg Pipfile; do
    [ -f "$m" ] || continue
    grep -qi "fastapi" "$m" && framework="fastapi"
    grep -qi "django" "$m" && framework="django"
    grep -qi "langchain\|langgraph" "$m" && ml="true"
  done
fi
```

A `package.json` with no Express/Fastify/NestJS/Next/React/Vue is a plain Node.js project:
`backend=nodejs`, `node_framework=none`, the test runner read from its `"test"` script. It gets a
`nodejs-engineer` role, and its gates are only the ones `node_*_cmd` reports (often `npm test` alone).
The backend is first match (`go.mod`, then a Python manifest, then Node.js), and Next.js wins over
React because it ships React.

**Each role's `{gates_path}`**, used by its manifest (Step 5), CLAUDE.md entry (Step 7B) and
checks (Step 8). One `gate_stack` cannot serve a polyglot repo: on FastAPI plus React it is `python`,
and a react-engineer sent to ruff, mypy and pytest can pass none of them.

| Role | `{gates_path}` |
|------|----------------|
| backend (`{backend}-engineer`) | `docs/development/quality-gates-{gate_stack}.md`. With no shipped doc (`gate_stack` empty, e.g. `--backend=rust`): `docs/development/quality-gates-{backend}.md`, written in Step 6 |
| frontend (`{frontend}-engineer`) | `docs/development/quality-gates-{frontend_gate_stack}.md`, which is always `quality-gates-nodejs.md` |
| data, infrastructure, devops | the backend's |

**Data/ML Detection** (skip when `--data=` named the slot):
```bash
# Dagster
[ -d "dagster" ] || grep -q "dagster" requirements.txt && data="dagster"

# BentoML
grep -q "bentoml" requirements.txt && ml_ops="bentoml"

# Airflow
grep -q "airflow" requirements.txt && data="airflow"
```

**Infrastructure Detection** (skip when `--infrastructure=` named the slot):
```bash
# Kubernetes
[ -d "k8s" ] || [ -d "kubernetes" ] && infra="k8s"

# Docker Compose
[ -f "docker-compose.yml" ] && infra="docker"

# Terraform
[ -d "terraform" ] && infra="terraform"
```

#### C. Documentation & Configuration Analysis

**Check for documentation index and configuration**:

```bash
# Check if project has documentation hub
if [ -f "docs/README.md" ]; then
  echo "📋 Found docs/README.md - Claude will read it for documentation discovery"
fi

# Check CLAUDE.md for tech stack mentions
if [ -f "CLAUDE.md" ]; then
  echo "📋 Reading CLAUDE.md for project configuration..."
  grep -i "technology\|tech stack\|languages\|frameworks" CLAUDE.md
fi
```

Then read whichever of the two files exist, for the project's structure and stack.

#### D. Existing Role Check

A project's roles are its installed agents plus its role skills. List both, so you never duplicate a
role that already exists:

```bash
existing_agents=$(ls -1 .claude/agents/*.md 2>/dev/null | xargs -n1 basename | sed 's/\.md$//')
existing_skills=$(ls -1d .claude/skills/*/SKILL.md 2>/dev/null | sed -E 's#/SKILL\.md$##; s#.*/##')
```

#### E. Complexity Assessment

```bash
# Project size
total_files=$(find . -type f -name "*.go" -o -name "*.py" -o -name "*.ts" | wc -l)
total_loc=$(find . -type f \( -name "*.go" -o -name "*.py" -o -name "*.ts" \) -exec wc -l {} + | tail -1 | awk '{print $(1)}')

# Polyglot detection
languages=0
[ -f "go.mod" ] && languages=$((languages + 1))
[ -f "requirements.txt" ] && languages=$((languages + 1))
[ -f "package.json" ] && languages=$((languages + 1))

echo "Project size: $total_files files, $total_loc LOC"
echo "Languages detected: $languages"
```

#### F. Gap Analysis

Compare the roles the repo needs with the roles it has. A role an installed agent already covers is
not missing: that agent runs its tasks, and `--migrate` converts it.

```bash
is_agent() { printf '%s\n' "$existing_agents" | grep -qxF "${1}"; }
is_skill() { printf '%s\n' "$existing_skills" | grep -qxF "${1}"; }
wanted=()
[ -n "$backend" ]  && wanted+=("${backend}-engineer")
[ -n "$frontend" ] && wanted+=("${frontend}-engineer")
[ -n "$data" ]     && wanted+=("data-engineer")
[ -n "$infra" ]    && wanted+=("infrastructure-engineer")   # one role, whatever the platform
[ "${want_devops:-0}" = 1 ] && wanted+=("devops")

needs=()
for r in ${wanted[@]+"${wanted[@]}"}; do
  if is_skill "$r"; then echo "✓ role skill $r exists"
  elif is_agent "$r"; then echo "✓ $r is an installed agent and runs its tasks (/whip-add-skills --migrate converts it)"
  else needs+=("$r"); fi
done
echo "Missing roles: ${needs[*]:-none}"
```

### Step 3: Study Existing Conventions

#### A. Study Role Skills and Agents

Read the role skills already in `.claude/skills/` and the agents in `.claude/agents/`, including any
specialist agents and the universal ones `/whip-init` generated:

```bash
grep -A6 '^---' .claude/skills/*/SKILL.md 2>/dev/null   # role-skill frontmatter
grep -A6 '^---' .claude/agents/*.md 2>/dev/null          # agent frontmatter
grep -E '^## ' .claude/skills/*/SKILL.md .claude/agents/*.md 2>/dev/null   # section order
```

**Extract Conventions**:
- Section headers and order
- Format of the read-your-manifest section
- Scope boundaries format (what the role covers, and which role or agent owns the rest)
- Quality gates section format

#### B. Study Manifest Patterns

Read the manifests in `docs/agents/`, if there are any:

```bash
# Extract manifest structure
grep "## Priority 1:" docs/agents/*.md -A 20
grep "## Priority 2:" docs/agents/*.md -A 20
grep "## Navigation Guidance" docs/agents/*.md -A 10
grep "## Anti-Patterns" docs/agents/*.md -A 15
```

**Extract Conventions**:
- Priority 1/2/3 documentation lists
- Navigation guidance by task type
- Anti-patterns section (5-10 examples)
- Integration points format
- Quick reference format

#### C. Extract Stack-Specific Patterns

Research quality-gate practice for the target stack:

```bash
# Use Perplexity for best practices
mcp__perplexity__perplexity_search:
  query: "{tech-stack} quality gates best practices linting testing coverage"
  recency: "month"

mcp__perplexity__perplexity_search:
  query: "{tech-stack} testing strategy unit integration e2e coverage thresholds"
  recency: "month"
```

### Step 4: Generate Role Skill Files

For each missing role, build `.claude/skills/{role}/SKILL.md` (create the directory) from the plugin's
pattern for its kind, in `${CLAUDE_PLUGIN_ROOT}/content/skill-patterns/`:

| Role | Pattern |
|------|---------|
| `{backend}-engineer` | `backend-skill-pattern.md` |
| `{frontend}-engineer` | `frontend-skill-pattern.md` |
| `data-engineer` | `data-skill-pattern.md` |
| `infrastructure-engineer` | `infrastructure-skill-pattern.md` |
| `devops` | `devops-skill-pattern.md` |

Each pattern lists its template variables and holds the skill template. Fill every variable from what
Step 2 found and the project's own scripts, and follow the conventions Step 3 extracted. Never
overwrite an existing `.claude/skills/{role}/SKILL.md`.

The frontmatter has exactly three fields. `name` equals the directory name, which equals the role a
task's `Assigned Agent` carries. `description` says what work the role covers and when to load it,
because `whippet` loads other skills by matching their descriptions. `user-invocable: false` keeps the
skill out of the slash-command menu; the Skill tool still loads it.

```yaml
---
name: go-engineer
description: Go backend work in this repository: API endpoints, business logic, persistence (PostgreSQL) and service integration with Gin. Load it before implementing or reviewing a task whose role is go-engineer, or any change to the backend code.
user-invocable: false
---
```

```yaml
---
name: react-engineer
description: TypeScript frontend work in this repository: UI components, state management, user interactions and integration with backend services, using React. Load it before implementing or reviewing a task whose role is react-engineer, or any change to the frontend code.
user-invocable: false
---
```

#### Quality Gate Commands by Stack

These fill the skill's Stack-Specific Commands block and the manifest's Quality Gates section.

**Go**:
```bash
golangci-lint run ./...
go test ./... -v -race -cover
go build ./...
go mod tidy && git diff --exit-code go.mod go.sum
```

**Python**:
```bash
ruff check .
ruff format . --check
mypy . --strict
pytest --cov --cov-report=term
```

**Node.js** (plain Node, Express, Fastify, NestJS; JavaScript or TypeScript). Use the detector's
`node_*_cmd` values and drop any that are empty. A plain project with `"test": "node --test"` has
`npm test` and nothing else; never add `eslint`, `tsc` or a build step it does not have:
```bash
npm test                          # node_test_cmd
npm run lint                      # node_lint_cmd, when the project has a linter
npx tsc --noEmit                  # node_typecheck_cmd, TypeScript projects only
npm run build                     # node_build_cmd, when package.json defines build
```

**React**:
```bash
npm run lint
npm run typecheck
npm test -- --coverage
npm run build
```

**Next.js**:
```bash
pnpm lint
pnpm typecheck
pnpm test --coverage
pnpm build
```

The React and Next.js blocks are examples. On any `package.json` project the detector's
`node_*_cmd` values win: a React app with no `typecheck` script gets no typecheck line.

### Step 5: Generate Role Manifest Files

For each missing role, create `docs/agents/{role}.md`, unless it already exists (an agent's manifest
serves the role skill unchanged). Build it from the plugin's pattern for its kind, in
`${CLAUDE_PLUGIN_ROOT}/content/agent-patterns/manifests/`:
- `backend-manifest-pattern.md`
- `frontend-manifest-pattern.md`
- `data-manifest-pattern.md`
- `infrastructure-manifest-pattern.md`
- `devops-manifest-pattern.md`

Each pattern carries the full template. Whatever the kind, the manifest must have:
- **Priority 1: MUST READ**: `.backlog/README.md`, `docs/acf/style/task-descriptions.md`,
  `docs/acf/backlog/task-template.md`, the role's own `{gates_path}` (Step 2B), and the project's
  architecture docs. A frontend manifest that points at the backend's gates is wrong.
- **Priority 2: SHOULD READ** lists by task type, and **Priority 3: REFERENCE** for the situational docs.
- **Navigation Guidance**: a reading path per task type.
- **Scope Boundaries**: what the role covers, and which role or agent owns the rest.
- **Quality Gates**: the commands from Step 4, coverage thresholds, and zero bypass tolerance.
- **Concurrency**: Step 0 is `clean-checkout-before-task`; commits are code-only, on `worktree/<slug>`.
- **Anti-Patterns**: 5-10 entries, each with its consequence.

Name the project's real documentation paths; mark a path the project does not have yet
*(if present)*, as the patterns do.

### Step 6: Generate Quality Gate Documentation (if missing)

Copy the shipped gates doc for the backend, and for the frontend if there is one. Leave any that
already exists. Each copy matches its own stack: a plain Node.js project gets `nodejs.md`, not the
Next.js/TypeScript one, and a React app next to a Python backend gets `quality-gates-nodejs.md` beside
`quality-gates-python.md`. A flag names the stack outright, so `--backend=python` in a repo whose
only manifest is `package.json` installs the Python gates.

```bash
FLAGS=''   # Step 1's flags, verbatim; empty when the user gave none
eval "$(bash "${CLAUDE_PLUGIN_ROOT}/content/quality-gates/detect-stack.sh" "$FLAGS")"
last_d=''
for pair in "${gate_stack}:${gates_doc}" "${frontend_gate_stack}:${frontend_gates_doc}"; do
  stack=${pair%%:*}; doc=${pair#*:}
  [ -n "$stack" ] && [ -n "$doc" ] || continue
  d="docs/development/quality-gates-${stack}.md"
  [ "$d" = "${last_d:-}" ] && continue   # backend and frontend share the Node.js doc
  last_d=$d
  if [ -f "$d" ]; then echo "✓ $d exists, left as is"; continue; fi
  mkdir -p docs/development
  cp "${CLAUDE_PLUGIN_ROOT}/content/quality-gates/${doc}" "$d" && echo "✓ Installed $d (from ${doc})"
done
[ -n "$backend" ] && [ -z "$gate_stack" ] && echo "NOTE: no shipped gates doc for ${backend}: write docs/development/quality-gates-${backend}.md from the template below"
true
```

Only for a stack with no shipped doc (Rust, or any `--backend=` value other than go, python and
nodejs), create `docs/development/quality-gates-{stack}.md` from this template. Fill each command slot
with a tool the project has and drop the rest:

```markdown
# Quality Gates - {Stack}

## Zero Bypass Tolerance

**Never bypass a gate.** None of these is allowed:
- `git commit --no-verify`
- `SKIP={hook-name}` in environment
- `git commit -n`
- Disabling pre-commit hooks
- Lowering coverage thresholds to pass builds
- Commenting out failing tests

**Enforcement**: CI must re-run every quality gate, and a detected bypass is rejected outright.

## Quality Requirements

### 1. Code Linting
```bash
{linter-command}
```

### 2. Code Formatting
```bash
{formatter-command}
```

### 3. Type Checking
```bash
{type-checker-command}
```

### 4. Testing
```bash
{test-command}
```

**Coverage Thresholds**:
| Code Type | Minimum Coverage |
|-----------|------------------|
| API endpoints | 90-95% |
| Core logic | 90% |
| Services | 85-90% |
| Utilities | 85% |

### 5. Build Verification
```bash
{build-command}
```

## Pre-commit Hooks

See `.pre-commit-config.yaml` for automated enforcement.

## Quality Gate Protocol

**Failure Handling**:
1. Attempts 1-10: fix the failure the gate reports
2. After 10 attempts: move the task to blocked with a failure report
3. On a systemic issue (3+ similar failures): run /retro

## Continuous Integration

CI must run every quality gate on every PR:
- Linting
- Type checking
- Full test suite with coverage
- Build verification

A PR merges only when every gate passes.
```

### Step 7: Update Project Configuration

#### A. Update `.backlog/README.md`

Update the role roster line **in place**. Never re-render the template over an existing README.
`.backlog/README.md` belongs to the project: its gate commands, coverage thresholds and evidence
rules are the team's, not the sample's. An earlier version re-rendered the whole file to change one
line, which replaced all of them with the generic defaults while the report said only "(agent list
updated)". Re-rendering isn't idempotent either: the placeholder is gone after the first render.

The roster is the project's roles: every role skill, plus every installed agent that is not one of
acf-whip's own (task-engineer, quality-reviewer, lean-architect, precommit, retro, research-agent,
whippet, workflow-architect). A specialist agent still runs its tasks, so it stays on the list.

```python
WHIP_AGENTS = {"task-engineer", "quality-reviewer", "lean-architect", "precommit", "retro",
               "research-agent", "whippet", "workflow-architect"}
skills = [basename(dirname(s)) for s in glob(".claude/skills/*/SKILL.md")]
agents = [basename(a).replace(".md", "") for a in glob(".claude/agents/*.md")]
roles = sorted(set(skills) | {a for a in agents if a not in WHIP_AGENTS})
line = "- **" + ", ".join(roles) + "**: Specialist implementation agents"

if exists(".backlog/README.md"):
    # Replace ONLY the roster line; everything else is the project's.
    body = read(".backlog/README.md")
    new_body, n = re.subn(r"^- \*\*.*\*\*: Specialist implementation agents$",
                          line, body, count=1, flags=re.M)
    if n:
        write(".backlog/README.md", new_body)
    else:
        # The line was renamed or removed by the project. Say so; do not "repair" it by clobbering.
        report("`.backlog/README.md` has no role-roster line to update — add this line yourself "
               "if you want it tracked:\n    " + line)
else:
    # No README yet: the full template is correct, and there is nothing to lose.
    template = read("${CLAUDE_PLUGIN_ROOT}/content/backlog/README.sample.md")
    write(".backlog/README.md", template.replace("{{IMPLEMENTER_AGENTS}}", ", ".join(roles)))
```

The line keeps its old suffix, `Specialist implementation agents`, so the same match finds it in a
README written by any earlier release.

#### B. Update `CLAUDE.md` (if exists)

Add each new role to the `### Role skills` table `/whip-init` writes, replacing a
`(TBD via /whip-add-skills)` row for the same role:

```markdown
| {Domain} | ✓ {role} | {scope-description}; manifest `docs/agents/{role}.md`; gates `{gates_path}` |
```

An older `CLAUDE.md` may carry `### Specialist Agent Matrix` or `## Agent Assignments` instead. Add
the rows there and leave the heading alone: the file is the project's. With no such section at all,
add a `### Role skills` section holding the table.

#### C. Install Pre-commit Hooks (if not present)

The shipped configs run only tools the project has, and keep every hook out of the paths acf-whip
commits itself: `docs/cycles/`, `docs/acf/`, `.backlog/` and `.acfwhip/`. An existing
`.pre-commit-config.yaml` is the operator's and is never replaced. There is one config per repo, so
it is the backend's; a frontend next to a Go or Python backend keeps its gates in
`quality-gates-nodejs.md`, which its role runs.

```bash
FLAGS=''   # Step 1's flags, verbatim; empty when the user gave none
eval "$(bash "${CLAUDE_PLUGIN_ROOT}/content/quality-gates/detect-stack.sh" "$FLAGS")"
f=.pre-commit-config.yaml
if [ -f "$f" ]; then
  echo "✓ $f exists: it is the operator's, left alone"
elif [ -z "$gate_stack" ]; then
  echo "NOTE: no shipped pre-commit config for ${backend:-this repo}: none installed"
elif [ "$gate_stack" = nodejs ] && [ ! -f package.json ]; then
  echo "NOTE: no package.json at the repo root. The Node.js config runs npm scripts from the root, so it was not installed."
else
  cp "${CLAUDE_PLUGIN_ROOT}/content/pre-commit-configs/.pre-commit-config-${gate_stack}.yaml" "$f" \
    && echo "✓ Installed $f (${gate_stack})"
fi
```

### Step 8: Validation & Report

#### Validation Checks

1. **Role skill valid**:
```bash
s=.claude/skills/{role}/SKILL.md
head -1 "$s" | grep -qx -- '---'                         # frontmatter opens on line 1
grep -qx 'name: {role}' "$s"                             # name matches the directory
grep -q '^description: ' "$s"
grep -qx 'user-invocable: false' "$s"
grep -q "docs/agents/{role}.md" "$s"                     # points at its manifest
[ ! -e .claude/agents/{role}.md ] || echo "NOTE: .claude/agents/{role}.md is installed and wins over this skill"
```

2. **Manifest file valid**:
```bash
# Priority sections present
grep "## Priority 1:" docs/agents/{role}.md
grep "## Priority 2:" docs/agents/{role}.md
grep "## Priority 3:" docs/agents/{role}.md

# Anti-patterns section has 5-10 entries. The manifest templates write them as a numbered list
# ("1. Skip manifest reading → Rework"); a "### 1." heading also counts. Only lines inside the
# "## Anti-Patterns" section are counted, so numbered lists elsewhere in the manifest do not inflate it.
n=$(awk '
  /^## / { in_ap = ($(0) ~ /^## Anti-Patterns/); next }
  in_ap && /^(### )?[0-9]+\. / { n++ }
  END { print n + 0 }' docs/agents/{role}.md)
if [ "$n" -ge 5 ] && [ "$n" -le 10 ]; then echo "✓ $n anti-patterns"; else echo "FAIL: $n anti-patterns in docs/agents/{role}.md (want 5-10)"; fi
```

3. **Quality gate docs created**, one per role's `{gates_path}`:
```bash
[ -f "{gates_path}" ]
```

4. **Cross-references valid**:
```bash
# Manifest references ITS OWN gates (a frontend manifest pointing at the backend's gates is a FAIL)
grep -q "{gates_path}" docs/agents/{role}.md

# README lists the role
grep -q "{role}" .backlog/README.md
```

5. **The worker exists**: `[ -f .claude/agents/whippet.md ]`. Without it a role skill's tasks run on
   the runtime's default subagent; say so and point at `/whip-init`.

#### Success Report

```
✅ Created {N} role skills + manifests

{For each role created:}

📋 {role}
   - Role skill: .claude/skills/{role}/SKILL.md (run on whippet)
   - Manifest: docs/agents/{role}.md
     ├── Priority 1: {N} docs (MUST READ)
     ├── Priority 2: {N} docs (SHOULD READ)
     ├── Priority 3: {N} docs (REFERENCE)
     ├── Navigation Guidance: {N} task types
     └── Anti-Patterns: {N} examples
   - Quality Gates: {gates_path}
     ├── Linting: {linter-command}
     ├── Type Checking: {type-checker-command}
     ├── Testing: {test-command} (coverage: {threshold}%)
     └── Build: {build-command}
   - Tech Stack: {technologies}
   - Scope: {scope-description}

{For each role an installed agent covers:}
   ✓ {role}: .claude/agents/{role}.md runs it (/whip-add-skills --migrate converts it)

Updated Configuration:
  ✓ .backlog/README.md (role roster updated)
  ✓ CLAUDE.md (role rows added)
  ✓ .pre-commit-config.yaml ({gate_stack}; an existing one is left alone)

Next Steps:
  1. Review the role skills in .claude/skills/
  2. Review manifests in docs/agents/
  3. Customize Priority 2/3 docs if needed
  4. Run /task to decompose work
  5. Run /go to execute backlog
```

---

## Usage Examples

### Auto-Detection

```bash
/whip-add-skills
```

On a repo with Go, React and Kubernetes, creates the role skills:
- go-engineer
- react-engineer
- infrastructure-engineer

### User Specification (Priority)

```bash
/whip-add-skills --backend=python --frontend=nextjs
```

Both slots are named, so detection decides neither. Creates:
- python-engineer, reading `docs/development/quality-gates-python.md`
- nextjs-engineer, reading `docs/development/quality-gates-nodejs.md` (from `nextjs-typescript.md`)

### Mixed

```bash
/whip-add-skills --backend=go
```

Creates go-engineer from the flag and auto-detects the remaining slots.

### Migrating a pre-3.7.0 project

```bash
/whip-add-skills --migrate --dry-run     # list what would convert
/whip-add-skills --migrate               # convert every *-engineer and devops agent
/whip-add-skills --migrate go-engineer   # convert only go-engineer
```

---

## Success Criteria

- A role skill for each new role in `.claude/skills/{role}/SKILL.md`, with `name`, `description` and
  `user-invocable: false`, and no new file in `.claude/agents/`
- A manifest for each in `docs/agents/`, with the Priority 1/2/3 structure, navigation guidance by
  task type, and 5-10 anti-patterns, each with its explanation
- A quality-gates doc at every role's `{gates_path}`
- `.backlog/README.md` lists the new roles
- `CLAUDE.md` lists them, when the file exists
- A pre-commit config for the backend's stack, except where Step 7C skips it: the repo already has
  one, none ships for the stack, or a Node.js stack has no root `package.json`
- Every cross-reference resolves and every Step 8 check passes

---

## Anti-Patterns

| Never | Always |
|-------|--------|
| Write a specialist agent file in `.claude/agents/` | Write a role skill; `/go` runs it on `whippet` |
| Write a skill for a role an installed agent already runs | Leave the agent; `--migrate` converts it |
| Copy an existing skill without adapting it to the stack | Customize its quality gates, tech stack and scope boundaries |
| Create a role skill without its manifest | Create both |
| List generic docs in Priority 1/2/3 | Name the project's real documentation paths |
| List anti-patterns without explanations | Give each one its consequence |
| Give a new skill a different structure from the existing ones | Study the existing skills and agents and follow their conventions |

Files in this skill

  • SKILL.md32 KB
  • bin/migrate-agents.sh6.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.