home / skills / shotaiuchi / dotclaude / wf5-implement

wf5-implement skill

/dotclaude/skills/wf5-implement

This skill implements a single step from the Plan for wf5-implement, executing defined tasks in the repository and validating outcomes.

npx playbooks add skill shotaiuchi/dotclaude --skill wf5-implement

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
2.0 KB
---
name: wf5-implement
description: Planの1ステップを実装
argument-hint: "[step_number]"
context: fork
agent: general-purpose
---

**Always respond in Japanese.**

# /wf5-implement

Implement one step of the Plan document.

## Usage

```
/wf5-implement [step_number]
```

## Arguments

- `step_number`: Step to implement (optional). Auto-selects next incomplete step if omitted.

## Constraints

- **No Off-Plan Changes**: Only implement what is documented in the Plan.
- **One Execution = One Step**: Only one step per execution.

## Processing

### 1. Check Prerequisites

Get active work. Require `03_PLAN.md` exists.

### 2. Determine Target Step

If no argument: `current_step + 1` from state.json. Check dependent steps are completed.

### 3. Extract Step Info from Plan

Title, Purpose, Target Files, Tasks, Completion Criteria, Dependencies.

### 4. Implementation

1. Load and analyze target files
2. Make code changes following Plan tasks — **no off-plan changes**
3. Run related tests; fix failures if directly related to this step's changes

### 5. Record Implementation Log

Append to `05_IMPLEMENT_LOG.md` using template `~/.claude/templates/05_IMPLEMENT_LOG.md`.

### 6. Update state.json

Set step status to `"completed"` with timestamp. Update `current_step`. Set `current: "wf5-implement"`. If all steps done, set `next: "wf6-verify"`.

### 7. Verify Completion Criteria

Check each criterion is satisfied.

### 8. Commit

Auto-detect commit type from step content:
- `bug`/`fix`/`repair` → `fix`
- `refactor` → `refactor`
- `test` → `test`
- `doc`/`documentation` → `docs`
- otherwise → `feat`

Override with `commit.type_detection`/`commit.default_type` from config.json.

Message: `<type>(<scope>): <description>` with step info and work-id in body.

### 9. Completion Message

Show changed files with diff stats, completion criteria results, progress (n/total), next step suggestion.

## Off-Plan Changes

- **Minor** (typos, imports): Record in Notes section, continue
- **Significant** (design changes): Interrupt, suggest `/wf3-plan update`

Overview

This skill implements a single step from a Plan document. It automates loading the Plan, locating the target step, applying only the planned changes to project files, running related tests, recording an implementation log, updating state, and committing the result.

How this skill works

The skill checks for active work and the presence of the Plan file, determines the target step (argument or next incomplete step), extracts the step metadata (title, tasks, targets, dependencies, completion criteria), and applies the changes to the specified files without making off-plan edits. It runs tests affected by the change, writes an implementation entry to the implementation log template, updates state.json to mark the step completed, and creates a validated commit with an auto-detected type.

When to use it

  • You have an existing Plan document and want to implement exactly one defined step.
  • You need automated, auditable single-step changes with enforced dependency checks.
  • You want tests run only for changes directly related to this step.
  • You need consistent commit messages and progress tracking between steps.

Best practices

  • Always ensure 03_PLAN.md is up to date and step dependencies are correct before running.
  • Do not use this skill to bundle multiple steps — one execution equals one step.
  • Limit off-plan edits to trivial fixes (typos/imports); record them as Notes when they occur.
  • If a change requires design or scope change, interrupt and update the Plan first.
  • Review the implementation log entry and test results before pushing the commit.

Example use cases

  • Implementing a bugfix step that lists affected files and a fix task, then running unit tests for those modules.
  • Adding a small feature described in the Plan with clear completion criteria and committing with an auto-generated feat scope.
  • Applying a refactor step that targets specific files, verifying refactor test coverage, and recording the log.
  • Completing a documented task that requires updating configuration and ensuring dependent steps are already completed.

FAQ

What if I omit the step number?

The skill auto-selects the next incomplete step based on state.json and validates dependencies before proceeding.

Are off-plan changes allowed?

Only trivial fixes (typos, imports) are allowed and must be noted; any significant design change must stop and prompt a Plan update.

How is the commit type chosen?

The step content drives type detection (fix/refactor/test/docs/feat) and can be overridden by commit settings in config.json.