| name | execute |
| description | Execute approved implementation plans with TaskList tracking, test verification, and success criteria validation. Use when you have an approved *_PLAN.md file and need step-by-step implementation with comprehensive tracking. Outputs implemented code, test results, and execution summary. Documentation handled by record skill. Korean triggers: ๊ณํ ์คํ, ํ๋ ์คํ, ๊ตฌํ ์์, ๊ฐ๋ฐ ์์, ์ฝ๋ฉ ์์, ์์
์์, ์คํํด์ค, ๊ตฌํํด์ค, ๋ง๋ค์ด์ค, ๊ฐ๋ฐํด์ค, ์ฝ๋ ์์ฑ, ๊ธฐ๋ฅ ๊ตฌํ, ํ์คํฌ ์คํ. |
Execute Plan
โ ๏ธ CRITICAL LANGUAGE POLICY
DEFAULT LANGUAGE: KOREAN (ํ๊ตญ์ด)
ALL outputs, documentation, code comments, and communications MUST be in KOREAN unless explicitly requested otherwise by the user.
- โ
Code comments: Write in Korean
- โ
Documentation: Write in Korean
- โ
TaskList items: Write in Korean
- โ
Progress updates: Provide in Korean
- โ
User communication: Respond in Korean
Exception: If the user writes in another language, match that language for responses.
This is a MANDATORY requirement. Do NOT default to English.
When to Use This Skill
Use this skill when:
- You have an approved implementation plan file (e.g.,
USER_AUTH_PLAN.md)
- User requests "execute this plan", "implement the plan", "run execute"
- Need to systematically implement multiple related tasks
- Want automatic progress tracking with TaskList
- Need to ensure all success criteria and tests are verified
Typical Workflow Position:
analyze โ plan โ **execute** โ record
Overview
This skill executes approved implementation plans through a 9-phase systematic process:
- Branch Validation: Verify working on a feature branch
- Plan Loading & Validation: Load plan file, parse tasks, verify prerequisites
- TaskList Setup: Create comprehensive TaskList from all plan tasks
- Task Execution: Execute tasks sequentially, respecting dependencies
- Handle Dependencies: Manage task dependencies and execution order
- Automated Test Generation (Conditional): Detect missing tests and generate them
- Testing & Verification: Run tests and verify success criteria
Note:
- Phase 4C (DB Migration Validation) and Phase 5 (Test Generation) are optional
- Documentation (README, CHANGELOG, Git commit) is handled by
record skill - not in execute
Workflow: 9-Phase Execution Process
Phase 0: Task Registration
โ ๏ธ CRITICAL: DO NOT SKIP PHASE 0
Objective: Register all Phases as Tasks to track progress throughout the execution workflow.
Register the following Phases in order using TaskCreate:
| Task | subject | activeForm |
|---|
| Phase 1 | Branch Validation | Validating branch |
| Phase 2 | Plan Loading and Validation | Loading and validating plan |
| Phase 3 | Setup TaskList from Plan | Setting up TaskList |
| Phase 4 | Execute Tasks Sequentially | Executing tasks |
| Phase 5 | Handle Dependencies | Handling dependencies |
| Phase 5C | Database Migration Validation (conditional) | Validating database migration |
| Phase 6 | Automated Test Generation (conditional) | Generating automated tests |
| Phase 7 | AC Achievement Report | Generating AC report |
| Phase 7.5 | Independent QA Gate (wf:qa spawn) | Awaiting wf:qa verdict |
| Phase 8 | Testing and Verification | Testing and verifying |
Task Tracking Rules:
- On Phase entry:
TaskUpdate(taskId, status: "in_progress")
- On Phase completion:
TaskUpdate(taskId, status: "completed")
- Conditional Phases (5C, 6) not executed:
TaskUpdate(taskId, status: "deleted")
- Only one Phase should be
in_progress at any time
Phase 1: Branch Validation
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
MANDATORY REQUIREMENT:
- DO NOT assume you are on the correct branch
- ALWAYS verify branch status using the MCP tool below
- NEVER start code modification (Phase 2) without completing Phase 1
Why this matters:
- Code changes in main/master branch can cause merge conflicts
- Modifying main/master while working on features is dangerous
- Branch isolation prevents accidental commits to production branches
Objective: Verify that you are working on a feature branch.
Steps:
1. Check Branch Protection Status
Use check_branch_protection MCP tool:
Tool: check_branch_protection
Returns:
- branch: ํ์ฌ ๋ธ๋์น ์ด๋ฆ
- is_protected: ๋ณดํธ ๋ธ๋์น ์ฌ๋ถ (main/master/staging)
- needs_new_branch: ์ ๋ธ๋์น ์์ฑ ํ์ ์ฌ๋ถ
- message: ์ํ ๋ฉ์์ง
2. Branch Decision
- If
is_protected is false: Proceed directly to Phase 2
- If
is_protected is true: Proceed to Step 3
3. Ask User - Branch Action
Use AskUserQuestion tool to provide options:
questions:
- question: "ํ์ฌ ๋ณดํธ๋ ๋ธ๋์น({branch})์์ ์์
์ค์
๋๋ค. ์ด๋ป๊ฒ ์งํํ ๊น์?"
header: "Branch"
options:
- label: "์ ๋ธ๋์น ์์ฑ (Recommended)"
description: "feature ๋ธ๋์น๋ฅผ ์์ฑํ์ฌ ์์ ํ๊ฒ ์์
ํฉ๋๋ค"
- label: "ํ์ฌ ๋ธ๋์น์์ ๊ณ์"
description: "โ ๏ธ ๋ณดํธ๋ ๋ธ๋์น์์ ์ง์ ์์
ํฉ๋๋ค (๊ถ์ฅํ์ง ์์)"
- If "์ ๋ธ๋์น ์์ฑ" selected: Proceed to Step 4
- If "ํ์ฌ ๋ธ๋์น์์ ๊ณ์" selected: Display warning and proceed to Phase 2
- Output:
โ ๏ธ ๋ณดํธ๋ ๋ธ๋์น({branch})์์ ์ฝ๋๋ฅผ ์์ ํฉ๋๋ค. ๋ณ๊ฒฝ์ฌํญ์ด ์ง์ ๋ฐ์๋ฉ๋๋ค.
4. Ask User - Branch Name
Use AskUserQuestion tool to select branch name:
questions:
- question: "์์ฑํ ๋ธ๋์น ์ด๋ฆ์ ์ ํํ์ธ์"
header: "Name"
options:
- label: "feature/{PLAN_NAME}"
description: "PLAN ํ์ผ๋ช
๊ธฐ๋ฐ ์ถ์ฒ ๋ธ๋์น ์ด๋ฆ"
- label: "์ง์ ์
๋ ฅ"
description: "์ํ๋ ๋ธ๋์น ์ด๋ฆ์ ์ง์ ์
๋ ฅํฉ๋๋ค"
Branch Name Suggestion Logic:
- If PLAN file exists: Suggest
feature/{ID_from_PLAN} format
- If JIRA ID exists: Suggest
feature/JIRA-123 format
- Otherwise: Suggest
feature/execute-{YYYYMMDD} format
5. Create Feature Branch
Use create_feature_branch MCP tool:
Tool: create_feature_branch
Args:
- branch_name: ์ ํ๋ ๋๋ ์
๋ ฅ๋ ๋ธ๋์น ์ด๋ฆ
Returns:
- success: ์ฑ๊ณต ์ฌ๋ถ
- branch: ์์ฑ๋ ๋ธ๋์น ์ด๋ฆ
- message: ๊ฒฐ๊ณผ ๋ฉ์์ง
Phase 2: Plan Loading and Validation
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Load and understand the plan, validate prerequisites are met.
Steps:
-
Load the Plan File
Read(planFilePath)
-
Parse Plan Structure
- Use
mcp__plugin_seq-think_st__sequentialthinking to understand:
- Task breakdown and priorities (P0 โ P1 โ P2 โ P3)
- Dependencies between tasks
- Success criteria for each task
- Testing strategies
- Risk mitigations
- Expected tools and MCP servers
-
Validate Prerequisites
-
Report Validation Results
- โ
All prerequisites met โ Proceed to Phase 2
- โ Blockers found โ Report issues, get user guidance
Phase 3: Setup TaskList from Plan
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Create comprehensive TaskList mirroring the entire plan using TaskCreate.
TaskList Structure:
// Register each plan task using TaskCreate
TaskCreate({subject: "[P0] Setup authentication infrastructure", description: "...", activeForm: "Setting up authentication infrastructure"})
TaskCreate({subject: "[P0] Configure OAuth2 providers", description: "depends on setup", activeForm: "Configuring OAuth2 providers"})
TaskCreate({subject: "[P1] Implement user session management", description: "...", activeForm: "Implementing user session management"})
TaskCreate({subject: "[P1] Create login/logout endpoints", description: "...", activeForm: "Creating login/logout endpoints"})
TaskCreate({subject: "[P2] Add user profile page", description: "...", activeForm: "Adding user profile page"})
TaskCreate({subject: "[P3] Implement remember me feature", description: "...", activeForm: "Implementing remember me feature"})
// Mark first task as in_progress
TaskUpdate({taskId: firstTaskId, status: "in_progress"})
TaskList Principles:
- Register ALL tasks from the plan using
TaskCreate (no skipping)
- Order by priority: P0 โ P1 โ P2 โ P3
- Note dependencies in task descriptions
- Mark first task as
in_progress using TaskUpdate
- Exactly ONE task should be
in_progress at any time
Phase 4: Execute Tasks Sequentially
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Implement each task following the plan's approach.
For Each Task:
3A. Start Task
TaskUpdate({taskId: currentTaskId, status: "in_progress"})
- Goal: What this task achieves
- Success Criteria: How to verify completion
- Dependencies: What must be done first
- Implementation Approach: Step-by-step guide
- Testing Strategy: How to test this task
3B. Gather Context
Use appropriate tools based on task needs:
Code Reading/Understanding:
mcp__plugin_serena_serena__get_symbols_overview({relative_path: "src/auth/service.ts"})
mcp__plugin_serena_serena__find_symbol({name_path: "AuthService/login", include_body: true})
mcp__plugin_serena_serena__find_referencing_symbols({name_path: "login", relative_path: "src/auth/service.ts"})
mcp__plugin_serena_serena__search_for_pattern({substring_pattern: "OAuth.*config"})
Documentation:
mcp__plugin_context7_context7__resolve-library-id({libraryName: "passport"})
mcp__plugin_context7_context7__get-library-docs({context7CompatibleLibraryID: "/jaredhanson/passport"})
Project Management:
mcp__plugin_atlassian_atlassian__jira_get_issue({issue_key: "PROJ-123"})
mcp__plugin_sentry_sentry__get_issue_details({organizationSlug, issueId})
3C. Implement Task
Follow the implementation approach defined in the plan:
Code Editing:
mcp__plugin_serena_serena__replace_symbol_body({
name_path: "AuthService/login",
relative_path: "src/auth/service.ts",
body: newImplementation
})
mcp__plugin_serena_serena__insert_after_symbol({
name_path: "AuthService",
relative_path: "src/auth/service.ts",
body: newMethodCode
})
mcp__plugin_serena_serena__rename_symbol({
name_path: "oldName",
relative_path: "src/auth/service.ts",
new_name: "newName"
})
Apply Risk Mitigations:
- Refer to risk mitigation strategies in the plan
- Implement safeguards as specified
- Add error handling as noted
3D. Verify Success Criteria
Check ALL success criteria for the task:
mcp__plugin_serena_serena__think_about_task_adherence()
- [ ] Criterion 1: [Check if met]
- [ ] Criterion 2: [Check if met]
- [ ] Criterion 3: [Check if met]
Run Tests:
npm test src/auth/login.test.ts
pytest tests/test_auth.py -v
Verify Test Results:
- All tests pass โ
- No regressions introduced โ
- Coverage meets targets โ
3E. Complete Task
TaskUpdate({taskId: currentTaskId, status: "completed"})
"โ
Task completed: [Task Name]
- All success criteria met
- Tests passing: [Test results]
- Deviations: [None / List deviations]"
"๐ Moving to next task: [Next Task Name]"
Progress Reporting:
๐ Progress: [X/Y tasks completed]
โ
Completed: [Recent task]
๐ Current: [Next task description]
โณ Next: [Following task]
๐ซ Blocked: [Any blocked tasks]
Phase 5: Handle Dependencies
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Manage task dependencies and execution order.
Dependency Rules:
- Before starting a task, verify ALL dependencies are completed
- If dependency not met, skip to next available task
- Track blocked tasks and revisit when unblocked
- Follow critical path identified in plan
Example Flow:
Task A (completed) โ Task B (in_progress) โ Task D (pending, blocked by B)
โ Task C (pending, no deps) โ Can start C in parallel
Handling Blocked Tasks:
- Mark task as "pending" (not "in_progress" if blocked)
- Document blocker reason
- Move to next unblocked task
- Return to blocked task when dependency resolves
Phase 5C: Database Migration Validation (Optional)
๐ Task Tracking: Mark as in_progress/completed if condition met. Mark as deleted if skipped.
Objective: Automatically detect and block dangerous DB migration patterns
Execution Condition: When the plan contains DB migration related tasks
Steps:
1. Detect Migration Files
find . -path "*/migrations/*.sql" -o -path "*/db/migrate/*.rb" -o -path "*/migrations/*.ts"
2. Analyze Dangerous Patterns
Detect dangerous patterns using the following regular expressions:
const dangerousPatterns = {
notNull: /ADD COLUMN .* NOT NULL(?! DEFAULT)/i,
dropColumn: /DROP COLUMN/i,
dropTable: /DROP TABLE/i,
alterType: /ALTER COLUMN .* TYPE/i,
addIndex: /CREATE INDEX(?! CONCURRENTLY)/i
};
for (const file of migrationFiles) {
const content = readFile(file);
for (const [risk, pattern] of Object.entries(dangerousPatterns)) {
if (pattern.test(content)) {
warnings.push({
file,
risk,
severity: (risk === 'notNull' || risk === 'dropColumn' || risk === 'dropTable')
? 'CRITICAL'
: 'HIGH'
});
}
}
}
3. Warning and Approval Request
When dangerous patterns are found, output warning messages in the following format:
## โ ๏ธ Database Migration Risk Detected
### CRITICAL Risk
- **File**: migrations/20231209_add_user_email.sql
- **Pattern**: `ADD COLUMN email VARCHAR(255) NOT NULL`
- **Problem**: Existing rows cannot have NULL โ Migration fails
- **Solution**: Add DEFAULT or 2-step migration (1. ADD COLUMN with DEFAULT, 2. ALTER COLUMN DROP DEFAULT)
### HIGH Risk
- **File**: migrations/20231209_alter_user_type.sql
- **Pattern**: `ALTER COLUMN user_type TYPE VARCHAR(50)`
- **Problem**: Table lock occurs, long duration on large tables
- **Solution**: Add new column โ Copy data โ Drop old column (Zero-downtime migration)
**Action Required**:
- Stop execution on CRITICAL risk
- Proceed with user approval for HIGH risk
4. Execution Stop Logic
if (warnings.some(w => w.severity === 'CRITICAL')) {
console.log('โ CRITICAL migration risk detected - execution stopped');
console.log('Please fix migration files and try again.');
process.exit(1);
}
if (warnings.some(w => w.severity === 'HIGH')) {
console.log('โ ๏ธ HIGH migration risk detected - user approval required');
}
5. Detect Dangerous Patterns with Grep (Implementation Example)
grep -rE 'ADD COLUMN .* NOT NULL(?! DEFAULT)' migrations/
grep -rE 'DROP (COLUMN|TABLE)' migrations/
grep -rE 'ALTER COLUMN .* TYPE' migrations/
grep -rE 'CREATE INDEX(?! CONCURRENTLY)' migrations/
Best Practices:
- Run Phase 4C right after Phase 4, before Phase 5 (Test Generation)
- Skip this Phase if no migration files exist
- Stop immediately on CRITICAL risk (user safety first)
- For HIGH risk, output warning only and proceed (user judgment)
Phase 6: Automated Test Generation (Conditional)
๐ Task Tracking: Mark as in_progress/completed if condition met. Mark as deleted if skipped.
Objective: Detect files missing tests and generate them
Execution Condition:
- After Phase 3 (Task Execution) completion, before Phase 6 (Testing)
- Conditional: When test files don't exist for changed files
Steps:
1. Check Changed Files
git diff --name-only HEAD
git diff --name-only HEAD~1..HEAD
2. Check Test File Existence
for file in $(git diff --name-only HEAD | grep -E 'src/.*\.(ts|js)$'); do
testfile=$(echo $file | sed 's/\.ts$/.test.ts/' | sed 's/\.js$/.test.js/')
if [ ! -f "$testfile" ]; then
echo "โ ๏ธ Missing test: $file"
fi
done
3. Design Test Cases with Sequential Thinking
When files missing tests are found, systematically analyze with Sequential Thinking:
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Analyzing processPayment function: input is amount (number), output is Promise<PaymentResult>",
thoughtNumber: 1,
totalThoughts: 6,
nextThoughtNeeded: true
})
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Input constraints: amount must be >= 0 and <= 1,000,000",
thoughtNumber: 2,
totalThoughts: 6,
nextThoughtNeeded: true
})
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Dependencies: calls PaymentAPI.process() โ needs mocking",
thoughtNumber: 3,
totalThoughts: 6,
nextThoughtNeeded: true
})
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Edge cases: 1) amount = 0 (boundary), 2) amount = 1000000 (max), 3) amount = -1 (negative), 4) amount = 1000001 (overflow)",
thoughtNumber: 4,
totalThoughts: 6,
nextThoughtNeeded: true
})
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Error cases: 1) API call failure, 2) network timeout, 3) invalid response format",
thoughtNumber: 5,
totalThoughts: 6,
nextThoughtNeeded: true
})
mcp__plugin_seq-think_st__sequentialthinking({
thought: "Test case design complete: Happy path (2), Edge cases (4), Error cases (2) - Total 8 cases",
thoughtNumber: 6,
totalThoughts: 6,
nextThoughtNeeded: false
})
4. Test Case Classification
| Category | Test Case | Description |
|---|
| Happy path | Normal amount | Returns expected result with valid input |
| Happy path | Minimum amount | Success with minimum valid value |
| Edge cases | Boundary (0) | Test minimum boundary value |
| Edge cases | Maximum (1000000) | Test maximum allowed value |
| Edge cases | Negative (-1) | Test negative input rejection |
| Edge cases | Overflow (1000001) | Test max value exceeded rejection |
| Error handling | API failure | Handle external API failure |
| Error handling | Timeout | Handle network timeout |
5. Write Test Code with AAA Pattern
AAA Pattern (Arrange-Act-Assert):
- Arrange: Prepare objects and data needed for test
- Act: Execute the function/method under test
- Assert: Verify result matches expected value
describe('processPayment', () => {
describe('์ ์ ์ฒ๋ฆฌ', () => {
it('์ ์ ๊ธ์ก(100)์ผ๋ก ๊ฒฐ์ ์ฑ๊ณต', async () => {
const amount = 100;
const expectedResult = { success: true, transactionId: 'TX123' };
(PaymentAPI.process as jest.Mock).mockResolvedValue(expectedResult);
const result = await processPayment(amount);
expect(result).toEqual(expectedResult);
expect(PaymentAPI.process).toHaveBeenCalledWith(expect.objectContaining({
amount: 100
}));
});
});
describe('๊ฒฝ๊ณ๊ฐ ํ
์คํธ', () => {
it('์์ ๊ธ์ก(-1)์ผ๋ก ์๋ฌ ๋ฐ์', async () => {
const amount = -1;
await expect(processPayment(amount))
.rejects
.toThrow('Invalid amount');
});
});
describe('์๋ฌ ์ฒ๋ฆฌ', () => {
it('API ํธ์ถ ์คํจ ์ ์๋ฌ ์ ํ', async () => {
const amount = 100;
const apiError = new Error('API Error');
(PaymentAPI.process as jest.Mock).mockRejectedValue(apiError);
await expect(processPayment(amount))
.rejects
.toThrow('API Error');
});
});
});
6. Given/When/Then Format (Alternative)
describe('processPayment', () => {
it('์ ์ ๊ธ์ก์ผ๋ก ๊ฒฐ์ ์ฑ๊ณต', async () => {
const amount = 100;
const expectedResult = { success: true };
mockPaymentAPI(expectedResult);
const result = await processPayment(amount);
expect(result).toEqual(expectedResult);
});
});
7. Verify Generated Tests
npm test -- payment.test.ts
npm test -- payment.test.ts --coverage
8. Update Report
Add generated test results to execution report:
## ๐ Auto-Generated Tests
### src/api/payment.test.ts (NEW)
- **Test Cases**: 8 generated
- **Coverage**: Line 92%, Branch 88%
- **Result**: โ
8/8 passed
- **Generation Time**: 45s
### src/utils/validator.test.ts (NEW)
- **Test Cases**: 12 generated
- **Coverage**: Line 95%, Branch 90%
- **Result**: โ
12/12 passed
- **Generation Time**: 30s
**Total Tests Added**: 20
**Average Coverage**: 93.5%
Best Practices:
- Run Phase 5 right after Phase 3 (Implementation), before Phase 6 (Testing)
- Skip this Phase if no missing tests
- If test generation fails, output warning only and proceed (non-blocking)
- Always run generated tests to verify
Phase 7: AC Achievement Report (Required)
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Automatically verify and report AC achievement after implementation
Execution Condition:
- After Phase 5 (Test Generation) completion
- When linked to a JIRA issue
Steps:
1. Call requirement-validator Agent (Mode 3)
First, collect changed files via Git diff:
git diff --name-only HEAD
Then use Task tool to invoke the requirement-validator agent:
Tool: Task
Args:
subagent_type: "wf:requirement-validator"
description: "AC post-validation"
prompt: |
Mode 3: Post-validation
๊ตฌํ ๊ฒฐ๊ณผ๊ฐ ๋ชจ๋ AC๋ฅผ ์ถฉ์กฑํ๋์ง ๊ฒ์ฆํฉ๋๋ค.
Input:
- JIRA issue key: {JIRA_KEY}
- Git diff ๊ฒฐ๊ณผ: {changed_files}
Output:
- AC ๊ตฌํ ์ํ ๋ฆฌํฌํธ
- ๋ฏธ๊ตฌํ AC ๋ชฉ๋ก (์๋ ๊ฒฝ์ฐ)
2. Analyze Results and Update TaskList
IF (unimplemented AC exists):
TaskCreate({
subject: "Handle unimplemented AC: Implement AC#2 'Account lock after 5 failures'",
description: "AC#2 ๋ฏธ๊ตฌํ - 5ํ ์คํจ ์ ๊ณ์ ์ ๊ธ ๊ธฐ๋ฅ ๊ตฌํ ํ์",
activeForm: "Handling unimplemented AC"
})
3. Output AC Achievement Report
## ๐ AC Implementation Status
| AC | Location | Status | Test | Coverage |
|----|----------|--------|------|----------|
| AC#1 | [UserService.ts:42](src/auth/UserService.ts#L42) | โ
Done | โ
Yes | 85% |
| AC#2 | โ Not implemented | Not implemented | โ No | - |
| AC#3 | [TokenService.ts:15](src/auth/TokenService.ts#L15) | โ
Done | โ
Yes | 90% |
**Total AC Achievement**: 66% (2/3)
### Next Actions
๐ด **CRITICAL**: AC#2 "Account lock after 5 failures" is not implemented!
**Recommendations**:
1. Implement LoginAttemptService
2. Add failure counter Redis storage logic
3. Implement account lock API after 5 failures
4. Write tests (Happy path + Edge cases)
5. Re-run Phase 6 to re-verify
**Added to TaskList** โ
4. Graceful Degradation When No JIRA Issue
IF (no JIRA issue):
"โน๏ธ Skipping AC verification - no JIRA issue linked."
โ Skip Phase 6, proceed to Phase 7
Phase 7.5: Independent QA Gate (wf:qa skill spawn)
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Why this phase exists: Phase 6 (auto test recovery) and Phase 7 (AC Achievement Report) are both run by the same session that wrote the code. That session is structurally biased to declare its own work done. Phase 7.5 hands acceptance verification off to wf:qa โ an independent skill that re-executes the original REPORT's reproduction scenarios and the PLAN's success criteria from scratch in the actual environment (test runs, API calls, UI checks via agent-browser, DB state). wf:qa must return PASS before this skill hands off to record.
This phase is the load-bearing complement to plan's external review gate (Phase 3 of wf:plan). Together they enforce: the executor is never the verifier.
Step A: qa skill spawn
Invoke wf:qa as a Skill (not as a sub-agent โ qa is user-invocable and runs as a skill):
Tool: Skill
Args:
skill: "wf:qa"
args: |
issue_id: {ISSUE_ID} # JIRA / GitHub / repo-specific issue id
report_path: {REPORT_PATH} # [ISSUE_ID]_REPORT.md from analyze
plan_path: {PLAN_PATH} # [FEATURE]_PLAN.md from plan (post-LGTM)
branch: {CURRENT_BRANCH} # e.g. feat/auth-middleware-merge
If wf:qa is not installed (skill resolution fails), output:
โ ๏ธ wf:qa skill is not available โ install the wf plugin's qa skill before
this phase can run. Falling back to manual verification request.
โฆand ask the user via AskUserQuestion whether to proceed without independent QA (NOT recommended โ explain the risk) or stop here.
Step B: Read the QA verdict
wf:qa writes its result to [ISSUE_ID]_QA.md (same convention as REPORT/PLAN). Read that file. Locate the final VERDICT: line.
Step C: Verdict gate
| Verdict | Action |
|---|
PASS | Proceed to Phase 8 (Testing and Verification โ quick smoke + final commit prep). |
FAIL | Read [ISSUE_ID]_QA.md "FAIL ์ ์์ ์์ฒญ" section. Apply the patch-level suggestions back in Phase 4 (Execute Tasks). After fixes, re-run wf:qa (loop back to Step A). Do NOT proceed to record. Do NOT self-declare PASS. |
The Worker does not produce its own PASS verdict for this phase. The exit gate is literally the contents of [ISSUE_ID]_QA.md.
Step D: When QA is genuinely not applicable
A small subset of changes legitimately have nothing for wf:qa to verify (e.g., a typo fix in a comment, a CHANGELOG-only commit, formatting-only changes). For those, wf:qa itself returns PASS quickly with a "trivial / no scenario to verify" note in [ISSUE_ID]_QA.md. Do not skip this phase to save time โ still spawn wf:qa and let it produce that note. The audit artifact is what gives record (Phase 9) confidence to publish.
Anti-pattern alert: Pre-v3.30 versions of execute exited via Phase 7 โ Phase 8 โ record without any independent acceptance gate. Test pass โ requirements met. If you find yourself thinking "Phase 7.5 is overhead, let me skip just this once", stop โ that's exactly the failure mode the gate exists to prevent.
Phase 8: Testing and Verification
๐ Task Tracking: Mark this Phase's Task as in_progress on entry, completed on completion.
Objective: Comprehensively test all implemented functionality with automatic failure recovery.
Step A: Run All Tests
Execute comprehensive test suite:
-
Unit Tests
npm test src/**/*.test.ts --coverage
pytest tests/unit/ -v --cov
-
Integration Tests
npm run test:integration
pytest tests/integration/ -v
-
Manual Tests
- Follow manual test cases from plan
- Verify UI/UX behavior
- Check error messages and edge cases
-
Performance Tests (if specified)
npm run test:performance
-
Security Tests (if specified)
npm run test:security
Step B: Analyze Test Results & Verification
Comprehensive Verification:
Run ALL verification checks:
const verificationResults = {
unitTests: runUnitTests(),
integrationTests: runIntegrationTests(),
manualTests: runManualTests(),
successCriteria: checkAllSuccessCriteria(),
noRegression: checkNoRegression(),
codeStandards: checkCodeStandards(),
noConsoleErrors: checkConsoleErrors(),
performance: checkPerformance(),
security: checkSecurity()
};
const allPassed = Object.values(verificationResults).every(result => result.passed);
Exit Condition Check:
IF (allPassed):
โ โ
All tests & verifications passed!
โ Skip to "Execution Complete" section
ELSE (any check failed):
โ โ Failures detected in: {failedChecks}
โ Proceed to Step C (Auto-Recovery Loop)
Step C: Test Failure Auto-Recovery Loop
โ ๏ธ AUTOMATIC RECOVERY: This loop automatically analyzes failures and attempts fixes.
Loop Variables:
retry_count = 0
max_retries = 3
WHILE (tests fail AND retry_count < max_retries) DO:
C-1: Analyze Failure Root Cause
Use mcp__plugin_seq-think_st__sequentialthinking to classify failure type:
const failureType = classify({
verificationResults,
testOutput,
implementedCode,
planRequirements
});
Classification Criteria:
| Type | Indicators | Example |
|---|
| IMPLEMENTATION_BUG | Logic error, wrong calculation, missing null check | Expected 100, got 0 โ calculation bug |
| PLAN_DESIGN_FLAW | Fundamental approach wrong, missing AC, architectural issue | Test expects feature X, but plan doesn't include X |
| SUCCESS_CRITERIA_UNMET | Task completed but success criteria not met | "User can login" criterion failed - login flow broken |
| CODE_STANDARDS_VIOLATION | ESLint errors, formatting issues, naming conventions | Unexpected var, use let/const instead |
| PERFORMANCE_ISSUE | Response time, memory usage, query performance | API response 5s (target: <500ms) |
| SECURITY_ISSUE | Vulnerabilities, exposed secrets, injection risks | SQL injection risk, exposed API key |
| REGRESSION | Previously working feature now broken | User logout worked before, now throws error |
| ENVIRONMENT_ISSUE | Connection errors, missing dependencies, permission issues | ECONNREFUSED, Module not found |
C-2: Apply Fix Strategy
Strategy 1: Implementation Bug (์ฝ๋ ์์ )
IF (failureType === "IMPLEMENTATION_BUG"):
1. Identify buggy code location from test output
2. Fix the implementation using Edit/Write tools
3. Re-run failed tests
4. IF (tests pass):
โ Continue to Step C-4
ELSE:
โ retry_count++, continue loop
Strategy 2: Plan Design Flaw (๊ณํ ์ฌ์์ฑ โ ์ฌ์คํ)
IF (failureType === "PLAN_DESIGN_FLAW"):
Output: "๐ Plan design flaw detected - invoking plan skill to revise"
1. โ ๏ธ **Invoke plan skill with failure context**:
Tool: Skill
Args:
skill: "wf:plan"
args: |
REVISION MODE: Fix plan based on test failures
Original Plan: [FEATURE]_PLAN.md
Test Failures:
{failure_details}
Root Cause: {root_cause_analysis}
Required Changes:
- {required_change_1}
- {required_change_2}
2. Wait for revised plan: [FEATURE]_PLAN_v2.md
3. โ ๏ธ **Re-execute from Phase 3 with revised plan**:
- Load revised plan
- Re-setup TaskList from revised plan
- Re-execute all tasks with new approach
- Re-run tests
4. IF (tests pass):
โ โ
Plan revision successful, exit loop
ELSE:
โ retry_count++, continue loop
Strategy 3: Success Criteria Unmet (์ฝ๋ ์์ ๋๋ ๊ธฐ์ค ์ฌ๊ฒํ )
IF (failureType === "SUCCESS_CRITERIA_UNMET"):
Output: "โ ๏ธ Success criteria not met - analyzing gap"
1. Identify which criteria failed:
- Compare plan success criteria vs actual behavior
- Document gaps
2. Determine if fixable with code changes:
IF (fixable with implementation):
โ Fix code to meet criteria
โ Re-run verification
ELSE (criteria unrealistic or plan flaw):
โ Invoke plan skill to revise criteria
โ Re-execute with updated plan
3. retry_count++, continue loop
Strategy 4: Code Standards Violation (์๋ ์์ )
IF (failureType === "CODE_STANDARDS_VIOLATION"):
Output: "๐ง Code standards violation - auto-fixing"
1. Run auto-fixers:
npm run lint:fix
npm run format
prettier --write .
2. For unfixable violations:
- Manually fix based on linter output
- Update code to follow conventions
3. Re-run verification
4. retry_count++, continue loop
Strategy 5: Performance Issue (์ต์ ํ)
IF (failureType === "PERFORMANCE_ISSUE"):
Output: "โก Performance issue - optimizing"
1. Profile performance bottleneck:
- Identify slow queries, loops, API calls
- Use Sequential Thinking to find root cause
2. Apply optimization strategy:
- Add caching
- Optimize queries (add indexes, reduce N+1)
- Use pagination
- Lazy loading
3. IF (optimization insufficient):
โ Invoke plan skill to redesign approach
โ Re-execute with optimized plan
4. Re-run performance tests
5. retry_count++, continue loop
Strategy 6: Security Issue (๋ณด์ ํจ์น)
IF (failureType === "SECURITY_ISSUE"):
Output: "๐ Security issue - patching"
1. Analyze security vulnerability:
- SQL injection risk โ Use parameterized queries
- XSS risk โ Sanitize inputs
- Exposed secrets โ Move to env vars
- CSRF risk โ Add CSRF tokens
2. Apply security fix:
- Fix vulnerable code
- Add validation/sanitization
- Update dependencies if needed
3. Re-run security tests
4. retry_count++, continue loop
Strategy 7: Regression (๋กค๋ฐฑ ๋๋ ์์ )
IF (failureType === "REGRESSION"):
Output: "โฎ๏ธ Regression detected - analyzing"
1. Identify what broke:
- Use git diff to find changes
- Identify affected components
2. Fix regression:
IF (simple fix):
โ Fix breaking change
โ Ensure both old and new features work
ELSE (fundamental conflict):
โ Invoke plan skill to redesign
โ Resolve conflict in plan
โ Re-execute
3. Re-run all tests (including regression tests)
4. retry_count++, continue loop
Strategy 8: Environment Issue (์ฌ์ฉ์ ๊ฐ์
ํ์)
IF (failureType === "ENVIRONMENT_ISSUE"):
Output: "โ ๏ธ Environment issue detected - user intervention required"
1. Document environment problem:
- Error message
- Missing dependency/service
- Required fix
2. Ask user for guidance using AskUserQuestion:
- "Fix environment and retry"
- "Skip this test (not recommended)"
- "Abort execution"
3. STOP LOOP โ Exit to Error Handling
C-3: Output Retry Status
๐ Auto-Recovery Attempt #{retry_count + 1}
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Failure Type: {IMPLEMENTATION_BUG | PLAN_DESIGN_FLAW}
Strategy: {Fix code | Revise plan}
Action Taken: {description}
Next: Re-running tests...
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
C-4: Increment Retry Counter
retry_count++
C-5: Re-run Tests
Re-execute test suite from Step A
C-6: Check Exit Condition
IF (all tests pass):
โ โ
Tests passed after retry!
โ EXIT LOOP โ Success
ELSE IF (retry_count >= max_retries):
โ โ Max retries (3) reached
โ EXIT LOOP โ Ask user for guidance
ELSE:
โ Continue to C-1 (next retry iteration)
END WHILE
Step D: Final Decision
After exiting the loop:
IF (all tests pass):
โ โ
Testing successful!
โ Proceed to "Execution Complete" section
ELSE (max retries reached):
โ โ Unable to fix after 3 attempts
โ Output failure summary
โ Ask user for manual intervention
Use AskUserQuestion:
- "Manually fix and resume"
- "Abort execution and investigate"
Verification Checklist:
- โ All tasks marked as completed in TaskList
- โ All success criteria met for all tasks
- โ Unit tests passing (after auto-recovery if needed)
- โ Integration tests passing
- โ Manual tests verified
- โ No regression in existing functionality
- โ Code follows project standards
- โ No console errors or warnings
- โ Performance acceptable
- โ Security checks passed (if applicable)
โ
Execution Complete - Next: Run record Skill
After execute skill completion, you MUST run record skill:
Run record skill
Tasks handled by record skill:
- โ
Update README
- โ
Write CHANGELOG
- โ
Add architectural decisions to CLAUDE.md
- โ
Save learnings to Serena memory
- โ
Clean up workflow artifacts (*_PLAN.md, *_REPORT.md)
- โ
Git commit/push
- โ
Update JIRA issue
โ ๏ธ IMPORTANT: Do not perform documentation in execute. Documentation is handled centrally in record.
Error Handling
If a Task Fails
-
Document the Failure
"โ Task Failed: [Task Name]
Error Details:
- Error message: [error]
- Context: [what was being attempted]
- Stack trace: [if applicable]
-
Check Rollback Procedure
- Refer to plan's rollback procedure (if defined)
- Undo changes if necessary
- Restore to known good state
-
Mark Task as Blocked
TaskUpdate({taskId: currentTaskId, status: "pending"})
- Do NOT mark as "completed"
- Document blocker reason
-
Create Sub-tasks to Resolve
TaskCreate({subject: "[BLOCKER] Fix [specific issue]", description: "...", activeForm: "Fixing blocker"})
TaskCreate({subject: "[RETRY] [Original Task]", description: "...", activeForm: "Retrying original task"})
-
Ask for User Guidance
"โ ๏ธ Blocker Encountered
I've encountered an issue with [Task Name]:
[Description of problem]
Options:
1. [Option 1 with pros/cons]
2. [Option 2 with pros/cons]
3. [Option 3 with pros/cons]
Which approach would you like me to take?"
If Plan Needs Adjustment
-
Pause Execution
"โธ๏ธ Execution Paused
I need to adjust the plan because:
[Reason for adjustment]"
-
Explain the Issue
"Issue: [Clear description]
Why adjustment needed:
- [Reason 1]
- [Reason 2]
Current plan assumes: [assumption]
Reality: [actual situation]"
-
Propose Modifications
"Proposed plan adjustments:
Original approach:
[Original plan excerpt]
Modified approach:
[Proposed change]
Impact:
- Timeline: [change]
- Dependencies: [affected tasks]
- Risk: [new risks or mitigations]"
-
Wait for Approval
- Do NOT proceed without user approval
- Present options clearly
- Explain trade-offs
Execution Principles
- Follow the Plan: Stick to defined approach unless blocked
- Track Everything: Use TaskUpdate after EACH task (not in batches)
- One Task at a Time: Exactly ONE task "in_progress" at any moment
- Verify Thoroughly: Check ALL success criteria before marking complete
- Communicate Issues: Report problems immediately, don't guess solutions
- Test Continuously: Verify each task doesn't break existing functionality
- Run
record After Completion: Documentation and cleanup handled by record skill
Progress Tracking Format
Continuous Updates (after each task):
๐ Progress: [X/Y tasks completed]
โ
Completed:
- [Task 1]: [Brief result]
- [Task 2]: [Brief result]
๐ Current: [Task being worked on]
โณ Next: [Next task in queue]
๐ซ Blocked: [Any blocked tasks]
- [Blocked Task]: Waiting for [dependency/resolution]
Final Execution Summary Template
# Execution Summary: [Plan Name]
**Date**: [Completion date]
**Duration**: [Total time]
---
## โ
Tasks Completed: [X/Y]
### Priority 0 (Critical)
- [Task 1] โ
[Brief outcome]
- [Task 2] โ
[Brief outcome]
### Priority 1 (High)
- [Task 3] โ
[Brief outcome]
### Priority 2 (Medium)
- [Task 4] โ
[Brief outcome]
### Priority 3 (Low)
- [Task 5] โ
[Brief outcome]
---
## โ
Success Criteria Met: [X/Y]
- [Criterion 1] โ
Verified
- [Criterion 2] โ
Verified
- [Criterion 3] โ
Verified
---
## ๐งช Testing Results
### Unit Tests
- Status: โ
All passing
- Coverage: [X%]
- Files tested: [count]
### Integration Tests
- Status: โ
All passing
- Test cases: [count]
### Manual Tests
- Status: โ
Verified
- Test scenarios: [count]
### Performance Tests
- Status: โ
Passed (if applicable)
- Metrics: [key metrics]
### Security Tests
- Status: โ
Passed (if applicable)
- Checks: [security checks performed]
---
## ๐ Next Step: Run `record` Skill
**โ ๏ธ IMPORTANT**: Run `record` skill after execute completion!
Handled by `record` skill:
- โ
Update README, CHANGELOG, CLAUDE.md
- โ
Save learnings to Serena memory
- โ
Clean up workflow artifacts
- โ
Git commit/push
- โ
Update JIRA issue
---
## โ ๏ธ Issues Encountered
### Issue 1: [Issue description]
- **Impact**: [How it affected execution]
- **Resolution**: [How it was resolved]
- **Prevention**: [How to avoid in future]
### Issue 2: [Issue description]
- **Impact**: [How it affected execution]
- **Resolution**: [How it was resolved]
- **Prevention**: [How to avoid in future]
---
## ๐ฏ Project Management Updates
### JIRA
- โ
Issue [ISSUE-ID] updated to "Done"
- โ
Implementation notes added to issue
- โ
Time logged (if applicable)
### Sentry
- โ
Related errors resolved (if applicable)
- โ
Issues closed: [issue IDs]
### GitHub
- โ
Pull request created (if applicable): [PR link]
- โ
Commits linked to issues
---
## ๐ Metrics
- **Total tasks**: [count]
- **Tasks completed**: [count]
- **Success rate**: [X%]
- **Test coverage**: [X%]
- **Time estimate vs actual**: [comparison]
- **Blocked tasks resolved**: [count]
---
## ๐ Next Steps
### Immediate
- [Next step 1]
- [Next step 2]
### Future Considerations
- [Future consideration 1]
- [Future consideration 2]
---
## ๐ก Lessons Learned
### What Went Well
- [Success 1]
- [Success 2]
### What Could Be Improved
- [Improvement area 1]
- [Improvement area 2]
### Recommendations for Future Plans
- [Recommendation 1]
- [Recommendation 2]
---
**Execution Complete** โ
All plan objectives achieved. Project documentation updated. Temporary files cleaned up.
Tips for Successful Execution
Before Starting
- โ Ensure plan is approved (not draft)
- โ Verify all dependencies available
- โ Check required tools and access
- โ Review risk mitigations in plan
- โ Understand critical path
During Execution
- โ Update TaskList after EACH task (not batched)
- โ Keep exactly ONE task as "in_progress"
- โ Verify success criteria before marking complete
- โ Run tests continuously, not just at the end
- โ Document issues as they occur
- โ Ask for guidance when blocked, don't guess
After Execution
- โ Verify ALL tests pass
- โ Present comprehensive execution summary
- โ Run
record skill for documentation and cleanup
Phase 9: Next Step Confirmation
After completing all tests and verification, ask the user whether to proceed to documentation.
Use AskUserQuestion tool:
questions:
- question: "๊ตฌํ์ด ์๋ฃ๋์์ต๋๋ค. ๋ค์ ๋จ๊ณ๋ก ์งํํ ๊น์?"
header: "Next"
options:
- label: "record ์คํฌ ์คํ (Recommended)"
description: "๋ฌธ์ํ, CHANGELOG ์์ฑ, Git commit/push๋ฅผ ์ํํฉ๋๋ค"
- label: "์ฌ๊ธฐ์ ์ข
๋ฃ"
description: "๊ตฌํ๋ง ์๋ฃํ๊ณ ์ข
๋ฃํฉ๋๋ค (๋ฌธ์ํ๋ ๋์ค์)"
- If "record ์คํฌ ์คํ" selected: Invoke the
record skill
- Output:
โ
record ์คํฌ์ ์คํํฉ๋๋ค...
- If "์ฌ๊ธฐ์ ์ข
๋ฃ" selected: End the workflow with reminder
- Output:
โ
๊ตฌํ์ด ์๋ฃ๋์์ต๋๋ค. ๋์ค์ record ์คํฌ์ ์คํํ์ฌ ๋ฌธ์ํ๋ฅผ ์๋ฃํ์ธ์.
Tasks handled by record skill:
- Update README
- Write CHANGELOG
- Add architectural decisions to CLAUDE.md
- Save learnings to Serena memory
- Clean up workflow artifacts (*_PLAN.md, *_REPORT.md)
- Git commit/push
- Update JIRA issue
โ ๏ธ IMPORTANT: Do not perform documentation in execute. Documentation is handled centrally in record.
Resources
This skill does not require additional resource directories (scripts/, references/, or assets/). All execution logic is contained within this SKILL.md file, and the skill relies on Claude's ability to:
- Use TaskCreate/TaskUpdate for task tracking
- Use Serena MCP tools for code operations
- Use Atlassian MCP tools for project management
- Use Sentry MCP tools for error tracking
- Use Context7 MCP tools for documentation
- Follow the 9-phase systematic execution process
- Maintain comprehensive progress tracking
Note: Documentation and file cleanup are handled by record skill.