**Purpose:** Execute implementation based on existing plan
/plugin marketplace add nguyenthienthanh/ccpm-team-agents/plugin install nguyenthienthanh-aura-frog-aura-frog-2@nguyenthienthanh/ccpm-team-agentsPurpose: Execute implementation based on existing plan
Aliases: implement, execute plan, build
Implement code based on a pre-existing plan, skipping planning phases and going straight to TDD implementation.
Use when:
# Execute from plan ID
execute refactor-userprofile-20251124-150000
# Execute from plan file
execute plans/refactor-userprofile-20251124-150000.md
# Or natural language
"Execute the UserProfile refactoring plan"
"Implement based on plan refactor-userprofile-..."
const planId = args[0];
const planFile = `plans/${planId}.md`;
const plan = loadPlan(planFile);
// Parse plan sections
const context = {
task: plan.task,
solution: plan.selectedSolution,
architecture: plan.architecture,
steps: plan.implementationSteps,
fileStructure: plan.fileStructure,
testStrategy: plan.testStrategy
};
// Create lightweight workflow (skip Phase 1-4)
const workflowId = `execute-${planId}`;
const workflow = {
workflow_id: workflowId,
workflow_name: `Execute: ${plan.task}`,
source_plan: planId,
phases: {
// Skip Phase 1-4 (planning done)
5: { name: "TDD Implementation", status: "pending" },
6: { name: "Code Review", status: "pending" },
7: { name: "QA Validation", status: "pending" },
8: { name: "Documentation", status: "pending" }
}
};
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β‘ EXECUTING PLAN
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
**Plan:** refactor-userprofile-20251124-150000
**Task:** Refactor UserProfile component
**Solution:** Component Split (Option A)
---
## π Plan Summary
**Approach:**
- Split into 3 components
- Header + Content + Footer
- Maintain existing functionality
**Files to Create:**
- UserProfileHeader.tsx
- UserProfileContent.tsx
- UserProfileFooter.tsx
- Tests for each
**Estimated:** 3.5 hours
**Risk:** Low
---
## π― Execution Phases
β
Phase 1-4: Planning (SKIPPED - Plan exists)
**Starting:**
β³ Phase 5: TDD Implementation
- Phase 5a: Write failing tests (RED)
- Phase 5b: Implement code (GREEN)
- Phase 5c: Refactor (REFACTOR)
**Then:**
βΈοΈ Phase 6: Code Review
βΈοΈ Phase 7: QA Validation
βΈοΈ Phase 8: Documentation
---
## π Starting Phase 5a: Write Tests
**Creating test files based on plan:**
- UserProfileHeader.test.tsx
- UserProfileContent.test.tsx
- UserProfileFooter.test.tsx
Ready to proceed? (yes/no)
Phase 5a: RED (Write Failing Tests)
// Create test files from plan
for (const component of plan.components) {
const testFile = `${component.path}/__tests__/${component.name}.test.tsx`;
const testContent = generateTests(component, {
coverage: plan.testStrategy.coverage || 85,
scenarios: plan.testStrategy.scenarios
});
createFile(testFile, testContent);
}
// Run tests (should fail)
const testResults = runTests();
console.log(`β
Created ${tests.length} test files`);
console.log(`π΄ All tests failing (RED phase) - Good!`);
Phase 5b: GREEN (Implement)
// Create components from plan
for (const component of plan.components) {
const componentFile = `${component.path}/${component.name}.tsx`;
const componentCode = generateComponent(component, {
props: component.props,
state: component.state,
logic: component.logic
});
createFile(componentFile, componentCode);
}
// Run tests (should pass)
const testResults = runTests();
console.log(`β
Created ${components.length} components`);
console.log(`π’ All tests passing (GREEN phase) - Good!`);
Phase 5c: REFACTOR
// Apply best practices
for (const file of createdFiles) {
refactorCode(file, {
extractConstants: true,
memoizeComponents: true,
optimizePerformance: true,
reduceComplexity: true
});
}
// Verify tests still pass
const testResults = runTests();
console.log(`β
Refactored ${files.length} files`);
console.log(`π’ All tests still passing - Good!`);
// Phase 6: Code Review
runCodeReview({
checkLinter: true,
checkComplexity: true,
checkCoverage: true,
compareWithPlan: true
});
// Phase 7: QA Validation
runQAValidation({
runAllTests: true,
checkCoverage: true,
verifyRequirements: true
});
// Phase 8: Documentation
generateDocumentation({
implementationSummary: true,
apiDocs: true,
usageExamples: true,
deploymentNotes: true
});
## β±οΈ Progress
**Phase 5: TDD Implementation**
ββ β
5a: RED (15 min) - Tests created
ββ β
5b: GREEN (45 min) - Code implemented
ββ β³ 5c: REFACTOR (in progress)
**Metrics:**
- Files created: 6 (3 components + 3 tests)
- Test coverage: 87% β
(target: 85%)
- Linter: 0 errors, 0 warnings β
- Time: 60 min / 210 min estimated
**Tokens:** 45K / 200K (22.5%)
execute [plan-id]
# Auto-executes:
- Phase 5: TDD (with approvals)
- Phase 6: Review
- Phase 7: QA
- Phase 8: Docs
# Shows approval gate at each phase
execute [plan-id] --manual
# Step-by-step:
1. Shows Phase 5a plan
2. Wait for: proceed
3. Execute Phase 5a
4. Wait for: approve
5. Shows Phase 5b plan
... etc
execute [plan-id] --dry-run
# Shows:
- What will be created
- Estimated time
- File list
- No actual execution
Components:
src/components/UserProfile/
βββ UserProfile.tsx
βββ UserProfileHeader.tsx
βββ UserProfileContent.tsx
βββ UserProfileFooter.tsx
βββ index.ts
Tests:
src/components/UserProfile/__tests__/
βββ UserProfile.test.tsx
βββ UserProfileHeader.test.tsx
βββ UserProfileContent.test.tsx
βββ UserProfileFooter.test.tsx
Execution Log:
logs/workflows/execute-[plan-id]/
βββ workflow-state.json
βββ execution.log
βββ phase-5a.log
βββ phase-5b.log
βββ phase-5c.log
Deliverables:
logs/contexts/execute-[plan-id]/
βββ deliverables/
βββ 05-tdd-implementation/
β βββ implementation-summary.md
β βββ test-report.md
βββ 06-code-review/
β βββ review-report.md
βββ 07-qa-validation/
β βββ qa-report.md
βββ 08-documentation/
βββ api-docs.md
workflow:start "Task":
Phase 1: Requirements β
Phase 2: Technical Plan β
Phase 3: Design Review β
Phase 4: Test Planning β
Phase 5: Implementation β
Phase 6-9: ...
Total: 9 phases, ~3.5 hours
execute [plan-id]:
Phase 1-4: SKIPPED (plan exists)
Phase 5: Implementation β
Phase 6-9: ...
Total: 5 phases, ~2 hours
Savings: 1.5 hours, 4 phases
planning "Refactor UserProfile"
# Output: plan-id
# Review in IDE
open plans/[plan-id].md
# Or request changes
planning:refine [plan-id]
# When ready
execute [plan-id]
# Or execute immediately
planning "Task" --execute
# Plan + Execute in one command
planning "Refactor UserProfile" --execute
# Creates plan
# Waits for approval
# Executes automatically
β
Plan loaded successfully
β
All files created as planned
β
Tests pass (TDD cycle)
β
Coverage target met
β
Code review passed
β
QA validation passed
β
Documentation generated
| Feature | workflow:start | execute |
|---|---|---|
| Planning phases | β Yes | β Skipped |
| Implementation | β Yes | β Yes |
| Validation | β Yes | β Yes |
| Time | ~3.5 hours | ~2 hours |
| Use case | New tasks | Pre-planned tasks |
Command: execute
Version: 1.0.0
Added: Aura Frog v1.3