jpskill.com
📦 その他 コミュニティ

incremental-implementation

複数のファイルにまたがる機能や変更を実装する際、一度に大量のコードを書くのではなく、タスクを小さく分割して段階的に進めることで、安全かつ効率的に開発を進めるSkill。

📜 元の英語説明(参考)

Use when implementing any feature or change that touches more than one file. Use when you're about to write a large amount of code at once, or when a task feels too big to land in one step.

🇯🇵 日本人クリエイター向け解説

一言でいうと

複数のファイルにまたがる機能や変更を実装する際、一度に大量のコードを書くのではなく、タスクを小さく分割して段階的に進めることで、安全かつ効率的に開発を進めるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o incremental-implementation.zip https://jpskill.com/download/9584.zip && unzip -o incremental-implementation.zip && rm incremental-implementation.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9584.zip -OutFile "$d\incremental-implementation.zip"; Expand-Archive "$d\incremental-implementation.zip" -DestinationPath $d -Force; ri "$d\incremental-implementation.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して incremental-implementation.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → incremental-implementation フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

インクリメンタルな実装

概要

薄い垂直スライスで構築します。つまり、1つの部分を実装し、テストし、検証してから、拡張します。1回のパスで機能全体を実装しようとしないでください。各インクリメントは、システムを作動可能でテスト可能な状態にする必要があります。これは、大規模な機能を管理可能にする実行規律です。

いつ使うか

  • 複数のファイルにまたがる変更を実装する場合
  • タスク分解から新しい機能を構築する場合
  • 既存のコードをリファクタリングする場合
  • テストする前に約100行を超えるコードを書きたい誘惑にかられる場合

使用しない場合: スコープがすでに最小限である、単一ファイル、単一関数の変更。

インクリメントサイクル

┌──────────────────────────────────────┐
│                                      │
│   実装 ──→ テスト ──→ 検証 ──┐  │
│       ▲                           │  │
│       └───── コミット ◄─────────────┘  │
│              │                       │
│              ▼                       │
│          次のスライス                  │
│                                      │
└──────────────────────────────────────┘

各スライスについて:

  1. 実装 - 機能の最小限の完全な部分を実装します
  2. テスト - テストスイートを実行します(存在しない場合はテストを作成します)
  3. 検証 - スライスが期待どおりに動作することを確認します(テストがパスし、ビルドが成功し、手動チェック)
  4. コミット - 説明的なメッセージとともに進捗状況を保存します
  5. 次のスライスに移動 - 前に進み、再開しないでください

スライシング戦略

垂直スライス(推奨)

スタック全体で1つの完全なパスを構築します。

スライス 1: タスクを作成する (DB + API + 基本的な UI)
    → テストがパスし、ユーザーは UI 経由でタスクを作成できます

スライス 2: タスクを一覧表示する (クエリ + API + UI)
    → テストがパスし、ユーザーは自分のタスクを見ることができます

スライス 3: タスクを編集する (更新 + API + UI)
    → テストがパスし、ユーザーはタスクを変更できます

スライス 4: タスクを削除する (削除 + API + UI + 確認)
    → テストがパスし、完全な CRUD が完了します

各スライスは、動作するエンドツーエンドの機能を提供します。

コントラクトファーストスライシング

バックエンドとフロントエンドを並行して開発する必要がある場合:

スライス 0: API コントラクトを定義する (型、インターフェース、OpenAPI spec)
スライス 1a: コントラクト + API テストに対してバックエンドを実装する
スライス 1b: コントラクトに一致するモックデータに対してフロントエンドを実装する
スライス 2: 統合してエンドツーエンドをテストする

リスクファーストスライシング

最もリスクの高い、または最も不確実な部分に最初に取り組みます。

スライス 1: WebSocket 接続が動作することを証明する (最高のリスク)
スライス 2: 実証済みの接続でリアルタイムのタスク更新を構築する
スライス 3: オフラインサポートと再接続を追加する

スライス1が失敗した場合、スライス2と3に投資する前にそれを発見します。

実装ルール

ルール 0: 最初にシンプルさを

コードを記述する前に、「最も単純でうまくいくことは何か」を自問してください。

コードを記述した後、次のチェックに対してレビューします。

  • これをより少ない行数で実行できますか?
  • これらの抽象化は、その複雑さに値しますか?
  • スタッフエンジニアはこれを見て「なぜあなたはただ...しなかったのか?」と言うでしょうか?
  • 私は仮説的な将来の要件、または現在のタスクのために構築していますか?
シンプルさのチェック:
✗ 1つの通知のためのミドルウェアパイプラインを備えた汎用EventBus
✓ 単純な関数呼び出し

✗ 2つの類似したコンポーネントのための抽象ファクトリパターン
✓ 共有ユーティリティを備えた2つの簡単なコンポーネント

✗ 3つのフォームのための設定駆動型フォームビルダー
✓ 3つのフォームコンポーネント

3つの類似したコード行は、時期尚早な抽象化よりも優れています。最初にナイーブで明らかに正しいバージョンを実装します。テストで正しさが証明された後にのみ最適化します。

ルール 0.5: スコープの規律

タスクに必要なものだけを触ってください。

以下はしないでください:

  • 変更に隣接するコードを「クリーンアップ」する
  • 変更していないファイルのインポートをリファクタリングする
  • 完全に理解していないコメントを削除する
  • 「便利そう」だからといって、仕様にない機能を追加する
  • 読んでいるだけのファイルの構文を最新化する

タスクの範囲外で改善する価値のあるものに気付いた場合は、メモしてください。修正しないでください。

気づいたが触れないこと:
- src/utils/format.ts に未使用のインポートがある (このタスクとは無関係)
- 認証ミドルウェアは、より良いエラーメッセージを使用できる (別のタスク)
→ これらのタスクを作成しますか?

ルール 1: 一度に1つのこと

各インクリメントは、1つの論理的なことを変更します。関心を混同しないでください。

悪い例: 新しいコンポーネントを追加し、既存のコンポーネントをリファクタリングし、ビルド構成を更新する1つのコミット。

良い例: 3つの別々のコミット - 各変更に1つずつ。

ルール 2: 常にコンパイル可能

各インクリメントの後、プロジェクトはビルドされ、既存のテストはパスする必要があります。スライスの間にコードベースを壊れた状態にしないでください。

ルール 3: 不完全な機能のためのフィーチャーフラグ

機能がユーザーの準備ができていないが、インクリメントをマージする必要がある場合:

// 開発中の機能のフィーチャーフラグ
const ENABLE_TASK_SHARING = process.env.FEATURE_TASK_SHARING === 'true';

if (ENABLE_TASK_SHARING) {
  // 新しい共有 UI
}

これにより、不完全な作業を公開せずに、小さなインクリメントをメインブランチにマージできます。

ルール 4: 安全なデフォルト

新しいコードは、安全で保守的な動作をデフォルトにする必要があります。

// 安全: デフォルトで無効、オプトイン
export function createTask(data: TaskInput, options?: { notify?: boolean }) {
  const shouldNotify = options?.notify ?? false;
  // ...
}

ルール 5: ロールバックしやすい

各インクリメントは、個別に元に戻せる必要があります。

  • 付加的な変更(新しいファイル、新しい関数)は元に戻しやすい
  • 既存のコードの変更は、最小限で焦点を絞る必要がある
  • データベースの移行には、対応するロールバック移行が必要
  • 1つのコミットで何かを削除し、同じコミットで置き換えないでください。それらを分離してください

エージェントとの連携

エージェントにインクリメンタルに実装するように指示する場合:

「計画のタスク3を実装しましょう。

データベーススキーマの変更とAPIエンドポイントから始めてください。
UIにはまだ触れないでください。次のインクリメントでそれを行います。

実装後、`npm test`と`npm run build`を実行して、
何も壊れていないことを確認してください。」

各インクリメントのスコープ内にあるものと、スコープ外にあるものを明確にしてください。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Incremental Implementation

Overview

Build in thin vertical slices — implement one piece, test it, verify it, then expand. Never attempt to implement an entire feature in one pass. Each increment should leave the system in a working, testable state. This is the execution discipline that makes large features manageable.

When to Use

  • Implementing any multi-file change
  • Building a new feature from a task breakdown
  • Refactoring existing code
  • Any time you're tempted to write more than ~100 lines before testing

When NOT to use: Single-file, single-function changes where the scope is already minimal.

The Increment Cycle

┌──────────────────────────────────────┐
│                                      │
│   Implement ──→ Test ──→ Verify ──┐  │
│       ▲                           │  │
│       └───── Commit ◄─────────────┘  │
│              │                       │
│              ▼                       │
│          Next slice                  │
│                                      │
└──────────────────────────────────────┘

For each slice:

  1. Implement the smallest complete piece of functionality
  2. Test — run the test suite (or write a test if none exists)
  3. Verify — confirm the slice works as expected (tests pass, build succeeds, manual check)
  4. Commit — save your progress with a descriptive message
  5. Move to the next slice — carry forward, don't restart

Slicing Strategies

Vertical Slices (Preferred)

Build one complete path through the stack:

Slice 1: Create a task (DB + API + basic UI)
    → Tests pass, user can create a task via the UI

Slice 2: List tasks (query + API + UI)
    → Tests pass, user can see their tasks

Slice 3: Edit a task (update + API + UI)
    → Tests pass, user can modify tasks

Slice 4: Delete a task (delete + API + UI + confirmation)
    → Tests pass, full CRUD complete

Each slice delivers working end-to-end functionality.

Contract-First Slicing

When backend and frontend need to develop in parallel:

Slice 0: Define the API contract (types, interfaces, OpenAPI spec)
Slice 1a: Implement backend against the contract + API tests
Slice 1b: Implement frontend against mock data matching the contract
Slice 2: Integrate and test end-to-end

Risk-First Slicing

Tackle the riskiest or most uncertain piece first:

Slice 1: Prove the WebSocket connection works (highest risk)
Slice 2: Build real-time task updates on the proven connection
Slice 3: Add offline support and reconnection

If Slice 1 fails, you discover it before investing in Slices 2 and 3.

Implementation Rules

Rule 0: Simplicity First

Before writing any code, ask: "What is the simplest thing that could work?"

After writing code, review it against these checks:

  • Can this be done in fewer lines?
  • Are these abstractions earning their complexity?
  • Would a staff engineer look at this and say "why didn't you just..."?
  • Am I building for hypothetical future requirements, or the current task?
SIMPLICITY CHECK:
✗ Generic EventBus with middleware pipeline for one notification
✓ Simple function call

✗ Abstract factory pattern for two similar components
✓ Two straightforward components with shared utilities

✗ Config-driven form builder for three forms
✓ Three form components

Three similar lines of code is better than a premature abstraction. Implement the naive, obviously-correct version first. Optimize only after correctness is proven with tests.

Rule 0.5: Scope Discipline

Touch only what the task requires.

Do NOT:

  • "Clean up" code adjacent to your change
  • Refactor imports in files you're not modifying
  • Remove comments you don't fully understand
  • Add features not in the spec because they "seem useful"
  • Modernize syntax in files you're only reading

If you notice something worth improving outside your task scope, note it — don't fix it:

NOTICED BUT NOT TOUCHING:
- src/utils/format.ts has an unused import (unrelated to this task)
- The auth middleware could use better error messages (separate task)
→ Want me to create tasks for these?

Rule 1: One Thing at a Time

Each increment changes one logical thing. Don't mix concerns:

Bad: One commit that adds a new component, refactors an existing one, and updates the build config.

Good: Three separate commits — one for each change.

Rule 2: Always Compilable

After each increment, the project must build and existing tests must pass. Never leave the codebase in a broken state between slices.

Rule 3: Feature Flags for Incomplete Features

If a feature isn't ready for users but you need to merge increments:

// Feature flag for work-in-progress
const ENABLE_TASK_SHARING = process.env.FEATURE_TASK_SHARING === 'true';

if (ENABLE_TASK_SHARING) {
  // New sharing UI
}

This lets you merge small increments to the main branch without exposing incomplete work.

Rule 4: Safe Defaults

New code should default to safe, conservative behavior:

// Safe: disabled by default, opt-in
export function createTask(data: TaskInput, options?: { notify?: boolean }) {
  const shouldNotify = options?.notify ?? false;
  // ...
}

Rule 5: Rollback-Friendly

Each increment should be independently revertable:

  • Additive changes (new files, new functions) are easy to revert
  • Modifications to existing code should be minimal and focused
  • Database migrations should have corresponding rollback migrations
  • Never delete something in one commit and replace it in the same commit — separate them

Working with Agents

When directing an agent to implement incrementally:

"Let's implement Task 3 from the plan.

Start with just the database schema change and the API endpoint.
Don't touch the UI yet — we'll do that in the next increment.

After implementing, run `npm test` and `npm run build` to verify
nothing is broken."

Be explicit about what's in scope and what's NOT in scope for each increment.

Increment Checklist

After each increment, verify:

  • [ ] The change does one thing and does it completely
  • [ ] All existing tests still pass (npm test)
  • [ ] The build succeeds (npm run build)
  • [ ] Type checking passes (npx tsc --noEmit)
  • [ ] Linting passes (npm run lint)
  • [ ] The new functionality works as expected
  • [ ] The change is committed with a descriptive message

Common Rationalizations

Rationalization Reality
"I'll test it all at the end" Bugs compound. A bug in Slice 1 makes Slices 2-5 wrong. Test each slice.
"It's faster to do it all at once" It feels faster until something breaks and you can't find which of 500 changed lines caused it.
"These changes are too small to commit separately" Small commits are free. Large commits hide bugs and make rollbacks painful.
"I'll add the feature flag later" If the feature isn't complete, it shouldn't be user-visible. Add the flag now.
"This refactor is small enough to include" Refactors mixed with features make both harder to review and debug. Separate them.

Red Flags

  • More than 100 lines of code written without running tests
  • Multiple unrelated changes in a single increment
  • "Let me just quickly add this too" scope expansion
  • Skipping the test/verify step to move faster
  • Build or tests broken between increments
  • Large uncommitted changes accumulating
  • Building abstractions before the third use case demands it
  • Touching files outside the task scope "while I'm here"
  • Creating new utility files for one-time operations

Verification

After completing all increments for a task:

  • [ ] Each increment was individually tested and committed
  • [ ] The full test suite passes
  • [ ] The build is clean
  • [ ] The feature works end-to-end as specified
  • [ ] No uncommitted changes remain