QRSPI: Implement
Context
Execute the implementation plan slice by slice. Each slice is built, tested, reviewed by the human, and committed before moving to the next. Progress is tracked in tasks.json so the workflow survives session restarts. This is the most complex skill — it loops through slices, delegates scouting to sub-agents for context gathering, and manages human checkpoints between each slice.
Prerequisites
- Phase
worktreemust be complete (check manifest.json or tasks.json existence) - Should be run from inside the worktree directory (where
.copilot-qrspi-active/exists)
Instructions
Locate the specs directory. Check for
.copilot-qrspi-active/in the current directory:ls .copilot-qrspi-active/tasks.jsonIf not found, check if we're in the main repo and look for the worktree path in the manifest. Guide the user to
cdinto the worktree.Read
tasks.jsonfrom.copilot-qrspi-active/.Find the next pending slice (first slice where
statusis"pending").If no pending slices remain:
- Report that all slices are complete
- Show a summary of what was built
- Prompt the user to proceed with the
qrspi-prskill when ready - Stop here
Mark the current slice as
"in_progress"intasks.json. Write the update to disk immediately.Load only the current slice's section from
.copilot-qrspi-active/plan.md.Load relevant design decisions from
.copilot-qrspi-active/design.md— only the decisions that apply to this slice, not the entire document.For each step in the current slice: a. If the step requires understanding current file state, delegate to a scout via the
tasktool (agent_type:explore) to read the file and summarize its current structure b. Implement the code change as specified in the plan c. Run any per-step verifications if applicableAfter all steps in the slice are complete, run the slice's checkpoint commands:
# Commands from tasks.json checkpoint.commandsIf a checkpoint command fails:
- Show the full error output to the user
- Diagnose the failure — read error messages, check the code
- Attempt to fix the issue
- Re-run the checkpoint
- If the fix doesn't work after 2 attempts, ask the user how to proceed
If the checkpoint passes:
- Update
tasks.json: mark the slice as"complete", setcheckpoint.passed = true - Advance
current_sliceto the next index - Write the updated
tasks.jsonto disk
- Update
Present the completed slice to the user:
- Summary of what was implemented
- Checkpoint results (pass/fail, output)
- Run
git diff --statto show what changed - Run
git difffor a full view if the changes are small (≤100 lines), otherwise just show the stat
Wait for user review. The user may:
- Approve the slice → proceed to commit
- Request changes → iterate on the code, re-run checkpoints
- Reject the slice → discuss and potentially revise the approach
Once approved, commit the slice:
git add -A git commit -m "feat({feature-name}): slice {N} - {slice name}"Check context utilization (aim to keep it under ~40%; treat ~60% as the signal to restart). If the session has been running for many slices and context is getting long:
- Suggest the user re-invoke the
qrspi-implementskill in a fresh session tasks.jsontracks progress, so the new session picks up exactly where this one left off
- Suggest the user re-invoke the
Loop back to step 3 for the next slice.
Sub-Agent Tasks
Delegate scouting sparingly during implementation — only when you need to understand the current state of a file you haven't read yet, or to check how a pattern is used elsewhere in the codebase.
Scout prompt template:
Read {file-path} and summarize:
1. Current exports/public interface
2. Key functions and their signatures
3. How this file relates to {context from the current slice}
Return a <=30-line summary.
Output Format
Progress is tracked in tasks.json which is updated after each slice:
{
"slices": [
{ "name": "Slice 1: ...", "status": "complete", "checkpoint": { "passed": true } },
{ "name": "Slice 2: ...", "status": "in_progress", "checkpoint": { "passed": false } },
{ "name": "Slice 3: ...", "status": "pending", "checkpoint": { "passed": false } }
],
"current_slice": 1
}
Each slice produces a git commit with message format: feat({feature-name}): slice {N} - {slice name}
Human Checkpoint
After each completed slice:
- Show diff summary and checkpoint results
- Wait for explicit approval before committing
- Accept iteration requests — fix issues and re-present
- Only advance to the next slice after human approval