Skill: Structured Multi-Stage Workflow
Version: 1.0 Author: [Your Name/Team]
Overview
This skill formalizes the standard Inspect→Plan→Execute development cycle into a structured, multi-stage workflow. It is designed to guide an agent through a systematic process of understanding, implementing, and verifying a change request. Each stage has clear entry and exit criteria, produces specific artifacts, and includes updates to project tracking systems.
Stage 1: Clarification & Specification
Objective: To transform an initial user request into a well-defined, actionable specification.
Entry Criteria:
- •A new task or change request has been received from the user.
Process:
- •Analyze Request: Carefully read the user's request to understand the high-level goal.
- •Ask Clarifying Questions: If the request is ambiguous, incomplete, or contains conflicting requirements, use the
request_user_inputtool to ask targeted questions. - •Negotiate Scope: Work with the user to define clear, achievable boundaries for the task.
- •Formalize Specification: Document the agreed-upon requirements.
Exit Criteria:
- •All ambiguities in the user request have been resolved.
- •A clear, documented specification has been agreed upon with the user.
Artifacts:
- •Specification Document: A clear, written summary of the task requirements, scope, and acceptance criteria. This may be recorded in the agent's internal memory, a project management tool, or a temporary markdown file.
Tracking:
- •Task Status: Update the task from
NewtoIn ProgressorSpecification. - •Technical Debt: Log any identified compromises or future work that is out of scope for the current task.
Stage 2: Inspection & Discovery
Objective: To build a comprehensive understanding of the existing codebase and its context relevant to the task.
Entry Criteria:
- •A clear specification from Stage 1.
Process:
- •File & Directory Listing: Use
list_filesto explore the repository structure. - •Code Review: Use
read_fileto examine relevant files identified in the previous step. Pay attention to coding patterns, existing abstractions, and potential areas of impact. - •Search & Grep: Use
run_in_bash_sessionwithgrepto find all occurrences of specific functions, variables, or patterns related to the task. - •Read Documentation: Review
README.md,AGENTS.md, and any other relevant documentation files. - •Synthesize Findings: Consolidate the gathered information to build a mental model of the change.
Exit Criteria:
- •The agent has a sufficient understanding of the codebase to formulate a detailed implementation plan.
- •All relevant files, modules, and dependencies have been identified.
Artifacts:
- •Discovery Notes: A collection of findings, including a list of files to be modified, key code snippets, and a summary of the architectural approach.
Tracking:
- •Task Status: No change, remains
In ProgressorSpecification. - •Technical Debt: Update or add items based on discoveries (e.g., outdated dependencies, poor code quality in areas to be modified).
Stage 3: Planning
Objective: To create a detailed, step-by-step implementation plan.
Entry Criteria:
- •Completion of the Inspection stage.
- •A set of discovery artifacts.
Process:
- •Decompose the Problem: Break down the high-level specification into smaller, manageable implementation steps.
- •Sequence the Steps: Order the steps logically, considering dependencies between them.
- •Define Verification for Each Step: For each step, determine how the outcome will be verified (e.g., "confirm file exists with
ls," "run unit test and expect it to fail"). - •Formalize the Plan: Use the
set_plantool to articulate the final plan. The plan must include a pre-commit step for final checks.
Exit Criteria:
- •A formal plan has been created and stored using the
set_plantool. - •The user has approved the plan if it's the first plan for the task.
Artifacts:
- •Implementation Plan: The structured plan set via the
set_plantool.
Tracking:
- •Task Status: Update to
In ProgressorImplementation.
Stage 4: Execution
Objective: To implement the code changes as defined in the plan.
Entry Criteria:
- •An approved implementation plan from Stage 3.
Process:
- •Execute Plan Step-by-Step: Follow the plan meticulously, executing one step at a time.
- •Write Code: Use tools like
write_fileandreplace_with_git_merge_diffto create or modify files. - •Write Tests: When implementing new features or fixing bugs, write corresponding unit or integration tests. Practice test-driven development where appropriate.
- •Verify Each Step: After each modification, use a read-only tool (
read_file,list_files, etc.) to confirm the change was applied correctly. - •Mark Step Complete: Use
plan_step_completeto move to the next step.
Exit Criteria:
- •All steps in the implementation plan have been completed.
- •The code has been modified and new tests have been written.
Artifacts:
- •Modified Source Code: The changes made to the repository's files.
- •New Tests: The test files added to validate the changes.
Tracking:
- •Task Status: Remains
In ProgressorImplementation.
Stage 5: Verification & Submission
Objective: To validate the completed work against the specification and submit it.
Entry Criteria:
- •All plan steps from the Execution stage are complete.
Process:
- •Run All Tests: Execute the entire test suite to ensure the changes have not introduced any regressions.
- •Perform Pre-Commit Checks: Call
pre_commit_instructionsand follow all required steps (e.g., linting, static analysis, final verification). - •Manual Verification (if applicable): If the change impacts a user interface or requires visual confirmation, use appropriate verification tools and generate screenshots.
- •Submit for Review: Once all checks pass, use the
submittool with a clear, descriptive commit message.
Exit Criteria:
- •All tests and pre-commit checks pass.
- •The change has been successfully submitted.
Artifacts:
- •Test Results: Output from the test runner.
- •Verification Screenshots (if applicable).
- •Commit: The final commit pushed to the repository.
Tracking:
- •Task Status: Update to
Completed,In Review, orDone. - •Technical Debt: Ensure all related debt items are linked to the completed task.