# Cw Slice

Use before writing code for any Codewhale feature, upgrade, or refactor: find the...

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

## Install

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

## Description

Use before writing code for any Codewhale feature, upgrade, or refactor: find the existing owner of the behavior, bound the change to one reviewable slice, and fix the evidence bar before you start.

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

# cw-slice

The expensive mistake in this repo is not a bad implementation, it is a second
implementation. A new `model_*`, `*_config`, `provider_*`, or "bridge" module
beside the one that already does the job ships two systems and a comment that is
no longer true. This skill is the ponytail ladder's rung 2 with commands
attached: **find the thing that already exists, then edit it.**

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

## When to use

- Any feature, upgrade, refactor, or "make X work like Y" request.
- Before creating a new module, trait, config struct, or command.
- When a plan or issue tells you to build something and you have not yet
  confirmed it does not already exist.

## Workflow

1. **Walk the ladder before opening an editor** (`AGENTS.md`, "The ponytail
   method", not restated here, since a second copy is what rung 2 forbids).
   Stop at the first rung that answers. The ladder runs *after* reading the
   code, never instead of it: a short diff written without reading the call
   sites is a guess, not a small change. State the rung only when the choice
   isn't obvious from the diff itself.

2. **Grep for the predecessor.** This is the step that gets skipped and the one
   that costs the most:
   ```bash
   grep -rn "<the concept, in the words the code would use>" crates --include='*.rs' | head -40
   ls crates
   grep -rln 'model_\|_config\|provider_' crates/*/src --include='*.rs' | head -30
   ```
   Search behavior and symbols, not just filenames. If you find an owner, edit
   it. If you are still adding a new layer, its commit message must name the
   predecessor it replaces, otherwise you are editing the wrong file.

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