Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Dev Add Command?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/teamrig-dev-add-command)
---
name: dev-add-command
description: Add a teamrig CLI command, or a flag to one, with its help text, guide section, docs rows and tests, so the specs holding the docs to the CLI pass.
---
# Add a command
A command is for all users (CONTRIBUTING.md, Where a change lives): build it for any team, with what differs per team
read from the team config, never one team's names or paths, and on every AI CLI (`dev-every-ai-cli`): what it asks of
the host goes through the host port. A command is an entry in `COMMANDS` in `src/cli/run.ts`. Three docs are held to the CLI by specs, so a command or
flag missing from any of them fails `npm test`. Hold it to
[What a change is held to](../../../CONTRIBUTING.md#what-a-change-is-held-to): reuse the helpers its group's file
already has, keep the handler to one job behind the ports the fakes in `src/testing/` stand in for, and name its
risks in the pull request.
1. Write the handler in `src/cli/commands/` (a new file, or its group's file such as `inbox.ts`), with its spec
beside it, using the fakes in `src/testing/` for time, disks and git.
2. Add its entry to `COMMANDS` in `src/cli/run.ts`: its `flags`, its `switches` (flags that take no value), `rest`
when it runs a command line given after `--`, its `effect` (`read`, `write` or `internal`: what `/teamrig` may
run for the user) and a lazy `load`, so a hook that runs on every tool call loads only its own code.
3. Add its lines to `USAGE` in the same file: `teamrig help` prints them, and `teamrig <command> --help` its own.
4. Copy the output of `node src/cli/main.ts help` into the `## Every command` text block of `docs/commands.md`
(held by `tools/docs/commands-doc.test.ts`).
5. Add a `### teamrig <command>` section to `plugins/teamrig/skills/teamrig-guide/commands.md` naming exactly its
flags (held by `tools/docs/llm-guide.test.ts`, which also checks that every `teamrig` line in the guide and in
`llms.txt` is one the CLI reads; `tools/docs/skill-commands.test.ts` checks the same in every skill).
6. Add its row to `docs/features.md` (held by `tools/docs/features-doc.test.ts`).
7. Run `npm run docs:images`: the commands picture is drawn by running the CLI, and `npm run check` fails while it is
stale.
8. Land it with `dev-ship-change` as a `feat` commit: the release pull request raises the version, and the release
workflow builds the dist.
## Traps
- A new flag on an existing command needs steps 2 to 6 too: the help line, the guide section's flags, the docs.
- The guide is a skill every user's Claude reads; describe what the command does for the user and its refusals, not
how it is built.
- Changing a command's `effect` (say `read` to `write` once it writes) breaks three specs that list each command's
effect: `src/cli/effects.test.ts`, `src/cli/slash.test.ts` and `src/slash/plan.test.ts` (what `/teamrig` runs at
once). Update them in the commit that changes the effect, and run the `src/cli` and `src/slash` specs, not only
the command's own.
Last verified: 2026-10-26