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

simplify-code

指定されたブランチや差分を調べ、振る舞いを守らないテスト、冗長な説明、使われない仕組みを削るスキル。周辺コードと照らし合わせて整理し、変更後の検証まで進めます。

原文原文の説明を見る

Simplify an explicitly requested branch or diff by removing low-value tests, redundant prose, and unused complexity. Independent PR assessment belongs to review-pr.

marin-community/marinスター 4,043(GitHub 4,043 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 価値の低いテストの削除や書き直し
  • 冗長なコメントや文書の整理
  • 未使用の補助関数や互換処理の削除
  • 公開前のブランチ整理

日本語での紹介

できること

指定されたブランチや差分から、保守する価値の低いテスト、情報を増やさない文章、使われていない複雑な仕組みを取り除きます。分岐元との比較で変更全体を確認し、周辺の製品コードと既存テストを読んで判断します。テストは実際の振る舞いや回帰を守るか、文章は事実・判断・制約を伝えるかを点検します。新しい補助関数や依存関係も、現在の利用箇所を確認します。

こんなときに便利

PR公開前に差分を整理したいときや、実装の細部だけを確かめるテストが増えたときに向いています。古い互換処理、重複した説明、移行後も残る旧経路を見直したい場合にも使えます。整理後は、影響する範囲のテストと整形・静的チェックで確かめます。

使い方の例

  • 「このブランチから、振る舞いを守らないテストと冗長な説明を整理して」
  • 「差分を確認し、使われていない補助関数や古い互換処理を削って」

注意点

ブランチや差分の整理を明示的に依頼された場合に使います。対象のAGENTS.md、TESTING.md、文章規約と、git、uv、指定の検証スクリプトを前提とします。編集を伴わない独立評価はreview-pr、公開とフィードバック対応はmanage-prが担当します。

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

含まれるファイル(3)

  • SKILL.md5.0 KB
  • references/examples.md2.3 KB
  • scripts/scan_diff.py4.5 KB

SKILL.md(原文)

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

Simplify a branch or diff

Apply this workflow when cleanup of a branch or diff is explicitly requested. Use review-pr for independent findings without code edits. manage-pr owns publication and feedback after the cleanup is ready.

Load The Policies

Read these before reviewing:

  • root AGENTS.md
  • root TESTING.md
  • docs/dev-guide/writing-style/ai-writing-donts.md
  • the nearest module AGENTS.md and testing guide for each changed test

Read references/examples.md when the diff changes tests or prose.

Establish The Review Surface

Review the merge-base diff. Do not substitute commit history or the latest commit.

UPSTREAM=$(git rev-parse --verify origin/main 2>/dev/null || git rev-parse --verify main)
BASE=$(git merge-base HEAD "$UPSTREAM")
git status --short
git diff --stat "$BASE"
git diff --check "$BASE"
git diff "$BASE"
uv run python .agents/skills/simplify-code/scripts/scan_diff.py "$BASE"

List every changed test, comment, docstring, Markdown file, commit message, and draft PR title/body. Read the surrounding production code and existing tests. The scanner includes untracked files and returns candidates; inspect each one in context.

Gate Tests By Behavioral Value

For every changed test, finish this sentence:

This test fails when ___ user-visible or system behavior is wrong.

Delete or rewrite the test when the blank names an implementation detail, wording choice, supplied fixture value, or language guarantee.

Reject these patterns aggressively:

  • config in, same config out: a constructed or lowered field equals the fixture
  • constructor assignment, enum value, type, attribute, registration, or import exists
  • exact log, help, error, command, or status prose that no machine consumes
  • private state, helper call count, or assert_called_once_with
  • production logic copied into the expected value
  • is not None, does not raise, empty smoke tests, or permanent skips
  • a large matrix whose rows exercise the same branch
  • golden output produced by the implementation under test

Keep a test only when it protects a real boundary, regression, invariant, round-trip, state transition, persisted effect, wire contract, or numerical result against an independent reference.

Prefer one strong test over several weak tests. Use scratch probes for wiring and construction checks. Do not check them in.

Delete Prose Slop

Review every added or edited sentence in comments, docstrings, docs, reports, commit text, and PR text.

Delete sentences that add no fact, result, decision, constraint, or caveat. Apply the full checklist in ai-writing-donts.md. Search explicitly for:

  • X, not Y, not X, but Y, not just X, more than X
  • rather than used as rhetorical contrast
  • the main change, what this means, the real story, what matters
  • importantly, notably, it is worth noting, stepping back
  • effort narration, section narration, recap paragraphs, and generic conclusions
  • unsupported adjectives and claims that outrun measurements
  • comments that describe an earlier version of the patch

Rewrite retained prose as the concrete claim. Split a real comparison into two measured statements. Keep necessary negation such as the test has not run.

Check prose against code and artifacts. A concise false claim is still slop.

Review The Diff As A Design

After the test and prose passes, inspect each new file, helper, type, flag, dependency, compatibility path, and public API:

  1. Name its current consumer.
  2. Remove it when its consumer disappeared.
  3. Reuse an existing repository concept when it fits.
  4. Complete migrations; do not leave old and new paths active.
  5. Keep one-shot migration and debugging machinery outside reusable libraries.
  6. Remove stale comments, aliases, re-exports, shims, and defensive branches.

Fix And Verify

When edits are authorized, make the cleanup. Do not stop at a findings table while safe fixes remain.

For PR preparation, follow manage-pr's validation schedule: finish formatting and the initial commit, then overlap advisory review with affected tests and docs checks. Carry forward passing checks whose inputs remain unchanged.

For cleanup without PR preparation, run the narrow affected tests and:

./infra/pre-commit.py --changed-files --fix

Run ./infra/pre-commit.py --review with --calling-agent set to claude or codex to match the caller, only at the point required by the manage-pr workflow. Do not add a separate advisory pass before handing off to that workflow. Do not claim a clean pass while known findings remain.

Report

Lead with what was removed or simplified. Report retained exceptions with their behavioral contract or evidence. If no edits were authorized, report findings as path:line, the maintenance cost, and the smallest fix.

レビュー

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

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

ab-test-zephyr

無料概要あり

同じ正規化済みデータと実行条件でZephyrの変更前後を比較し、Finelogの段階別指標からCPU使用時間、処理時間、メモリの変化を評価するスキル。

  • PR前後のZephyr性能を比較したいとき
  • 高速化に伴うCPU使用量の増加確認
  • 最大メモリとメモリ不足の悪化確認
marin-community/marin4,0432026年10月29日 更新

add-dataset

無料概要あり

Hugging Faceのデータセットを全件ダウンロードせずに構造を調べ、本文の項目やデータ区分を確認してMarin用の登録モジュールを追加するスキル。

  • Marinにデータセットを登録したいとき
  • 全件取得せず本文の項目を調べたいとき
  • 設定とデータ区分の確認
marin-community/marin4,0432026年10月29日 更新

add-grant

無料概要あり

GCPのリソース権限やCloud RunのIAP閲覧権限の依頼を、必要最小限のロールと暗号化した個人識別情報を使うPulumi変更・PRにまとめるスキル。

  • GCSバケットの閲覧権限の追加準備
  • Cloud RunのIAP閲覧者の追加
  • サービスアカウントの代理操作権限の準備
marin-community/marin4,0432026年10月29日 更新

add-pallas-kernel

無料概要あり

JAXの計算を担うPallas/Mosaicカーネルを追加・改修し、参照実装との値・勾配の一致確認からAPI整備、性能測定、指定時の調整まで進めるスキル。

  • JAX計算用カーネルを追加したいとき
  • 参照実装と値・勾配を比較したいとき
  • 実装の選択順序と代替処理の整備
marin-community/marin4,0432026年10月29日 更新

change-grug

無料概要あり

Grug/Grugformerの実験用コピーでモデルや学習処理を変更し、差分と結果を記録して、有効だった変更を基本テンプレートへ反映するスキル。

  • 注意機構やマスク処理を試したいとき
  • 最適化処理や学習ループを変えたいとき
  • 実験成果を基本テンプレートへ戻すとき
marin-community/marin4,0432026年10月29日 更新

curate-experiments

無料概要あり

Marinの実験レポートを集めて索引を整理し、指定された過去の実験をタグとIssueへの参照でアーカイブするスキル。既存の結論や正式なリンクを保ちます。

  • 実験レポートの索引を整理したいとき
  • 正式なレポート項目を統合したいとき
  • 指定した過去の実験のアーカイブ
marin-community/marin4,0432026年10月29日 更新

marin-community のスキルをすべて見る

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