本文へ移動
cccskills
無料GitHub で公開日本語紹介

cw-slice

Codewhaleの機能追加や改修前に既存の実装と呼び出し元を調べ、レビュー可能な変更範囲と検証方法を決めるスキル。重複実装や移行途中の放置を避けます。

原文原文の説明を見る

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.

インストール方法を見る

こんなときに便利

  • 機能追加前に既存コードを探したいとき
  • リファクタリングの変更範囲の整理
  • 実装前に検証方法を決めたいとき
  • 移行範囲と残る呼び出し元の確認

日本語での紹介

できること

Codewhaleの改修前に、対象の動作を担う既存コードと呼び出し元を調べ、変更範囲と検証方法を整理します。ファイル名だけでなく動作やシンボルも検索し、既存の実装を修正する方針を検討します。編集前には、対象ファイルに適用されるAGENTS.mdや設計資料、守るべき構造上の約束も確認します。

こんなときに便利

機能追加、アップグレード、リファクタリングに着手するときや、新しいモジュールを作る前に使います。一度のレビューで確認できる、まとまりのある変更へ絞りたい場合に向いています。共通化で呼び出し側のコードが減るか、移行が最後の利用箇所まで完了するかも検討します。

使い方の例

  • 「この機能を担う既存実装と呼び出し元を調べて」
  • 「改修を一度にレビューできる範囲に絞って」
  • 「実装前に、動作を証明する既存チェックを決めて」

注意点

Codewhaleのコード構成と開発ルールを前提にしています。関連するcw-gatesやcw-dogfoodによる確認が必要かも判断します。原文では、新規テストやコードコメントの追加は明示的な依頼がある場合に限り、変更で不適切になった既存テストは更新または削除する方針です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md6.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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 → slice → cw-gates → cw-dogfood → cw-land → cw-handoff.

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:

    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.

  3. Check the contracts you are about to walk into. One of these is guard-tested, the rest are convention — either way, move them with their code, not around it:

    • One turn loop: crates/tui/src/core/engine/turn_loop.rs, guarded by crates/core/tests/single_turn_loop.rs. A second loop fails the guard; changing the shape means changing the guard with it.
    • One base prompt: BASE_PROMPT in crates/tui/src/prompts/text.rs.
    • The subagent tool is agent; agent_open / agent_eval / agent_close / delegate_to_agent are removed surfaces. If the shape must move, move the code and add the guard test that judges the new shape — the convention is not a fence around the area.
    • The system prompt + tool catalog are a session-pinned KV-cache prefix (docs/CACHE.md). Any new session-context contributor must state its cache effect — frozen prefix vs. append-only history. Never splice a volatile fact into the prefix.
    • crates/tui/src/core/ is a module inside the TUI crate. crates/core is a different crate that runs no turns. Do not confuse them.
    • Repeatedly misidentified as dead, verify consumers before removing: runtime/src/context_budget.rs, tui/src/model_registry.rs, runtime/src/prompt_zones.rs, tui/src/tools/remember.rs, config/src/route/.
  4. Read the scoped guidance for the files you will touch. crates/tui/AGENTS.md owns the UI contracts (one owner per fact, codewhale_palette::grammar semantics, typed state enums, toast routing, tr(locale, MessageId::...) for user prose). crates/localization/locales/AGENTS.md owns string changes. web/AGENTS.md owns the site. docs/MOTION_CONTRACT.md owns motion. Design law lives in docs/design/, not in a prototype file someone left in a sibling directory.

  5. Bound the slice. One coherent change, reviewable in one sitting, that leaves the tree building and green. AGENTS.md's two corollaries keep slices honest: an abstraction must delete caller code, and a migration ships its last consumer or does not start.

  6. Fix the evidence bar now, not after. Decide before writing code what will prove this works, and write it into your plan:

    • the focused test or existing check that covers the behavior (scripts/dev-test.sh --list maps an area to its fastest invocation);
    • whether the change is visible enough to need cw-dogfood;
    • whether it is cross-cutting enough to need the full sweep in cw-gates.
  7. Write the implementation, then prove it runs. No new tests or code comments unless explicitly asked (AGENTS.md); update or delete existing tests the change makes wrong.

Red flags / don't

  • Don't add a module that "bridges", "mirrors", "stages", or "wraps" something that already exists without naming that thing in the commit message.
  • Don't fork a singleton (turn loop, base prompt, delegation axis, lifecycle system) without moving its guard test and consumers with it. The repo has one of each on purpose; a silent second one is the failure mode, not the refactor.
  • Don't write new tests unless explicitly asked, and never first. Don't add new code comments.
  • Don't contort production code to keep a brittle assertion green. A test that only encodes old behavior is evidence, not a veto: change it with the code.
  • Don't cut trust-boundary validation, data-loss handling, security, or accessibility to make a diff shorter. Brevity is never a reason to drop a guard.
  • Don't leave a #[allow(dead_code)] behind as the cost of an incomplete migration — scripts/check-dead-code-budget.py is the running receipt.

Output

Default shape before the first edit — compress when trivial (a one-line change gets a one-line note, not four bullets):

  • which rung of the ladder you stopped at and why;
  • the existing owner you found (path/to/file.rs:line), or the predecessor your new module names;
  • the bounded slice, in one sentence;
  • the evidence bar you will meet, chosen in advance.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

batch

無料日本語概要

並行して進められる大きな目標を、範囲の明確な作業に分割するスキル。既存のエージェントや作業ツリーの仕組みで実行し、結果の統合と検証まで進めます。

  • 大きな目標を並行作業に分けたいとき
  • 複数エージェントの作業調整
  • 作業ツリーを分けて進めたいとき
codewhale-hq/Codewhale4.1万2026年10月19日 更新

best-of-n

無料日本語概要

設計や実装、説明、デバッグの複数案を独立に作り、共通の評価基準で比較します。コード案は作業場所を分けて検証し、採用候補と判断の根拠を提示するスキルです。

  • 複数の設計方針を比較したいとき
  • 同じ課題の実装案を評価したいとき
  • 説明やデバッグの方針を比較したいとき
codewhale-hq/Codewhale4.1万2026年10月19日 更新

codew-release-qa-sweep

無料日本語概要

Codewhaleのリリース前に、テスト・ビルド・バージョン整合性を順に点検し、端末画面の手動確認項目と実施結果を整理して、完了判断の根拠を残します。

  • 実際のリリースブランチで自動検査
  • リリース先へのPR取り込み可否の確認
  • 端末の応答性と入力操作の手動確認
codewhale-hq/Codewhale4.1万2026年10月19日 更新

Operate desktop apps and isolated browsers on registered computers. Use for tasks that require an app interface, accessibility, screenshots or recording. Use Chromewhale for the user's signed-in Chrome.

日本語の概要は準備中です。原文の説明を表示しています。

codewhale-hq/Codewhale4.1万2026年10月19日 更新

Help a new contributor get productive on this checkout - inspect sync state against main, build, run the repository's exact verification gate, and produce a local what's-new digest. Never fetches, pulls, or modifies a dirty tree on its own. Explicit-only.

日本語の概要は準備中です。原文の説明を表示しています。

codewhale-hq/Codewhale4.1万2026年10月19日 更新

Use when a Codewhale change needs proving in the real product, or when asked to build/install/dogfood the local binaries: stamped release build, atomic install, fresh-shell verification, and the manual QA that gates cannot cover.

日本語の概要は準備中です。原文の説明を表示しています。

codewhale-hq/Codewhale4.1万2026年10月19日 更新

codewhale-hq のスキルをすべて見る

このスキルの問題を報告する