本文へ移動
cccskills
無料GitHub で公開

cleanse

Review code for readability, then simplify it to be easy to follow and understand. Use this skill when the user wants to simplify code, improve readability, clean up for handoff, make code skimmable, reduce complexity, refactor for clarity, strip boilerplate, prepare code for future maintainers, or make a codebase easier to pick up. Trigger liberally — any request touching readability, simplification, cleanup, or "make this easier to understand" should use this skill. Also trigger when the user says things like "review this", "clean this up", "tidy this", "make this simpler", "reduce complexity", "flatten this", "strip the noise", or "I want to understand this code quickly next time I open it".

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.8 KB

SKILL.md(原文)

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

Important — Spawn a sub-agent to perform this review. Pass it only these instructions and the target files. The review is most effective when the agent starts with a clean context window.

Scope

If the user specified files or directories, pass those to the sub-agent. If not, ask what they'd like you to review before proceeding.

Goal

Make this code trivially easy to pick up cold. Someone opening this file in six months should understand what it does in seconds. All changes should preserve the original functionality and behavior.

What to look for

Read the target code carefully, then apply these passes in order. Make changes directly — don't list suggestions.

1. Flatten control flow

Nested conditionals are the single biggest readability killer. Flatten them.

  • Convert if/else chains to early returns and guard clauses. Put the bail-out condition at the top, happy path below.
  • When a function has a single meaningful path wrapped in a conditional, invert the condition and return early.
  • If an else block just returns or continues, remove the else — the early return already handles it.

2. Strip noise

Remove anything that doesn't help the reader understand the code:

  • Comments that restate the code — // increment counter above counter += 1 is noise. Delete.
  • Redundant type annotations — if the type is obvious from the right-hand side and the language supports inference, remove the annotation.
  • Unnecessary intermediate variables — if a variable is used once on the next line, inline it (unless the name adds genuine clarity).

Only keep comments that explain why — workarounds, constraints, non-obvious business rules. These are valuable. Remove everything else.

3. Simplify logic

  • Collapse trivial if/else into a single expression where the language supports it (ternary, nil-coalescing, pattern matching).
  • Replace boolean flags that track state across a loop with early exits or functional transforms (map, filter, first).
  • Inline one-use helpers that are short enough to read in place. Don't extract helpers for one-time operations — three similar lines is better than a premature abstraction.

4. Improve naming

  • Rename vague variables: data, result, temp, info, val, obj — these tell the reader nothing. Use names that say what the thing is.
  • But keep names short for tightly-scoped temps (loop indices, short closures) and when a single word is enough. i is fine in a 3-line loop.
  • Follow the language's naming conventions. camelCase in JS/Swift, snake_case in Python/Rust, etc.
  • Method names should describe what they do without needing a comment. If you need a comment to explain what a method does, rename the method.

5. Move declarations close to usage

Variables defined at the top of a function but not used until line 40 force the reader to hold them in mental memory. Move declarations to just before first use. This makes extraction easier later.

6. Break up long functions

If a function is doing multiple distinct things sequentially, split it — each piece should do one thing and be readable on its own. Apply the same passes above to each extracted function. If extracting would require threading many parameters or the logic is deeply interleaved, don't force it — flag it as a readability concern instead.

How to apply changes

  1. Read the target files thoroughly.
  2. Make all changes directly. Be efficient — batch related edits.
  3. After editing, verify the code still compiles/parses if possible (run the project's lint or build command if one exists).
  4. List changes briefly — the diff tells the full story.

What NOT to do

  • Don't add comments, docstrings, or type annotations that weren't there before (unless renaming made something ambiguous).
  • Don't refactor architecture or move files between modules. This is a clarity pass, not a redesign.
  • Don't change public API signatures unless the name is actively misleading.
  • Don't be clever. The goal is code so boring and obvious that it is self-documenting and can be read cold.

レビュー

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

同じリポジトリのスキル

概要と使いどころ

When the user wants to A/B test App Store product page elements to improve conversion rate. Also use when the user mentions "A/B test", "product page optimization", "test my screenshots", "test my icon", "conversion rate optimization", "CPP", or "custom product pages". For screenshot design, see screenshot-optimization. For metadata optimization, see metadata-optimization.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

Discover and configure Bluetooth and Wi-Fi accessories using AccessorySetupKit. Use when presenting a privacy-preserving accessory picker, defining discovery descriptors for BLE or Wi-Fi devices, handling accessory session events, migrating from CoreBluetooth permission-based scanning, or setting up accessories without requiring broad Bluetooth permissions.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

Implement, review, or improve Live Activities and Dynamic Island experiences in iOS apps using ActivityKit. Use when building real-time updating widgets for the Lock Screen and Dynamic Island — delivery tracking, sports scores, ride-sharing status, workout timers, media playback, or any time-sensitive information that updates in real time. Also use when working with ActivityKit, ActivityAttributes, Activity lifecycle (request/update/end), Dynamic Island layouts (compact/minimal/expanded), push-to-update Live Activities, or Lock Screen live widgets.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

Measure ad effectiveness with privacy-preserving attribution using AdAttributionKit. Use when registering ad impressions, handling attribution postbacks, updating conversion values, implementing re-engagement attribution, configuring publisher or advertiser apps, or replacing SKAdNetwork with AdAttributionKit for ad measurement.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

alarmkit

無料

Implement AlarmKit alarms and countdown timers for iOS and iPadOS with Lock Screen, Dynamic Island, and Apple Watch system UI. Covers AlarmManager scheduling, AlarmAttributes and AlarmPresentation, AlarmButton stop and snooze actions, authorization, state observation, and Live Activity integration. Use when building wake-up alarms, countdown timers, or alarm-style alerts that need Apple's system alarm experience.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

When the user wants to optimize their Google Play Store listing — title, short description, full description, keywords, ratings, or Play Store-specific features. Use when the user mentions "Google Play", "Android", "Play Store", "Play Console", "short description", "full description indexed", "Google Play ASO", or wants Google Play-specific keyword, creative, or ratings strategy. For iOS App Store optimization, see aso-audit and metadata-optimization.

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

JordanCoin/ios-skills-collection62026年9月10日 更新

JordanCoin のスキルをすべて見る

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