{"slug":"incremental-implementation-2","title":"incremental-implementation","summary":"Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, when you're about to write a large amount of ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-10-14T21:50:04.162854Z","repo":{"url":"https://github.com/addyosmani/agent-skills","stars":106655,"forks":11097,"license":"MIT","updatedAt":"2026-10-13T20:24:07Z"},"bodyHtml":"<hr>\n<h2>name: incremental-implementation\ndescription: Delivers changes incrementally in thin, verifiable slices. Use when implementing any feature or change that touches more than one file, or when picking up the next task from a plan. Use when rolling a change out behind a feature flag, 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.</h2>\n<h1>Incremental Implementation</h1>\n<h2>Overview</h2>\n<p>Build in thin vertical slices — implement one piece, test it, verify it, then expand. Avoid implementing 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.</p>\n<h2>When to Use</h2>\n<ul>\n<li>Implementing any multi-file change</li>\n<li>Building a new feature from a task breakdown</li>\n<li>Refactoring existing code</li>\n<li>Any time you're tempted to write more than ~100 lines before testing</li>\n</ul>\n<p><strong>When NOT to use:</strong> Single-file, single-function changes where the scope is already minimal.</p>\n<h2>The Increment Cycle</h2>\n<pre><code>┌──────────────────────────────────────┐\n│                                      │\n│   Implement ──→ Test ──→ Verify ──┐  │\n│       ▲                           │  │\n│       └───── Commit ◄─────────────┘  │\n│              │                       │\n│              ▼                       │\n│          Next slice                  │\n│                                      │\n└──────────────────────────────────────┘\n</code></pre>\n<p>For each slice:</p>\n<ol>\n<li><strong>Implement</strong> the smallest complete piece of functionality</li>\n<li><strong>Test</strong> — run the test suite (or write a test if none exists)</li>\n<li><strong>Verify</strong> — confirm the slice works as expected (tests pass, build succeeds, manual check)</li>\n<li><strong>Commit</strong> -- save your progress with a descriptive message (see <code>git-workflow-and-versioning</code> for atomic commit guidance)</li>\n<li><strong>Move to the next slice</strong> — carry forward, don't restart</li>\n</ol>\n<h2>Slicing Strategies</h2>\n<h3>Vertical Slices (Preferred)</h3>\n<p>Build one complete path through the stack:</p>\n<pre><code>Slice 1: Create a task (DB + API + basic UI)\n    → Tests pass, user can create a task via the UI\n\nSlice 2: List tasks (query + API + UI)\n    → Tests pass, user can see their tasks\n\nSlice 3: Edit a task (update + API + UI)\n    → Tests pass, user can modify tasks\n\nSlice 4: Delete a task (delete + API + UI + confirmation)\n    → Tests pass, full CRUD complete\n</code></pre>\n<p>Each slice delivers working end-to-end functionality.</p>\n<h3>Contract-First Slicing</h3>\n<p>When backend and frontend need to develop in parallel:</p>\n<pre><code>Slice 0: Define the API contract (types, interfaces, OpenAPI spec)\nSlice 1a: Implement backend against the contract + API tests\nSlice 1b: Implement frontend against mock data matching the contract\nSlice 2: Integrate and test end-to-end\n</code></pre>\n<h3>Risk-First Slicing</h3>\n<p>Tackle the riskiest or most uncertain piece first:</p>\n<pre><code>Slice 1: Prove the WebSocket connection works (highest risk)\nSlice 2: Build real-time task updates on the proven connection\nSlice 3: Add offline support and reconnection\n</code></pre>\n<p>If Slice 1 fails, you discover it before investing in Slices 2 and 3.</p>\n<h2>Implementation Rules</h2>\n<h3>Rule 0: Simplicity First</h3>\n<p>Before writing any code, ask: \"What is the simplest thing that could work?\"</p>\n<p>After writing code, review it against these checks:</p>\n<ul>\n<li>Can this be done in fewer lines?</li>\n<li>Are these abstractions earning their complexity?</li>\n<li>Would a staff engineer look at this and say \"why didn't you just...\"?</li>\n<li>Am I building for hypothetical future requirements, or the current task?</li>\n</ul>\n<pre><code>SIMPLICITY CHECK:\n✗ Generic EventBus with middleware pipeline for one notification\n✓ Simple function call\n\n✗ Abstract factory pattern for two similar components\n✓ Two straightforward components with shared utilities\n\n✗ Config-driven form builder for three forms\n✓ Three form components\n</code></pre>\n<p>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.</p>\n<h3>Rule 0.5: Scope Discipline</h3>\n<p>Touch only what the task requires.</p>\n<p>Do NOT:</p>\n<ul>\n<li>\"Clean up\" code adjacent to your change</li>\n<li>Refactor imports in files you're not modifying</li>\n<li>Remove comments you don't fully understand</li>\n<li>Add features not in the spec because they \"seem useful\"</li>\n<li>Modernize syntax in files you're only reading</li>\n</ul>\n<p>If you notice something worth improving outside your task scope, note it — don't fix it:</p>\n<pre><code>NOTICED BUT NOT TOUCHING:\n- src/utils/format.ts has an unused import (unrelated to this task)\n- The auth middleware could use better error messages (separate task)\n→ Want me to create tasks for these?\n</code></pre>\n<h3>Rule 1: One Thing at a Time</h3>\n<p>Each increment changes one logical thing. Don't mix concerns:</p>\n<p><strong>Bad:</strong> One commit that adds a new component, refactors an existing one, and updates the build config.</p>\n<p><strong>Good:</strong> Three separate commits — one for each change.</p>\n<h3>Rule 2: Keep It Compilable</h3>\n<p>After each increment, the project must build and existing tests must pass. Don't leave the codebase in a broken state between slices.</p>\n<h3>Rule 3: Feature Flags for Incomplete Features</h3>\n<p>If a feature isn't ready for users but you need to merge increments:</p>\n<pre><code>// Feature flag for work-in-progress\nconst ENABLE_TASK_SHARING = process.env.FEATURE_TASK_SHARING === 'true';\n\nif (ENABLE_TASK_SHARING) {\n  // New sharing UI\n}\n</code></pre>\n<p>This lets you merge small increments to the main branch without exposing incomplete work.</p>\n<h3>Rule 4: Safe Defaults</h3>\n<p>New code should default to safe, conservative behavior:</p>\n<pre><code>// Safe: disabled by default, opt-in\nexport function createTask(data: TaskInput, options?: { notify?: boolean }) {\n  const shouldNotify = options?.notify ?? false;\n  // ...\n}\n</code></pre>\n<h3>Rule 5: Rollback-Friendly</h3>\n<p>Each increment should be independently revertable:</p>\n<ul>\n<li>Additive changes (new files, new functions) are easy to revert</li>\n<li>Modifications to existing code should be minimal and focused</li>\n<li>Database migrations should have corresponding rollback migrations</li>\n<li>Avoid deleting something in one commit and replacing it in the same commit — separate them</li>\n</ul>\n<h2>Working with Agents</h2>\n<p>When directing an agent to implement incrementally:</p>\n<pre><code>\"Let's implement Task 3 from the plan.\n\nStart with just the database schema change and the API endpoint.\nDon't touch the UI yet — we'll do that in the next increment.\n\nAfter implementing, run the repository's test and build commands to\nverify nothing is broken.\"\n</code></pre>\n<p>Be explicit about what's in scope and what's NOT in scope for each increment.</p>\n<h2>Increment Checklist</h2>\n<p>After each increment, verify with the repository's own commands (see the test-driven-development skill's Discover the Stack First section):</p>\n<ul>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The change does one thing and does it completely</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> All existing tests still pass (the repository's test command: <code>npm test</code>, <code>./gradlew test</code>, <code>pytest</code>, ...)</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The build succeeds (the repository's build command)</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Type checking passes, where the stack has one (<code>npx tsc --noEmit</code>, <code>mypy</code>, ...)</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Linting passes (the repository's lint command)</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The new functionality works as expected</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The change is committed with a descriptive message</li>\n</ul>\n<p><strong>Note:</strong> Run each verification command after a change that could affect it. After a successful run, don't repeat the same command unless the code has changed since — re-running on unchanged code adds no information.</p>\n<h2>Common Rationalizations</h2>\n<table>\n<thead>\n<tr>\n<th>Rationalization</th>\n<th>Reality</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>\"I'll test it all at the end\"</td>\n<td>Bugs compound. A bug in Slice 1 makes Slices 2-5 wrong. Test each slice.</td>\n</tr>\n<tr>\n<td>\"It's faster to do it all at once\"</td>\n<td>It <em>feels</em> faster until something breaks and you can't find which of 500 changed lines caused it.</td>\n</tr>\n<tr>\n<td>\"These changes are too small to commit separately\"</td>\n<td>Small commits are free. Large commits hide bugs and make rollbacks painful.</td>\n</tr>\n<tr>\n<td>\"I'll add the feature flag later\"</td>\n<td>If the feature isn't complete, it shouldn't be user-visible. Add the flag now.</td>\n</tr>\n<tr>\n<td>\"This refactor is small enough to include\"</td>\n<td>Refactors mixed with features make both harder to review and debug. Separate them.</td>\n</tr>\n<tr>\n<td>\"Let me run the build command again just to be sure\"</td>\n<td>After a successful run, repeating the same command adds nothing unless the code has changed since. Run it again after subsequent edits, not as reassurance.</td>\n</tr>\n</tbody>\n</table>\n<h2>Red Flags</h2>\n<ul>\n<li>More than 100 lines of code written without running tests</li>\n<li>Multiple unrelated changes in a single increment</li>\n<li>\"Let me just quickly add this too\" scope expansion</li>\n<li>Skipping the test/verify step to move faster</li>\n<li>Build or tests broken between increments</li>\n<li>Large uncommitted changes accumulating</li>\n<li>Building abstractions before the third use case demands it</li>\n<li>Touching files outside the task scope \"while I'm here\"</li>\n<li>Creating new utility files for one-time operations</li>\n<li>Running the same build/test command twice in a row without any intervening code change</li>\n</ul>\n<h2>Verification</h2>\n<p>After completing all increments for a task:</p>\n<ul>\n<li><input disabled=\"disabled\" type=\"checkbox\"> Each increment was individually tested and committed</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The full test suite passes</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The build is clean</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> The feature works end-to-end as specified</li>\n<li><input disabled=\"disabled\" type=\"checkbox\"> No uncommitted changes remain</li>\n</ul>\n<h2>See Also</h2>\n<p>Per-increment verification is the local check. Before declaring a task done, apply the project-wide Definition of Done as the final gate, the standing bar every increment clears regardless of the task. See <code>../../references/definition-of-done.md</code>.</p>\n","files":[{"path":"SKILL.md","sizeBytes":9629,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-10-14T21:50:33.860192Z","sha256":"06AFBAB043E0DC3565A94FB000A8BEA736BB29CBD964BCCED4BD9BC0E2F552DA","sizeBytes":4218},"review":null,"source":{"repositoryUrl":"https://github.com/addyosmani/agent-skills","path":"skills/incremental-implementation","license":"MIT","commit":"aeac41d4d005999432bb7312f7ff06383a91d59d","subtreeSha":"AA2C1650610324EEEC8D36AB155A2A9B8222FE3D0B1AFFB562204CDB3385799C","lastSyncedAt":"2026-10-14T21:50:01.901728Z"},"reviewedAt":"2026-10-14T21:52:40.948643Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/addyosmani/agent-skills/tree/main/skills/incremental-implementation"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install addyosmani-agent-skills@llmmart"},{"target":"git","command":"git clone https://github.com/addyosmani/agent-skills.git"}]}