6.1 KiB
| description |
|---|
| Implement a new feature following existing patterns, fully autonomously without stopping |
Adding a New Feature (Fully Autonomous Execution Mode)
Important: This workflow is designed to run fully automatically from start to finish without user intervention. After completing each step, immediately move on to the next step. Do not ask the user for confirmation mid-thought or interrupt the work.
Argument: feature name (e.g. /add-feature User profile editing)
Step 1: Preparation and Context Setup
- Establish the current task context:
- Feature name:
[the feature name given as an argument] - Date:
[get the current date in YYYYMMDD format] - Steering directory path:
.steering/[date]-[feature name]/
- Create the steering directory above.
- Create the following three empty files:
[steering directory path]/requirements.md[steering directory path]/design.md[steering directory path]/tasklist.md
Step 2: Understand the Project
- Read
CLAUDE.mdto grasp the overall picture of the project. - Review the persistent documents in the
docs/directory to understand the relevant design philosophy and architecture.
Step 3: Investigate Existing Patterns
- Use the Grep tool to search the source code (
src/) for keywords related to the feature name.
Grep('[keyword related to the feature]', 'src/')
- Analyze the search results to identify existing implementation patterns, naming conventions, and how components are used.
Step 4: Planning Phase (Automatic Generation of Steering Files)
- Run
Skill('steering')in planning mode to generate the contents of the three files created in Step 1 (requirements.md,design.md,tasklist.md). - Once this step completes successfully, never stop; immediately proceed to Step 5.
Step 5: Implementation Loop (Fully Working Through tasklist.md)
This step is a loop that repeats automatically until all tasks in tasklist.md are [x].
Once this step completes successfully, never stop; immediately proceed to Step 6.
Loop start:
- Read the task list:
- Read the
[steering directory path]/tasklist.mdfile.
- Check progress:
- Check whether any incomplete tasks (
[ ]) exist in the file. - If no incomplete tasks exist: consider this implementation loop complete and immediately proceed to Step 6.
- If incomplete tasks exist: proceed to the next step (3. Execute the task).
- Execute the task:
- Identify one incomplete task at the top of
tasklist.md. - Carry out the implementation work needed to complete that task.
- Use
Skill('steering')in implementation mode. - Always follow the coding standards in
Skill('development-guidelines').
- Update the task list:
- Once the executed task is complete, use the
Edittool to updatetasklist.md, changing the task from[ ]to[x].
- Continue the loop:
- Return to the top of Step 5 (1. Read the task list) and repeat the process.
* Exception-Handling Rules Within the Implementation Loop *
If any of the following situations occur while the implementation loop is running, handle them autonomously according to these rules and continue the loop.
-
Rule A: When a task is too large
- Handling: Break the current task into multiple smaller subtasks. Use the
Edittool to delete the original task and insert the new subtasks (with[ ]) in its place. Then continue the loop.
- Handling: Break the current task into multiple smaller subtasks. Use the
-
Rule B: When a task becomes unnecessary for technical reasons
- Condition: Apply only when there is a clear technical reason, such as a change in implementation approach, architecture, or dependencies.
- Handling: Use the
Edittool to update the task in the format[x] ~~task name~~ (Reason: [briefly describe the specific technical reason]). Then continue the loop.
-
❌ Strictly Forbidden Actions:
- Intentionally skipping an incomplete task for reasons such as "do it later" or "make it a separate task."
- Leaving incomplete tasks unaddressed and ending the loop without reason.
- Asking the user to make a decision.
Step 6: Implementation Validation (Launch a Subagent)
- Do a final check that all tasks in
tasklist.mdare complete. - Use the
Tasktool to launch theimplementation-validatorsubagent to validate quality.
subagent_type: "implementation-validator"description: "Implementation quality validation"prompt: "Please validate the quality of all the changes related to the[feature name]implemented this time. The target files are[list of paths of the implemented files]. Focus on coding standards, error handling, testability, and consistency with existing patterns."
Once this step completes successfully, never stop; immediately proceed to Step 7.
Step 7: Run Automated Tests
- Run the following commands in order and confirm that all tests pass.
Bash('npm test')
Bash('npm run lint')
Bash('npm run typecheck')
- If any command produces an error, analyze the problem, generate and apply a fix, and then run this step again.
Once this step completes successfully, never stop; immediately proceed to Step 8.
Step 8: Retrospective and Document Updates
- Run
Skill('steering')in retrospective mode and record handover notes intasklist.md.
- Implementation completion date
- Differences between plan and actual
- Lessons learned
- Improvement suggestions for next time
-
Determine whether this change affects the project's fundamental design or architecture.
-
If there is an impact, use the
Edittool to update the relevant persistent documents indocs/.
Completion Criteria
This workflow completes automatically once all of the following conditions are met.
- Step 5: All tasks in
tasklist.mdare complete ([x]or skipped for a valid reason). - Step 6: The
implementation-validatorsubagent's validation passes. - Step 7: The
test,lint, andtypecheckcommands all succeed without errors. - Step 8: Handover notes are recorded in
tasklist.md.
Until these completion criteria are met, continue to think autonomously, solve problems, and carry on the work.