implement
Execute an implementation plan, making changes and committing properly
Файлы1
Открыть в GitHubSKILL.md.claude/skills/implement/SKILL.md
GitHubImplement
Execute an implementation plan or review fixes, making code changes and committing according to guidelines.
Arguments
/implement [target]
Target (optional)
Specifies what to implement. Can be:
- Nothing - auto-detect from branch name, check for review.md then plan.md
- Directory name - folder within
.ai/(e.g.,issue-59-add-no-verify-option) - Relative path - path to
.ai/folder (e.g.,.ai/my-feature) - File path - direct path to a specific file (e.g.,
.ai/my-feature/review.md)
Source Priority
When given a directory (or auto-detecting):
- If
review.mdexists → implement fixes from the review - Otherwise if
plan.mdexists → implement the plan - If neither exists → suggest running
/create-planor/code-reviewfirst
Examples
# Auto-detect from branch, prefer review.md over plan.md
/implement
# Use specific folder in .ai/
/implement issue-59-add-no-verify-option
# Use relative path
/implement .ai/my-feature
# Use specific file directly
/implement .ai/my-feature/plan.md
/implement .ai/my-feature/review.md
Instructions
Parse Arguments and Find Source
If a file path was provided (ends with
.md):- Use that file directly
- Determine if it's a plan or review from filename
If a directory/folder was provided:
- If it starts with
.ai/, use it directly - Otherwise, treat it as a folder name within
.ai/ - Check for
review.mdfirst, thenplan.md
If no argument provided:
- Extract issue number from branch name (e.g.,
feature/59-...→59) - Look for existing
.ai/issue-<number>-*folder - Check for
review.mdfirst, thenplan.md
If no source file found:
- Suggest running
/create-planfor new work - Suggest running
/code-reviewif code exists but needs review
Verify Prerequisites
- Confirm on correct feature branch
- Check working directory is clean (
git status) - Ensure tests pass before starting:
go test ./...
Load Guidelines
- Read CODING_GUIDELINES.md for implementation standards
- Read COMMIT_GUIDELINES.md for commit format
- Read GIT_TEST_SCENARIOS.md when implementing tests (required for Git scenario setup)
Execute Work
For Plan Mode (implementing from plan.md)
Tests come first. The plan's Test Plan section was gated by
/validate-testsand is authoritative:- Confirm the plan was gated:
.ai/<folder>/codex-test-plan.mdexists. If not, stop and run/validate-testsfirst - Implement all Test Plan scenarios as tests before any production code
- Verify they fail for the right reason — missing behavior, not setup bugs — then commit the tests
- Only then work through the remaining implementation tasks
For each task in the plan:
Before Each Task:
- Review task requirements and identify all files to modify
- Read CODING_GUIDELINES.md rules relevant to the change
Code Changes:
- Make focused, atomic changes
- Follow existing patterns in the codebase
- Keep changes minimal — don't over-engineer
After Each Task:
- Verify build:
go build ./... - Run tests:
go test ./... - Review changes:
git diff
Test Immutability Rule (Plan Mode)
Tests MUST NOT be changed to make the implementation pass. If the implementation and a test disagree, the test plan is challenged — not quietly edited:
- Stop implementing. Re-read the spec/analysis and the Test Plan and determine which is wrong: the implementation approach (usual case — fix the implementation) or genuinely the test plan
- If the test plan must change: revise the Test Plan section, re-run
the
/validate-testsCodex gate on the revised plan, and append an entry to the plan's Test Plan Revisions section: what changed, why, revision count - Then update the affected tests to match the revised plan and continue
Abort rule: if this happens more than 3 times in one implementation, error out — stop all work, leave the branch as-is, and report to the user that the plan and implementation are fundamentally at odds and need human review. Do not attempt a fourth revision.
For Review Mode (implementing from review.md)
For each issue found in the review:
Must fix:
- Address all must-fix issues before continuing
- These prevent the PR from being merged
Should fix:
- Address should-fix items that improve code quality
- Document any intentionally skipped with rationale
Nit:
- Consider implementing if they improve the code
- Skip if they add unnecessary complexity
After Fixes:
- Verify build:
go build ./... - Run tests:
go test ./... - Review changes:
git diff
- Confirm the plan was gated:
Commit Strategy
When to Commit
- After completing a logical unit of work
- After each checkpoint in the plan (plan mode)
- After fixing a category of issues (review mode)
- Keep commits atomic and focused
- Use
/commitskill for proper formatting
Checkpoint Verification
At each checkpoint:
- Build succeeds:
go build ./... - Tests pass:
go test ./... - Expected behavior works
- Changes committed
- Build succeeds:
Track Progress
For plan mode - update plan.md checkboxes:
- [x] Completed task - [ ] Pending taskFor review mode - update review.md checkboxes:
- [x] Fixed: <issue description> - [ ] Pending: <issue description>Handle Issues
If problems arise:
- Document the issue
- Check if it affects the plan/review
- Adjust approach if needed
- Ask for clarification if blocked
Completion
For Plan Mode:
- Verify all tests pass
- Check all checkboxes in plan.md are complete
- Suggest running
/code-reviewbefore PR
For Review Mode:
- Verify all tests pass
- Check all blocking issues are resolved
- Update review.md with fixes applied
- Ready for PR if all blocking issues fixed