Implement feature

From janekbaraniewski/openusage · View interactive version

Implement feature is an AI agent skill from the GitHub repository janekbaraniewski/openusage. Implement a feature from an existing design doc. Reads the design, analyzes the codebase, validates assumptions via interactive quiz, plans execution with parallelization, implements tasks, and validates. Use after running /design-feature.

How to use this skill

Skill file

OpenUsage Feature Implementer

Invocation: When a user wants to implement a feature that has a design doc in docs/*_DESIGN.md. Always requires a design doc — if none exists, tell the user to run /design-feature first.

Input: Design doc path or feature name (resolved to docs/<NAME>_DESIGN.md).


Phase 0 — Load Design

  1. Read the design doc. If the path wasn't given, search docs/*_DESIGN.md for a match.
  2. Extract and confirm with the user:
  1. Ask: "Implement all tasks, or a subset?" Proceed only after confirmation.

Phase 1 — Codebase Analysis

For each affected subsystem, read the primary files from docs/skills/design-feature/references/subsystem-map.md.

For each implementation task, read every file listed under Files:. Note:

Summarize blockers or conflicts found (e.g., a type was renamed since the design was written). If any exist, flag them before proceeding.


Phase 1.5 — Pre-Implementation Quiz (MANDATORY)

After reading the codebase but before presenting the execution plan, surface ambiguities. Design docs cannot anticipate every integration detail. Present an interactive quiz covering:

  1. Ambiguous design choices: Where the design says "add X" but there are multiple valid locations or approaches in the code.
  2. Missing details: Decisions the design doc defers or doesn't address (e.g., UI placement, key bindings, exact data flow).
  3. Conflicting patterns: Where the codebase has evolved since the design was written and there's more than one way to reconcile.
  4. Scope boundaries: Confirm what's in vs. out — e.g., "Should this apply to both screens or just one?"

Format: Present numbered questions with options (A/B/C) where possible. For open-ended questions, propose a default and ask for confirmation.

After the quiz:


Phase 2 — Execution Plan

Present a numbered execution plan derived from the design doc's tasks. For each task state:

Task N: <title>
  Depends on: <task numbers or "none">
  Files: <from design doc>
  Approach: <1-2 sentences: what you'll do, in order>
  Risk: <low/medium — flag anything non-trivial>

Parallelization analysis

After listing all tasks, identify parallel groups — sets of tasks with no mutual dependencies that can execute concurrently using agents:

Parallel group 1: Tasks 3, 4, 5 (all depend on Tasks 1-2 but not each other)
Sequential: Task 6 (depends on Tasks 3, 4) → Task 7 (depends on all)

Note: Parallel execution uses separate agents that cannot see each other's changes. Each agent must be given complete context for its task. Integration verification (Phase 3d) is mandatory after every parallel group.

Ask: "Proceed with this plan?" Adjust if the user requests changes.


Phase 3 — Implement

Execute tasks in dependency order. Tasks within the same parallel group MAY be executed concurrently using agents when the user requests it or when there are 3+ independent tasks.

3a. Code

3b. Test

3c. Validate (per-task)

After each task:

  1. Run go_diagnostics on all modified files.
  2. Fix any errors before moving to the next task.
  3. Run the package tests.
  4. Briefly report: task title, files changed, tests passing.

If a test fails, fix it before moving on. If a fix requires changing the design, flag it and ask the user.

3d. Integration verification (after parallel groups)

After a parallel group completes, before starting the next group or task:

  1. Run go build ./... to verify all parallel changes compile together.
  2. Run go test for all packages touched by any agent in the group.
  3. Check for signature mismatches: when one agent changes a function/method signature, other callers (including test helpers) may need updating.
  4. Fix any issues. Common problems:

3e. Handling scope changes

If the user requests changes to scope during implementation (e.g., adding cases, expanding a type, changing behavior):

  1. Assess impact on the current task and remaining tasks.
  2. Implement the change in the current task.
  3. Update the design doc to reflect the new scope.
  4. Re-evaluate whether remaining tasks need adjustment.
  5. Do NOT silently absorb scope changes — acknowledge them and note the deviation.

Phase 4 — Integration Check

After all tasks are complete:

  1. Build: make build — must succeed.
  2. Full test suite for changed packages: go test <each changed package> -count=1 -race
  3. Lint (if available): make lint
  4. Vet: make vet

Report results. Fix any issues.


Phase 5 — Summary

Present a completion summary:

## Implementation Summary

Design doc: <path>
Tasks completed: N/N

### Changes
| File | Change |
|------|--------|
| <file> | <what changed — one line each> |

### Tests added
- <test file>: <what's covered>

### Design doc updates
- <any changes made to the design doc during implementation>

### Notes
- <anything the user should know: design deviations, scope changes, follow-up items, etc.>

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.