# Cw Gates

Use before claiming any Codewhale change is done, green, or ready to land: the...

- Repository: https://github.com/codewhale-hq/Codewhale (41164 stars)
- Category: Testing
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add codewhale-hq/Codewhale --skill cw-gates -g -a claude-code -y`
Codex: `npx skills add codewhale-hq/Codewhale --skill cw-gates -g -a codex -y`
Cursor: `npx skills add codewhale-hq/Codewhale --skill cw-gates -g -a cursor -y`
Gemini CLI: `npx skills add codewhale-hq/Codewhale --skill cw-gates -g -a gemini-cli -y`

## Description

Use before claiming any Codewhale change is done, green, or ready to land: the focused-to-broad verification ladder, the budget checks CI enforces, and the rules for what counts as a passing test.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# cw-gates

Pick the smallest evidence that answers the actual risk, then quote the real
output. This repo has been burned twice by the alternative: an exit code
mistaken for a pass, and a harness whose scoring line silently reported
unevaluated rows as green. Assertions without command output are not evidence.

Stage 3 of the loop: [cw-orient](../cw-orient/SKILL.md) →
[cw-slice](../cw-slice/SKILL.md) → **gates** →
[cw-dogfood](../cw-dogfood/SKILL.md) → [cw-land](../cw-land/SKILL.md) →
[cw-handoff](../cw-handoff/SKILL.md).

## When to use

- Before saying "done", "green", "passing", "fixed", or "ready to land".
- Before a dogfood build, never install an ungated binary.
- When asked to "run the gates" or to prove a change is safe.

For release work, follow `docs/RELEASE_CHECKLIST.md`; it adds the
version-drift gate and the exhaustive release validation on top of this ladder,
and [cw-dogfood](../cw-dogfood/SKILL.md) owns the manual TUI QA targets.

## Workflow

Climb only as far as the risk requires. Say where you stopped and what you
skipped.

Native Rust builds go through `scripts/dev-test.sh` or `scripts/dev-cargo.sh`,
which take the machine's build slot (`scripts/build-lock.py`; at most two
native builds per machine). Raw `cargo` bypasses the lock.

### Rung 1, always, and cheap

```bash
cargo fmt --all -- --check
git diff --check
```

### Rung 2, the area that owns the change

`scripts/dev-test.sh` maps an area or a source path to the fastest correct
invocation, and applies the isolated build-dir topology
(`docs/BUILD_PERFORMANCE.md`):

```bash
scripts/dev-test.sh --list
scripts/dev-test.sh crates/command-contract/src/elapsed.rs      # path → area + filter
scripts/dev-test.sh tui tools::                    # area + filter
scripts/dev-test.sh config
```

The rest: https://github.com/codewhale-hq/Codewhale/blob/HEAD/docs/skills/cw-gates/SKILL.md
