@exaudeus/workrail 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exaudeus/workrail",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "MCP server for structured workflow orchestration and step-by-step task guidance",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc -p tsconfig.build.json",
|
|
16
|
+
"release": "./scripts/release.sh",
|
|
16
17
|
"dev": "npm run build && node dist/mcp-server.js",
|
|
17
18
|
"prepare": "npm run build",
|
|
18
19
|
"watch": "tsc --watch"
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "coding-task-workflow",
|
|
3
|
+
"name": "Excellent Adaptive Coding Workflow with Devil's Advocate Review",
|
|
4
|
+
"version": "0.8.0",
|
|
5
|
+
"description": "Comprehensive AI coding workflow with bidirectional re-triage, deep analysis, intelligent clarification, devil's advocate review, automation levels, failure bounds, tool fallbacks, and context documentation for production-ready development.",
|
|
6
|
+
|
|
7
|
+
"preconditions": [
|
|
8
|
+
"User has a clear task description (e.g., from Jira, a dev doc, or a BRD).",
|
|
9
|
+
"The agent has access to necessary tools like `grep`, file readers/editors, and a terminal for commands.",
|
|
10
|
+
"The agent has access to the relevant codebase files.",
|
|
11
|
+
"Git repository is recommended for version control and commits (workflow degrades gracefully if unavailable)."
|
|
12
|
+
],
|
|
13
|
+
"metaGuidance": [
|
|
14
|
+
"This workflow follows the ANALYZE -> CLARIFY -> PREP -> IMPLEMENT -> VERIFY pattern with bidirectional dynamic re-triage capabilities.",
|
|
15
|
+
"Deep codebase analysis occurs early to inform intelligent requirements clarification and all subsequent planning phases.",
|
|
16
|
+
"Dynamic re-triage allows complexity upgrades and safe downgrades based on new insights from analysis and clarifications.",
|
|
17
|
+
"Automation levels (Low/Medium/High) control confirmation requirements to balance autonomy with safety.",
|
|
18
|
+
"Failure bounds prevent resource waste: word limits (2000), step tracking (>20), and escalation protocols.",
|
|
19
|
+
"Context documentation is maintained throughout to enable seamless handoffs between chat sessions, with updates triggered by progress milestones, failures, or user interventions.",
|
|
20
|
+
"For specialized tasks (e.g., debugging), call sub-workflows via workflow_get tool when available.",
|
|
21
|
+
"Limit all documentation outputs to 2000 words max; use bullet points for scannability.",
|
|
22
|
+
"Output markdown content in response; use read_file/edit_file tools to create/update actual files if available, else request user upload.",
|
|
23
|
+
"Align with custom instructions: Use --quiet flags for commands; output to files; prefer workflows for debugging.",
|
|
24
|
+
"Human approval is required after the Devil's Advocate review and before final completion.",
|
|
25
|
+
"Each implementation step should be a small, logical, and committable chunk of work.",
|
|
26
|
+
"The agent should never guess or assume. Always ask for clarification or use tools to find missing information.",
|
|
27
|
+
"If you fail to get test results or other tool outputs on the first attempt, ask the user to run it manually.",
|
|
28
|
+
"Document all user interventions, change requests, and feedback immediately in context documentation to ensure continuity.",
|
|
29
|
+
"**Git Fallback Strategy:** If git not initialized or tools fail, gracefully skip commits/branches, log changes manually in CONTEXT.md with timestamps, and warn user at phase-6 start. Document all file modifications for manual version control.",
|
|
30
|
+
"**Git Error Handling:** Use run_terminal_cmd for git operations; if fails, output exact command for user manual execution. Never halt workflow due to git unavailability.",
|
|
31
|
+
"Persist all variables across steps using conversation context, external state, or by including them in every response metadata; reset flags like proposedDowngrade after confirmation.",
|
|
32
|
+
"Use safe git practices: Create feature branches for isolation, commit on successful verification, generate clear commit messages, revert on failures. Log commit hashes in CONTEXT.md for traceability.",
|
|
33
|
+
"Maintain existing coding conventions and architectural patterns found in the codebase.",
|
|
34
|
+
"COMMIT STRATEGY: Auto-commit after successful steps for High automation; suggest for Medium/Low. Use conventional format: type(scope): description. Commit at milestones and after verification passes.",
|
|
35
|
+
"**USER RULES:** Always incorporate user-defined rules, patterns & preferences (architecture, coding style, libraries, etc). These override generic practices when specified."
|
|
36
|
+
],
|
|
37
|
+
"steps": [
|
|
38
|
+
{
|
|
39
|
+
"id": "phase-0-intelligent-triage",
|
|
40
|
+
"title": "Phase 0: Intelligent Task Triage & Complexity Analysis",
|
|
41
|
+
"prompt": "**ANALYZE**: Evaluate the provided task for complexity indicators:\n\n**Small Path Indicators:**\n- Single function changes or minor refactoring\n- Clear bug fixes with obvious solutions\n- Simple configuration changes\n- Low risk of side effects\n- Well-defined, narrow scope\n\n**Medium Path Indicators:**\n- Multi-file changes or moderate features\n- Standard development work\n- Some unknowns but manageable scope\n- Moderate complexity with clear boundaries\n- Requires planning but not architectural analysis\n\n**Large Path Indicators:**\n- Architectural changes or major features\n- Unfamiliar codebase areas\n- High complexity or significant risk\n- Multiple system interactions\n- Requires deep analysis and careful planning\n\n**IMPLEMENT**: \n1. Analyze the task description for the above indicators\n2. Recommend a complexity level (Small/Medium/Large) with detailed reasoning\n3. Set the taskComplexity context variable\n4. Ask user if they agree or want to override your classification\n5. For Medium tasks, ask: \"Would you like optional deep codebase analysis?\" (sets requestDeepAnalysis context variable)\n6. Ask: \"What automation level would you prefer? High (auto-approve low-risk decisions), Medium (standard confirmations), or Low (extra confirmations for safety)?\" (sets automationLevel context variable)\n\n**VERIFY**: Confirm the complexity classification, optional analysis preferences, and automation level before proceeding.",
|
|
42
|
+
"agentRole": "You are a technical assessment specialist with expertise in evaluating software development complexity. Your role is to accurately classify tasks based on technical risk, scope, and architectural impact. Be thorough in your analysis while remaining decisive and clear in your recommendations.",
|
|
43
|
+
"guidance": [
|
|
44
|
+
"Be thorough in your analysis - this determines the entire workflow path",
|
|
45
|
+
"Consider both technical complexity and business risk",
|
|
46
|
+
"When in doubt, err on the side of more thorough analysis (higher complexity)",
|
|
47
|
+
"Always allow human override of your classification",
|
|
48
|
+
"Set context variables that will be used for conditional step execution and automation",
|
|
49
|
+
"Automation levels: High=auto-approve confidence >8, Medium=standard, Low=extra confirmations"
|
|
50
|
+
],
|
|
51
|
+
"requireConfirmation": true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"id": "phase-0b-user-rules-identification",
|
|
55
|
+
"title": "Phase 0b: Identify Relevant User Rules",
|
|
56
|
+
"prompt": "**OBJECTIVE:** Review and explicitly list all user-defined rules, preferences, and patterns that are relevant to this task.\n\n**ACTIONS:**\n1. **Check for user rules** in:\n - User preferences/settings\n - Project documentation\n - Previous instructions or context\n - Memory/knowledge base\n\n2. **Categorize rules by type:**\n - **Architecture:** Design patterns, system structure preferences\n - **Coding Standards:** Naming conventions, code style, formatting\n - **Libraries/Frameworks:** Preferred tools, banned dependencies\n - **Testing:** Test structure, coverage requirements, frameworks\n - **Documentation:** Comment styles, doc generation preferences\n - **Git/Version Control:** Commit message formats, branching strategies\n - **Other:** Any project-specific guidelines\n\n3. **Filter for relevance:** Only list rules that apply to this specific task\n\n4. **Create explicit list:** Format as a clear, numbered list that will be referenced throughout the workflow\n\n**OUTPUT EXAMPLE:**\n```\nRelevant User Rules for this task:\n1. Architecture: Use dependency injection pattern\n2. Architecture: Prefer immutability patterns\n3. Coding: Use camelCase for functions, PascalCase for classes\n4. Libraries: Prefer native solutions over external dependencies\n5. Testing: Minimum 80% coverage, use Jest framework\n6. Git: Use conventional commits format\n```\n\n**Set these as `userRules` context variable for reference in all subsequent steps.**",
|
|
57
|
+
"agentRole": "You are a meticulous requirements analyst focused on capturing and clarifying all user-defined constraints and preferences. Your role is to ensure no important rule or preference is overlooked.",
|
|
58
|
+
"guidance": [
|
|
59
|
+
"This step runs for ALL complexity levels (Small, Medium, Large)",
|
|
60
|
+
"Be thorough but concise - capture the essence of each rule",
|
|
61
|
+
"If no explicit rules exist, note that and proceed with standard practices",
|
|
62
|
+
"These rules will be referenced throughout the workflow",
|
|
63
|
+
"Update this list if new rules are discovered during the workflow"
|
|
64
|
+
],
|
|
65
|
+
"requireConfirmation": false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "phase-small-prep",
|
|
69
|
+
"runCondition": {"var": "taskComplexity", "equals": "Small"},
|
|
70
|
+
"title": "Phase Small: Preparation and Simplified Execution",
|
|
71
|
+
"prompt": "For this Small task, perform quick preparation before implementation:\n\n**QUICK PREP:**\n1. **Verify Assumptions:** Use tools (e.g., list_dir, grep_search) to confirm:\n - Target files exist where expected\n - Functions/components mentioned are present\n - Dependencies are available\n\n2. **Complexity Check:** If you discover:\n - Unexpected dependencies or architectural complexity\n - Multiple integration points\n - Significant testing requirements\n **ESCALATE:** Recommend upgrading via re-triage (set proposedUpgrade=true) and pause for user confirmation.\n\n3. **Simple Plan:** Otherwise, create a brief plan with 2-5 discrete steps:\n - What will be changed\n - How it will be tested\n - Expected outcomes\n\n**ESCAPE HATCH:** If complexities arise during this prep, recommend upgrading to Medium/Large via phase-2b re-triage rather than proceeding with insufficient analysis.\n\n**Report your findings as a simple checklist:**\nChecklist example:\n- [✅] File `src/utils.js` exists (verified via list_dir)\n- [✅] Function `calculateTotal()` found (verified via grep_search)\n- [✅] Dependencies confirmed in package.json\n- [✅] Simple 3-step plan created\n\nProceed to implementation if all checks pass, otherwise recommend re-triage.",
|
|
72
|
+
"agentRole": "You are an efficient task executor specializing in low-complexity work. Your strength is quickly validating assumptions and creating lightweight plans while maintaining awareness of when tasks exceed their initial scope. You excel at recognizing when to escalate rather than proceeding with insufficient analysis.",
|
|
73
|
+
"guidance": [
|
|
74
|
+
"This is a mini-version of PREP->IMPLEMENT->VERIFY for Small tasks",
|
|
75
|
+
"Use available tools to verify basic assumptions quickly",
|
|
76
|
+
"Escape to phase-2b re-triage if complexities are discovered",
|
|
77
|
+
"Keep the plan simple but actionable",
|
|
78
|
+
"Better to escalate than to proceed with insufficient preparation"
|
|
79
|
+
],
|
|
80
|
+
"requireConfirmation": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"id": "phase-small-implement",
|
|
84
|
+
"runCondition": {"var": "taskComplexity", "equals": "Small"},
|
|
85
|
+
"title": "Phase Small: Simple Implementation",
|
|
86
|
+
"prompt": "Execute the simple plan you created in the preparation phase.\n\n**IMPLEMENTATION:**\n1. Review the user rules identified in Phase 0b\n2. Work through your 2-5 step plan sequentially\n3. Make the necessary code changes following user rules\n4. Write basic tests as needed\n5. Verify each change works correctly\n\n**GUIDELINES:**\n- Apply all relevant user rules and patterns\n- Keep changes focused and minimal\n- If complexity emerges, pause and recommend upgrading to Medium/Large\n- Commit after successful completion (or log changes if git unavailable)\n\n**VERIFICATION:**\n- Run relevant tests\n- Do a quick self-review\n- Ensure the task objectives are met\n- Confirm user rules were followed\n\nThis is a streamlined process for genuinely simple tasks.",
|
|
87
|
+
"agentRole": "You are implementing a simple, low-risk task. Execute efficiently while maintaining quality. If unexpected complexity arises, escalate rather than proceeding with inadequate rigor.",
|
|
88
|
+
"guidance": [
|
|
89
|
+
"Execute the plan from phase-small-prep",
|
|
90
|
+
"Keep implementation lightweight but correct",
|
|
91
|
+
"Escalate if complexity exceeds Small task scope",
|
|
92
|
+
"Single commit at the end for all changes"
|
|
93
|
+
],
|
|
94
|
+
"requireConfirmation": false
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "phase-1-deep-analysis-mandatory",
|
|
98
|
+
"runCondition": {"var": "taskComplexity", "equals": "Large"},
|
|
99
|
+
"title": "Phase 1: Mandatory Deep Codebase Analysis",
|
|
100
|
+
"prompt": "Your goal is to become an expert on the attached codebase before any planning begins. This deep analysis is mandatory for Large tasks due to their complexity and risk.\n\n**ANALYSIS BOUNDS: Limit output to 1500 words; prioritize task-relevant sections.**\n\n**IMPORTANT: First check for any user-defined rules or preferences that should guide your analysis. These may include architectural patterns, coding standards, or specific approaches the user prefers.**\n\nYour analysis must include:\n1. **Architecture:** Main modules, layers, and patterns.\n2. **Key Concepts:** Core models, conventions, and important components.\n3. **Execution Flow:** Trace major features or entry points.\n4. **Code Quality Assessment:** Note maintainability, readability, or coupling issues.\n5. **Testing Strategy:** Describe how the code is tested.\n6. **Opportunities:** Suggest refactorings or improvements.\n7. **Task Relevance:** Identify which parts of the codebase are most relevant to the current task.\n8. **Potential Ambiguities:** Note areas where the initial task description might be unclear given the codebase structure.\n9. **Complexity Indicators:** Note any discoveries that might affect the initial complexity assessment.\n10. **User Rules Alignment:** Note how the codebase aligns or conflicts with any user-defined rules, preferences, or patterns.\n\nProvide summaries and code examples to illustrate your findings. Be exhaustive within the word limit, as if preparing onboarding documentation for a senior engineer. This analysis will inform all subsequent requirements clarification, specification, and design work.",
|
|
101
|
+
"agentRole": "You are an expert codebase analyst with 10+ years of experience in software architecture and legacy system analysis. Your specialty is quickly understanding complex codebases and identifying architectural patterns, risks, and opportunities. Approach this with the thoroughness of a senior engineer conducting a technical due diligence review.",
|
|
102
|
+
"askForFiles": true,
|
|
103
|
+
"guidance": [
|
|
104
|
+
"This step is mandatory for Large tasks due to their complexity and risk",
|
|
105
|
+
"Ensure all relevant source files are attached or accessible to the agent before running this step",
|
|
106
|
+
"Be thorough but respect the 1500-word limit - focus on task-relevant insights",
|
|
107
|
+
"This analysis will inform requirements clarification, specification, design, and implementation strategy",
|
|
108
|
+
"Pay special attention to areas of the codebase relevant to the current task",
|
|
109
|
+
"Note potential ambiguities in the task description that become apparent after understanding the codebase",
|
|
110
|
+
"Flag any complexity indicators that might warrant re-triaging the task complexity"
|
|
111
|
+
],
|
|
112
|
+
"requireConfirmation": false
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "phase-1-deep-analysis-optional",
|
|
116
|
+
"runCondition": {
|
|
117
|
+
"and": [
|
|
118
|
+
{"var": "taskComplexity", "equals": "Medium"},
|
|
119
|
+
{"var": "requestDeepAnalysis", "equals": true}
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"title": "Phase 1: Optional Deep Codebase Analysis",
|
|
123
|
+
"prompt": "You requested optional deep analysis for this Medium task. Your goal is to become an expert on the attached codebase before planning begins.\n\n**ANALYSIS BOUNDS: Limit output to 1500 words; prioritize task-relevant sections.**\n\nYour analysis must include:\n1. **Architecture:** Main modules, layers, and patterns.\n2. **Key Concepts:** Core models, conventions, and important components.\n3. **Execution Flow:** Trace major features or entry points.\n4. **Code Quality Assessment:** Note maintainability, readability, or coupling issues.\n5. **Testing Strategy:** Describe how the code is tested.\n6. **Opportunities:** Suggest refactorings or improvements.\n7. **Task Relevance:** Identify which parts of the codebase are most relevant to the current task.\n8. **Potential Ambiguities:** Note areas where the initial task description might be unclear given the codebase structure.\n9. **Complexity Indicators:** Note any discoveries that might affect the initial complexity assessment.\n\nProvide summaries and code examples to illustrate your findings. Focus on areas most relevant to the current task while maintaining architectural awareness. This analysis will inform all subsequent requirements clarification, specification, and design work.",
|
|
124
|
+
"agentRole": "You are a focused codebase analyst specializing in targeted technical analysis for medium-complexity projects. Your approach balances thoroughness with efficiency, focusing on areas most relevant to the current task while maintaining architectural awareness.",
|
|
125
|
+
"askForFiles": true,
|
|
126
|
+
"guidance": [
|
|
127
|
+
"This optional analysis was requested for a Medium task",
|
|
128
|
+
"Ensure all relevant source files are attached or accessible to the agent before running this step",
|
|
129
|
+
"Focus on areas most relevant to the current task while maintaining broader architectural context",
|
|
130
|
+
"Respect the 1500-word limit - prioritize task-relevant insights",
|
|
131
|
+
"This analysis will inform requirements clarification, specification, and design phases",
|
|
132
|
+
"Note potential ambiguities in the task description that become apparent after understanding the codebase",
|
|
133
|
+
"Flag any complexity indicators that might warrant re-triaging the task complexity"
|
|
134
|
+
],
|
|
135
|
+
"requireConfirmation": false
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "phase-2-informed-clarification",
|
|
139
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
140
|
+
"title": "Phase 2: Informed Requirements Clarification",
|
|
141
|
+
"prompt": "Based on your deep understanding of the codebase from Phase 1, you are now in a position to ask intelligent, targeted questions to clarify the requirements. Your codebase analysis may have revealed ambiguities, missing details, or potential issues that weren't apparent from the initial task description.\n\n**Your goal is to ask specific, informed questions that will lead to a clear, unambiguous specification. Consider:**\n\n1. **Technical Ambiguities:** Are there aspects of the task that could be implemented in multiple ways given the existing architecture? Which approach is preferred?\n\n2. **Integration Questions:** How should the new functionality integrate with existing systems, APIs, or workflows you discovered?\n\n3. **Scope Boundaries:** Given the existing codebase structure, what should be included/excluded from this task?\n\n4. **Convention Alignment:** Should the implementation follow existing patterns you observed, or is this an opportunity to establish new patterns?\n\n5. **Edge Cases:** What should happen in edge cases that are now apparent given the existing data models and business logic?\n\n6. **Dependencies:** Are there existing components, services, or data that the task should leverage or avoid?\n\n7. **Testing Strategy:** Given the existing test patterns, what level and type of testing is expected?\n\n8. **Complexity Concerns:** Based on your analysis, are there risk factors that might indicate this task is more complex than initially classified?\n\n**Present 3-7 well-formulated questions that will significantly improve the clarity and implementability of the final specification.**",
|
|
142
|
+
"agentRole": "You are a senior business analyst and technical consultant specializing in requirements elicitation. Your expertise lies in translating deep technical understanding into precise business questions that eliminate ambiguity and prevent costly rework. You excel at identifying the critical gaps between initial requirements and implementation reality.",
|
|
143
|
+
"guidance": [
|
|
144
|
+
"This step is automatically skipped for Small tasks based on complexity classification",
|
|
145
|
+
"Ask questions that could only be formulated after understanding the codebase",
|
|
146
|
+
"Focus on questions that will significantly impact the specification and implementation approach",
|
|
147
|
+
"Avoid generic questions - make them specific to the codebase and task at hand",
|
|
148
|
+
"Present questions in a clear, prioritized manner",
|
|
149
|
+
"Include questions about potential complexity changes based on your analysis"
|
|
150
|
+
],
|
|
151
|
+
"requireConfirmation": {
|
|
152
|
+
"or": [
|
|
153
|
+
{"var": "automationLevel", "equals": "Low"},
|
|
154
|
+
{"var": "automationLevel", "equals": "Medium"}
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": "phase-2b-dynamic-retriage",
|
|
160
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
161
|
+
"title": "Phase 2b: Dynamic Complexity Re-Triage",
|
|
162
|
+
"prompt": "Based on your codebase analysis and requirements clarification, re-evaluate the initial complexity classification. New insights may have revealed:\n\n- Hidden architectural dependencies\n- Unforeseen integration complexities\n- Risk factors not apparent in the initial description\n- Scope expansion based on clarified requirements\n- Technical constraints that increase difficulty\n- **OR existing utilities/patterns that simplify the task**\n\n**EVALUATE:**\n1. Review the original taskComplexity classification\n2. Consider new information from codebase analysis and clarifications\n3. Assess if the complexity should be upgraded (e.g., Medium → Large) OR downgraded (e.g., Large → Medium)\n4. Provide detailed reasoning for any recommended changes\n\n**If you recommend upgrading complexity:**\n- Clearly explain what new insights led to this recommendation\n- Describe the additional risks or complexity discovered\n- Justify why the higher complexity path would be beneficial\n- Ask for user confirmation to change the taskComplexity context variable\n\n**If you recommend downgrading complexity:**\n- Set proposedDowngrade context variable to true\n- Clearly explain what existing utilities, patterns, or simplified scope led to this recommendation\n- Provide evidence of reduced risk and scope\n- Require user confirmation and evidence of reduced risk unless automationLevel=High and confidence >8\n- Justify why the lower complexity path is safe and appropriate\n\n**If current classification remains appropriate:**\n- Briefly confirm the classification is still accurate\n- Proceed without requesting changes\n\n**Note:** Both upgrades and downgrades are allowed with proper justification to ensure optimal workflow efficiency.",
|
|
163
|
+
"agentRole": "You are a senior technical risk assessor specializing in project complexity evaluation. Your expertise lies in identifying hidden risks and complexity factors that emerge during analysis phases, as well as recognizing when tasks are simpler than initially assessed. You excel at making decisive recommendations to ensure projects follow the appropriate rigor level.",
|
|
164
|
+
"guidance": [
|
|
165
|
+
"This step allows both upgrading and downgrading complexity based on new insights",
|
|
166
|
+
"Only change complexity if there are clear, justifiable reasons",
|
|
167
|
+
"For downgrades, set proposedDowngrade flag and require explicit user approval unless automationLevel=High and confidence >8",
|
|
168
|
+
"Be specific about what new information led to the reassessment",
|
|
169
|
+
"If changing complexity, the workflow will continue with the new complexity path",
|
|
170
|
+
"Downgrades must be justified with evidence of reduced risk/scope",
|
|
171
|
+
"Reset proposedDowngrade to false after user confirmation or rejection"
|
|
172
|
+
],
|
|
173
|
+
"requireConfirmation": {
|
|
174
|
+
"or": [
|
|
175
|
+
{"var": "automationLevel", "equals": "Low"},
|
|
176
|
+
{"var": "automationLevel", "equals": "Medium"},
|
|
177
|
+
{"var": "proposedDowngrade", "equals": true}
|
|
178
|
+
]
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"id": "phase-3-specification",
|
|
183
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
184
|
+
"title": "Phase 3: Create Specification",
|
|
185
|
+
"prompt": "Using your codebase analysis from Phase 1, the clarified requirements from Phase 2, and any complexity re-assessment from Phase 2b, create a specification document that aligns with the existing system and addresses all identified ambiguities. Your specification should be precise, unambiguous, and fully implementable.\n\n**Task Description:**\n[Updated based on clarifications from Phase 2]\n\n**Key Objectives & Success Criteria:**\n[Refined based on codebase understanding and clarifications]\n\n**Scope and Constraints:**\n[Updated to reflect codebase realities and clarified boundaries]\n\n**IMPORTANT**: Your specification must consider:\n- Existing architectural patterns and conventions identified in your codebase analysis\n- How the proposed changes fit within the current system design\n- Potential impacts on existing components and workflows\n- Alignment with current testing strategies and code quality standards\n- All clarifications and decisions made in Phase 2\n- Any complexity insights from the re-triage assessment\n\nOutput markdown content in response; use edit_file tool to create actual spec.md file if available, else request user upload.\n\nFinally, perform a sanity check on the current complexity classification. If you believe further adjustment is needed given your comprehensive understanding, state your reasoning and ask for confirmation before proceeding.",
|
|
186
|
+
"agentRole": "You are a senior business analyst and technical lead specializing in requirement gathering and scope definition. Your goal is to produce a clear, comprehensive `spec.md` file that leverages your deep understanding of the existing codebase and incorporates all clarified requirements to serve as an unambiguous foundation for design and implementation.",
|
|
187
|
+
"guidance": [
|
|
188
|
+
"Provide a complete task description based on all previous analysis and clarifications",
|
|
189
|
+
"The output of this step should be the content for `spec.md`",
|
|
190
|
+
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
191
|
+
"Leverage your codebase analysis and clarifications to ensure the specification is precise and implementable",
|
|
192
|
+
"Reference specific decisions made during the clarification phase",
|
|
193
|
+
"Consider any complexity changes from the re-triage phase"
|
|
194
|
+
],
|
|
195
|
+
"requireConfirmation": false
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "phase-3b-create-context-doc",
|
|
199
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
200
|
+
"title": "Phase 3b: Create Context Documentation",
|
|
201
|
+
"prompt": "Create a comprehensive context documentation file (`CONTEXT.md`) that captures all critical information from the workflow so far. This document is essential for enabling seamless handoffs between chat sessions when context limits are reached.\n\n**For automationLevel=High, generate a summary-only version (limit 1000 words); otherwise, full update (limit 2000 words).**\n\n**Your `CONTEXT.md` must include:**\n\n## 1. ORIGINAL TASK CONTEXT\n- Original task description and requirements\n- Complexity classification (Small/Medium/Large) and reasoning\n- Any re-triage decisions made and why\n- Automation level selected and its implications\n\n## 2. USER RULES AND PREFERENCES\n- Complete list of identified user rules from Phase 0b\n- How each rule impacts this specific task\n- Any rules discovered during analysis\n\n## 3. CODEBASE ANALYSIS SUMMARY\n- Key architectural patterns and conventions found\n- Relevant components, modules, and their locations\n- Testing strategies and patterns in use\n- Critical dependencies and integration points\n- Any complexity indicators discovered\n\n## 4. CLARIFICATIONS AND DECISIONS\n- Questions asked and answers received\n- Ambiguities resolved and how\n- Scope boundaries clearly defined\n- Technical approach decisions made\n\n## 5. SPECIFICATION SUMMARY\n- Core objectives and success criteria\n- Key constraints and requirements\n- Design principles to follow\n- Integration requirements\n\n## 6. WORKFLOW PROGRESS TRACKING\n- ✅ Completed phases (0, 0b, 1, 2, 2b, 3, 3b)\n- 🔄 Current phase: Architecture Design (Phase 4)\n- ⏳ Remaining phases: 4, 5, 5b, 5c, 5d, 5e, 6, 7\n- 📋 Context variables set (taskComplexity, automationLevel, userRules, etc.)\n\n## 7. HANDOFF INSTRUCTIONS\n- Files to attach when resuming (e.g., spec.md via tool or user upload)\n- Key context to provide to new chat session\n- Critical decisions that must not be forgotten\n\n**Format this as a clear, scannable document using bullet points that a new agent could quickly read to understand the full project context.**",
|
|
202
|
+
"agentRole": "You are a meticulous technical documentation specialist with expertise in creating comprehensive project handoff documents. Your role is to capture all critical context in a way that enables seamless continuity across different team members or chat sessions. You excel at synthesizing complex technical information into clear, actionable documentation.",
|
|
203
|
+
"guidance": [
|
|
204
|
+
"This step is automatically skipped for Small tasks",
|
|
205
|
+
"Create a document that would allow a completely new agent to pick up the work seamlessly",
|
|
206
|
+
"Include specific file paths, component names, and technical details discovered",
|
|
207
|
+
"Reference all key decisions made in previous phases",
|
|
208
|
+
"Make the progress tracking section very clear for workflow continuation",
|
|
209
|
+
"Consider this document as critical as the specification itself",
|
|
210
|
+
"Use bullet points for scannability; limit to word count based on automation level"
|
|
211
|
+
],
|
|
212
|
+
"requireConfirmation": false
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"id": "phase-4-architectural-design",
|
|
216
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
217
|
+
"title": "Phase 4: Architectural Design",
|
|
218
|
+
"prompt": "Using the `spec.md` from the previous step, your deep codebase analysis, and all clarified requirements, create a high-level architectural design that seamlessly integrates with the existing system. Your output should be a `design.md` document that includes:\n1. **High-Level Approach:** A summary of the proposed solution that builds on existing patterns.\n2. **Component Breakdown:** Identify new or modified components, classes, or modules, showing how they fit within the current architecture.\n3. **Data Models:** Describe any changes to data structures or database schemas, considering existing data patterns.\n4. **API Contracts:** Define any new or changed API endpoints, following existing API conventions and patterns.\n5. **Key Interactions:** A diagram or description of how the major components will interact, both new and existing.\n6. **Integration Points:** Clearly identify how new components will integrate with existing systems and workflows.\n7. **Clarification Decisions:** Reference how the clarified requirements from Phase 2 influenced design decisions.\n8. **Complexity Considerations:** Address any complexity factors identified during re-triage.\n\nOutput markdown content in response; use edit_file tool to create actual design.md file if available, else request user upload.",
|
|
219
|
+
"agentRole": "You are a software architect specializing in translating business requirements into robust and scalable technical designs that seamlessly integrate with existing systems. Your task is to create a clear and comprehensive `design.md` that leverages existing architectural patterns while introducing necessary changes and incorporating all clarified requirements.",
|
|
220
|
+
"guidance": [
|
|
221
|
+
"The `design.md` should be detailed enough for an engineer to write an implementation plan from it.",
|
|
222
|
+
"This step is automatically skipped for Small tasks.",
|
|
223
|
+
"Ensure the design builds upon and aligns with the existing codebase architecture identified in your analysis",
|
|
224
|
+
"Reference specific clarification decisions that influenced the design",
|
|
225
|
+
"Consider complexity factors identified during re-triage"
|
|
226
|
+
],
|
|
227
|
+
"requireConfirmation": false
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"id": "phase-5-planning",
|
|
231
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
232
|
+
"title": "Phase 5: Create Detailed Implementation Plan",
|
|
233
|
+
"prompt": "Your goal is to produce a thorough and actionable `implementation_plan.md` based on the `spec.md`, `design.md`, your deep codebase analysis, and all clarified requirements. Do not write any code. Your plan must be detailed, broken into committable phases, and justified.\n\n**CRITICAL: Review and incorporate any user-defined rules, preferences, or patterns. These take precedence over generic best practices.**\n\nYour plan must include these sections:\n1. **Goal Clarification:** Your understanding of the goal, assumptions, and success criteria from the spec and clarifications.\n2. **User Rules Compliance:** Explicitly list how the plan adheres to user-defined rules, patterns, and preferences.\n3. **Impact Assessment:** Affected codebase parts, dependencies, and risks based on the design, codebase analysis, and clarified requirements.\n4. **Implementation Strategy:** A list of discrete, actionable steps. Each step must detail the task, its rationale, inputs, and outputs.\n5. **Testing Strategy:** Describe how the changes will be tested, building on existing testing patterns identified in your codebase analysis. Mandate achieving >80% test coverage where applicable.\n6. **Failure Handling:** Define what to do if tests fail, tools don't work, or unexpected issues arise.\n7. **Final Review Checklist:** A specific checklist of items that must be verified to consider this entire task complete. This will be used in the final review phase.\n\nOutput markdown content in response; use edit_file tool to create actual implementation_plan.md file if available, else request user upload.\n\nPresent this as a formal proposal that demonstrates deep understanding of the requirements, clarifications, and the existing codebase.",
|
|
234
|
+
"agentRole": "You are an experienced technical architect and project planner with expertise in breaking down complex development tasks into manageable, logical phases. Your strength is creating detailed, actionable plans that minimize risk while maximizing development efficiency and code quality, all while working within existing system constraints and incorporating all clarified requirements.",
|
|
235
|
+
"guidance": [
|
|
236
|
+
"The agent will now proceed to critique its own plan in the next step. Withhold your final approval until after that critique.",
|
|
237
|
+
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
238
|
+
"Leverage your codebase analysis and clarified requirements to ensure the plan works within existing architectural constraints",
|
|
239
|
+
"Reference how clarified requirements influenced the planning decisions",
|
|
240
|
+
"Include explicit failure handling protocols and quantitative metrics where applicable"
|
|
241
|
+
],
|
|
242
|
+
"requireConfirmation": false
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "phase-5b-devil-advocate-review",
|
|
246
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
247
|
+
"title": "Phase 5b: Devil's Advocate Plan Review",
|
|
248
|
+
"prompt": "Your task is to perform a 'devil's advocate' review of the implementation plan you just created in Phase 5. The objective is not to discard the plan, but to rigorously stress-test it and make it stronger. Your critique must be balanced and evidence-based.\n\nAnalyze the plan through the following lenses. For every point you make (positive or negative), you must cite specific evidence from the plan, the codebase analysis, clarified requirements, or the initial task description.\n\n1. **Hidden Assumptions:** What assumptions does this plan make about the codebase, user behavior, or existing data that might be incorrect?\n2. **Potential Risks & Unintended Side Effects:** What is the biggest risk of this plan? Could it impact performance, security, or another feature in a negative way?\n3. **Overlooked Complexities or Edge Cases:** What specific edge cases (e.g., empty states, invalid inputs, race conditions) does the plan fail to explicitly address?\n4. **Alternative Approaches:** Briefly propose at least one alternative technical approach. What are the pros and cons of the alternative versus the current plan?\n5. **Plan Strengths:** To ensure a balanced review, explicitly state the strongest parts of the plan. What aspects are well-thought-out and likely to succeed?\n\nConclude with a balanced summary. If you found issues, provide concrete suggestions for how to amend the plan. Finally, **set the confidenceScore variable to your 1-10 rating** for the plan *if* your suggestions are implemented.",
|
|
249
|
+
"agentRole": "You are a skeptical but fair senior principal engineer with 15+ years of experience in critical system development. Your role is to identify potential failure points, hidden assumptions, and overlooked complexities in technical plans. You excel at constructive criticism that strengthens plans rather than destroys them. Approach this with the rigor of a senior engineer reviewing a mission-critical system design.",
|
|
250
|
+
"guidance": [
|
|
251
|
+
"This is a critical thinking step. The agent's goal is to find weaknesses in its *own* prior work to improve it. This is a sign of a high-functioning process.",
|
|
252
|
+
"Evaluate the agent's points. Not all 'risks' it identifies may be realistic. Use your judgment to decide which suggestions to incorporate into the plan.",
|
|
253
|
+
"After this review, you can ask the agent to create a final, amended version of the plan before you give your final approval to proceed with implementation.",
|
|
254
|
+
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
255
|
+
"CRITICAL: Set confidenceScore variable (1-10) in your response",
|
|
256
|
+
"For automationLevel=High with confidenceScore >8, auto-approve if no critical risks identified"
|
|
257
|
+
],
|
|
258
|
+
"requireConfirmation": {
|
|
259
|
+
"or": [
|
|
260
|
+
{"var": "automationLevel", "equals": "Low"},
|
|
261
|
+
{"var": "automationLevel", "equals": "Medium"},
|
|
262
|
+
{"and": [
|
|
263
|
+
{"var": "automationLevel", "equals": "High"},
|
|
264
|
+
{"var": "confidenceScore", "lt": 8}
|
|
265
|
+
]}
|
|
266
|
+
]
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"id": "phase-5c-finalize-plan",
|
|
271
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
272
|
+
"title": "Phase 5c: Finalize Implementation Plan",
|
|
273
|
+
"prompt": "Review the initial `implementation_plan.md` from Phase 5 and the Devil's Advocate critique from Phase 5b. Your task is to create a final, consolidated implementation plan that incorporates the valid feedback from the review.\n\nYour output must be the final `implementation_plan.md`.\n\nAdditionally, explicitly list any suggestions from the review that you believe are valuable but out-of-scope for the current task. These should be formatted as potential tickets for future work.\n\nOutput updated markdown content in response; use edit_file tool to update actual implementation_plan.md file if available, else request user upload.",
|
|
274
|
+
"agentRole": "You are a pragmatic technical project manager. Your goal is to synthesize feedback, make decisive trade-offs, and produce a final, actionable plan that is ready for execution.",
|
|
275
|
+
"guidance": [
|
|
276
|
+
"This is the final plan that will be executed. Ensure it is clear, actionable, and reflects the best path forward.",
|
|
277
|
+
"The list of out-of-scope items helps capture valuable ideas without derailing the current task."
|
|
278
|
+
],
|
|
279
|
+
"requireConfirmation": {
|
|
280
|
+
"or": [
|
|
281
|
+
{"var": "automationLevel", "equals": "Low"},
|
|
282
|
+
{"var": "automationLevel", "equals": "Medium"}
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"id": "phase-5d-plan-sanity-check",
|
|
288
|
+
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
289
|
+
"title": "Phase 5d: Plan Sanity Check",
|
|
290
|
+
"prompt": "Before starting implementation, perform a sanity check on the final `implementation_plan.md`. Your goal is to use your tools to quickly verify the plan's core assumptions against the current codebase. This is not a deep analysis, but a quick check for obvious errors.\n\nFor the key files, functions, classes, or APIs mentioned in the plan, perform the following checks:\n1. **Existence Check:** Use tools like `grep_search` or `list_dir` to confirm that the files and primary functions/classes you plan to modify actually exist where you expect them to.\n2. **Signature/API Check (if applicable):** Briefly check the function signatures or API endpoints you intend to use. Do they match the plan's assumptions? For example, if the plan assumes a function takes two arguments, verify that.\n3. **Dependency Check:** If the plan relies on a specific library or module being available, quickly verify its presence (e.g., check `package.json`, `requirements.txt`, etc.).\n\n**If tools are unavailable, note fallback and proceed with manual verification request.**\n\n**Report your findings as a simple checklist:**\nChecklist example:\n- [✅] File `src/example.js` exists (verified via list_dir)\n- [✅] Function `calculateTotal()` found in `src/utils.js` (verified via grep_search)\n- [✅] Dependency `moment` is listed in `package.json`\n\nIf any check fails (❌), briefly explain the discrepancy and ask the user if the plan needs to be revised before proceeding.",
|
|
291
|
+
"agentRole": "You are a pragmatic QA engineer double-checking a plan before the development team starts work. Your job is to be quick, efficient, and focused on verifying concrete facts using tools. You are not re-evaluating the plan's logic, only its tangible connection to the codebase.",
|
|
292
|
+
"guidance": [
|
|
293
|
+
"This is a quick verification step, not a full re-analysis. The goal is to catch glaring errors before implementation begins.",
|
|
294
|
+
"Use your code-browsing tools (grep_search, list_dir) to validate the plan's assumptions.",
|
|
295
|
+
"If tools fail, fall back to alternatives like file_search or request manual verification",
|
|
296
|
+
"If a check fails, it's crucial to pause and get human confirmation before proceeding with a potentially flawed plan."
|
|
297
|
+
],
|
|
298
|
+
"requireConfirmation": false
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
"id": "phase-5e-update-context-doc",
|
|
302
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
303
|
+
"title": "Phase 5e: Update Context Documentation with Final Plans",
|
|
304
|
+
"prompt": "Update the `CONTEXT.md` file with all the planning work completed in Phases 4-5. This ensures the context document remains current and comprehensive for potential handoffs.\n\n**For automationLevel=High, generate a summary-only version (limit 500 words); otherwise, full update.**\n\n**Add/Update these sections in `CONTEXT.md`:**\n\n## 4. ARCHITECTURAL DESIGN SUMMARY\n- High-level approach and rationale\n- Key components being added/modified\n- Integration points with existing systems\n- Design decisions and alternatives considered\n\n## 5. IMPLEMENTATION PLAN OVERVIEW\n- Goal clarification and success criteria\n- Implementation strategy overview\n- Key risks identified and mitigation strategies\n- Testing approach and patterns to follow\n- Failure handling protocols\n\n## 6. DEVILS ADVOCATE REVIEW INSIGHTS\n- Key concerns raised and how they were addressed\n- Plan improvements made based on the review\n- Confidence score and reasoning\n- Out-of-scope items identified for future work\n\n## 7. UPDATED WORKFLOW PROGRESS\n- ✅ Completed phases (0, 1, 2, 2b, 3, 3b, 4, 5, 5b, 5c, 5d, 5e)\n- 🔄 Current phase: Implementation (Phase 6)\n- ⏳ Remaining phases: 6, 7\n- 📁 Key files created: spec.md, design.md, implementation_plan.md, CONTEXT.md\n\n## 8. IMPLEMENTATION READINESS\n- Plan sanity check results\n- Files and dependencies verified\n- Ready-to-execute implementation steps\n- Potential handoff points during implementation\n\n**Use bullet points for scannability and maintain all previous sections while adding the new planning context.**",
|
|
305
|
+
"agentRole": "You are a meticulous technical documentation specialist focused on maintaining comprehensive project context. Your expertise lies in synthesizing complex planning work into clear, actionable documentation that enables seamless workflow continuation.",
|
|
306
|
+
"guidance": [
|
|
307
|
+
"This step is automatically skipped for Small tasks",
|
|
308
|
+
"Maintain the scannable structure while adding substantial new planning context",
|
|
309
|
+
"Ensure all critical planning decisions are captured for potential handoffs",
|
|
310
|
+
"Update progress tracking to reflect the current state accurately",
|
|
311
|
+
"Consider this update as crucial as the original context document creation",
|
|
312
|
+
"Limit output based on automation level; use bullet points for readability",
|
|
313
|
+
"After updating CONTEXT.md, commit the planning completion: 'docs(planning): finalize implementation plan and context' (auto-commit for High automation, suggest for Medium/Low)"
|
|
314
|
+
],
|
|
315
|
+
"requireConfirmation": false
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"id": "phase-6-prepare-steps",
|
|
319
|
+
"title": "Phase 6 Preparation: Extract Implementation Steps",
|
|
320
|
+
"prompt": "Before starting the implementation loop, extract the discrete implementation steps from the approved `implementation_plan.md` into a context array.\n\n**Your task:**\n1. Read the implementation_plan.md\n2. Identify each discrete, actionable step from the Implementation Strategy section\n3. Create an array called `implementationSteps` where each item has:\n - `title`: Brief title of the step\n - `description`: Detailed description of what to do\n - `outputs`: Expected outputs or changes\n\n**Example format:**\n```json\n[\n {\n \"title\": \"Create user authentication module\",\n \"description\": \"Implement the authentication service with login/logout methods\",\n \"outputs\": \"auth.service.ts file with login() and logout() methods\"\n },\n {\n \"title\": \"Add validation middleware\",\n \"description\": \"Create middleware to validate user credentials\",\n \"outputs\": \"validation.middleware.ts with credential validation logic\"\n }\n]\n```\n\n**Set this array as the `implementationSteps` context variable for the loop to consume.**",
|
|
321
|
+
"agentRole": "You are preparing the implementation phase by extracting actionable steps from the plan into a structured format for iteration.",
|
|
322
|
+
"guidance": [
|
|
323
|
+
"Each step should be a logical, committable chunk of work",
|
|
324
|
+
"Steps should be ordered as they appear in the plan",
|
|
325
|
+
"Include enough detail for clear implementation",
|
|
326
|
+
"This enables the loop to iterate over a concrete list"
|
|
327
|
+
],
|
|
328
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
329
|
+
"requireConfirmation": false
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"id": "phase-6-iterative-implementation",
|
|
333
|
+
"type": "loop",
|
|
334
|
+
"title": "Phase 6: Iterative Implementation Loop (PREP -> IMPLEMENT -> VERIFY)",
|
|
335
|
+
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
336
|
+
"loop": {
|
|
337
|
+
"type": "forEach",
|
|
338
|
+
"items": "implementationSteps",
|
|
339
|
+
"itemVar": "currentStep",
|
|
340
|
+
"indexVar": "stepIndex",
|
|
341
|
+
"maxIterations": 25,
|
|
342
|
+
"iterationVar": "stepIteration"
|
|
343
|
+
},
|
|
344
|
+
"body": [
|
|
345
|
+
{
|
|
346
|
+
"id": "phase-6-prep",
|
|
347
|
+
"title": "PREP: Prepare for {{currentStep.title}}",
|
|
348
|
+
"prompt": "**PREPARATION PHASE for Step {{stepIndex + 1}}/{{implementationSteps.length}}: {{currentStep.title}}**\n\nBefore implementing this step, you must first PREPARE:\n\n1. **Review the step description**: {{currentStep.description}}\n2. **Confirm prerequisites**: Verify the previous step (if any) was completed correctly\n3. **Validate current state**: Ensure the plan for this step is still valid in the current codebase\n4. **List requirements**: Identify all required inputs, files, or dependencies\n\n**BRANCH SETUP (first iteration only):** If this is the first implementation step ({{stepIndex}} === 0):\n- Check git availability with 'git status'\n- If available, create feature branch: 'git checkout -b wip-[unique-task-id]'\n- Track the featureBranch variable for later use\n- If git unavailable: Skip branching, log in CONTEXT.md\n\n**Do not proceed if anything is unclear or missing.**",
|
|
349
|
+
"agentRole": "You are preparing to implement a specific step from the plan. Be meticulous in verifying all prerequisites are met before proceeding.",
|
|
350
|
+
"guidance": [
|
|
351
|
+
"This is step {{stepIndex + 1}} of {{implementationSteps.length}} total implementation steps",
|
|
352
|
+
"Current iteration: {{stepIteration}} (for tracking purposes)",
|
|
353
|
+
"Focus only on preparation - implementation comes next",
|
|
354
|
+
"If this is the first step, handle git branch setup"
|
|
355
|
+
],
|
|
356
|
+
"requireConfirmation": false
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"id": "phase-6-implement",
|
|
360
|
+
"title": "IMPLEMENT: Execute {{currentStep.title}}",
|
|
361
|
+
"prompt": "**IMPLEMENTATION PHASE for {{currentStep.title}}**\n\nNow implement this specific step:\n\n**Step Details:**\n- Title: {{currentStep.title}}\n- Description: {{currentStep.description}}\n- Expected Outputs: {{currentStep.outputs}}\n\n**USER RULES REMINDER:** Apply all user-defined patterns, conventions, and preferences including:\n- Architectural patterns specified by the user\n- Naming conventions and code style preferences\n- Library/framework preferences\n- Any other project-specific guidelines\n\n**Instructions:**\n1. Focus only on this single step\n2. Use your tools to make the necessary code changes\n3. Adhere to all quality standards and conventions\n4. Follow the plan precisely while adapting to unexpected discoveries\n5. Ensure all code follows user-defined rules and patterns\n\n**Progress Tracking:**\n- This is step {{stepIndex + 1}} of {{implementationSteps.length}}\n- Total steps executed so far: {{stepIteration}}\n- If total steps > 20 without completion, pause for user intervention\n\n**CONTEXT UPDATES:** If this is every 3rd step ({{stepIteration}} % 3 === 0), update CONTEXT.md with:\n- Progress summary\n- Current status\n- Files modified\n- Remaining work",
|
|
362
|
+
"agentRole": "You are implementing a specific step from the approved plan. Focus on precise execution while maintaining code quality.",
|
|
363
|
+
"guidance": [
|
|
364
|
+
"Implement only what this step requires",
|
|
365
|
+
"Track progress for potential intervention",
|
|
366
|
+
"Update context documentation every 3 steps"
|
|
367
|
+
],
|
|
368
|
+
"requireConfirmation": false
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"id": "phase-6-verify",
|
|
372
|
+
"title": "VERIFY: Validate {{currentStep.title}}",
|
|
373
|
+
"prompt": "**VERIFICATION PHASE for {{currentStep.title}}**\n\nVerify the implementation of this step is complete and correct:\n\n**Required Verification Steps:**\n1. **Test Coverage**: Write necessary unit/integration tests for the new logic\n - Target: >80% coverage for new code\n - Report metrics after test creation\n\n2. **Run Tests**: Execute the full test suite\n - Use --quiet flags and output to files\n - Ensure 0 regressions introduced\n - If failures occur, follow failure protocol\n\n3. **Self-Review**: Critical review of changes\n - Check against the plan\n - Verify code quality\n - Assess side effects\n - Confirm architectural alignment\n\n**COMMIT Decision (if all verification passes):**\n- For automationLevel=High: Auto-commit with message\n- For automationLevel=Medium/Low: Suggest commit and confirm\n- Use conventional format: type(scope): description\n- If git unavailable: Log in CONTEXT.md\n\n**FAILURE PROTOCOL:** If verification fails after 2 attempts:\n1. Do not try a third time\n2. Fall back to alternative tools if needed\n3. Update CONTEXT.md with failure details\n4. Present summary and recommendations\n5. Set 'verificationFailed' context variable to true",
|
|
374
|
+
"agentRole": "You are verifying the implementation meets all quality standards. Be thorough but respect failure bounds.",
|
|
375
|
+
"guidance": [
|
|
376
|
+
"All three verification steps must pass",
|
|
377
|
+
"Track failure attempts (max 2)",
|
|
378
|
+
"Commit only after successful verification",
|
|
379
|
+
"Update context on failures"
|
|
380
|
+
],
|
|
381
|
+
"runCondition": { "var": "verificationFailed", "not_equals": true },
|
|
382
|
+
"requireConfirmation": false
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"requireConfirmation": false
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"id": "phase-6b-refinement-check",
|
|
389
|
+
"title": "Phase 6b: Agile Refinement Check",
|
|
390
|
+
"prompt": "After completing a chunk of implementation, evaluate if refinements are needed based on new insights. Set 'needsRefinement' context variable to true if updates to spec, design, or plan are required. If true, proceed to refinement steps; else, continue implementation or move to final review.",
|
|
391
|
+
"agentRole": "Agile refinement checker",
|
|
392
|
+
"runCondition": {"var": "implementationInProgress", "equals": true},
|
|
393
|
+
"requireConfirmation": true
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"id": "phase-6c-update-spec",
|
|
397
|
+
"title": "Phase 6c: Update Specification",
|
|
398
|
+
"prompt": "Based on implementation insights, update spec.md with necessary changes. Justify updates and get user confirmation.",
|
|
399
|
+
"agentRole": "Specification updater",
|
|
400
|
+
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
401
|
+
"requireConfirmation": true
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"id": "phase-6d-update-design",
|
|
405
|
+
"title": "Phase 6d: Update Design",
|
|
406
|
+
"prompt": "Update design.md based on new insights. Maintain alignment with codebase.",
|
|
407
|
+
"agentRole": "Design updater",
|
|
408
|
+
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
409
|
+
"requireConfirmation": true
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"id": "phase-6e-update-plan",
|
|
413
|
+
"title": "Phase 6e: Update Implementation Plan",
|
|
414
|
+
"prompt": "Revise implementation_plan.md incorporating refinements. Reset 'needsRefinement' to false after updates.",
|
|
415
|
+
"agentRole": "Plan updater",
|
|
416
|
+
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
417
|
+
"requireConfirmation": true
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"id": "phase-7-final-review",
|
|
421
|
+
"title": "Phase 7: Final Review & Completion",
|
|
422
|
+
"prompt": "Perform final review by validating work against the **'Final Review Checklist'** from `implementation_plan.md`.\n\n**USER RULES CHECK:** Verify all code follows user-defined rules, patterns, and preferences.\n\nFor each checklist item, provide confirmation and evidence. Validate metrics (coverage %, test results).\n\n**Additional validation:**\n- User rules/preferences compliance\n- Architectural patterns match specifications\n- Naming conventions and code style\n- Library/framework usage alignment\n\n**Final commit:**\n- Format: 'feat|fix|refactor(scope): final implementation - <summary>'\n- Include metrics in body\n- Auto-commit for High automation; confirm for Medium/Low\n\n**Branch cleanup (if git):**\n1. Merge: 'git checkout main && git merge --squash [featureBranch]'\n2. Delete: 'git branch -d [featureBranch]'\n3. Auto-execute if High automation & confidence >8\n4. Pause for conflicts\n5. Log in CONTEXT.md if no git\n\n**Update `CONTEXT.md` final sections:**\n\n## 9. FINAL STATUS\n- ✅ Steps completed\n- ✅ Tests passing (metrics)\n- ✅ Checklist validated\n- ✅ User rules verified\n- 📁 Files modified\n- 📋 Known issues\n- 🔄 Next steps\n- 📜 Git history\n\n## 10. HANDOFF\n- Accomplishments\n- Architecture decisions\n- Implementation details\n- Follow-up work\n\nConclude with follow-ups or dependencies.",
|
|
423
|
+
"agentRole": "You are a quality assurance specialist and technical lead responsible for final project validation and comprehensive handoff documentation. Your expertise lies in comprehensive system testing, requirement verification, and ensuring deliverables meet all specified criteria while creating documentation that enables seamless future maintenance.",
|
|
424
|
+
"guidance": [
|
|
425
|
+
"This is the final quality check. Ensure the agent's summary and checklist validation align with your understanding of the completed work.",
|
|
426
|
+
"The final CONTEXT.md update should serve as a complete project archive",
|
|
427
|
+
"Include specific details that would help future developers understand and maintain the work",
|
|
428
|
+
"Ensure all promised deliverables have been completed and documented",
|
|
429
|
+
"Include quantitative metrics and validation results in the final status"
|
|
430
|
+
],
|
|
431
|
+
"requireConfirmation": true
|
|
432
|
+
}
|
|
433
|
+
]
|
|
434
|
+
}
|