@exaudeus/workrail 0.0.14 → 0.0.16
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 +1 -1
- package/spec/examples/coding-task-workflow.json +126 -107
- package/spec/examples/conditional-workflow-example.json +251 -212
- package/spec/examples/valid-workflow.json +118 -115
- package/spec/workflow.schema.json +5 -0
- package/workflows/adaptive-ticket-creation.json +272 -245
- package/workflows/coding-task-workflow.json +94 -31
- package/workflows/learner-centered-course-workflow.json +267 -265
- package/workflows/personal-learning-materials-creation-branched.json +195 -175
- package/workflows/presentation-creation.json +244 -237
- package/workflows/systemic-bug-investigation.json +175 -174
- package/workflows/workflow-for-workflows.json +296 -262
package/package.json
CHANGED
|
@@ -29,113 +29,132 @@
|
|
|
29
29
|
],
|
|
30
30
|
"requireConfirmation": true
|
|
31
31
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
{"var": "requestDeepAnalysis", "equals": true}
|
|
60
|
-
]
|
|
32
|
+
{
|
|
33
|
+
"id": "phase-1-scoping",
|
|
34
|
+
"runCondition": {
|
|
35
|
+
"var": "taskComplexity",
|
|
36
|
+
"not_equals": "Small"
|
|
37
|
+
},
|
|
38
|
+
"title": "Phase 1: Task Briefing & Scope Definition",
|
|
39
|
+
"prompt": "Your first goal is to understand the task. Analyze the following request, summarize your understanding, ask clarifying questions, and assess which parts of the codebase are relevant.\n\n**Task Description:**\n[User inserts detailed task description here]\n\n**Key Objectives & Success Criteria:**\n[User lists specific, measurable success criteria here]\n\n**Scope and Constraints:**\n[User defines boundaries or areas to avoid here]\n\nFinally, based on your analysis, perform a sanity check on the initial complexity sizing. If you believe the classification is incorrect, state your reasoning and ask for confirmation before proceeding. For example: 'You classified this as Medium, but my analysis shows it impacts several core architectural components. I recommend we upgrade to the Large path to perform a Deep Analysis. Do you agree?'",
|
|
40
|
+
"guidance": [
|
|
41
|
+
"Provide a complete task description. Vague requests will lead to poor plans and wasted effort.",
|
|
42
|
+
"This step is automatically skipped for Small tasks based on the complexity classification"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "phase-1b-deep-analysis-mandatory",
|
|
47
|
+
"runCondition": {
|
|
48
|
+
"var": "taskComplexity",
|
|
49
|
+
"equals": "Large"
|
|
50
|
+
},
|
|
51
|
+
"title": "Phase 1b: Mandatory Deep Codebase Analysis",
|
|
52
|
+
"prompt": "Your goal is to become an expert on the attached codebase. This deep analysis is mandatory for Large tasks due to their complexity and risk. Your 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.\n\nProvide summaries and code examples to illustrate your findings. Be exhaustive, as if preparing onboarding documentation for a senior engineer.",
|
|
53
|
+
"askForFiles": true,
|
|
54
|
+
"guidance": [
|
|
55
|
+
"This step is mandatory for Large tasks due to their complexity and risk",
|
|
56
|
+
"Ensure all relevant source files are attached or accessible to the agent before running this step",
|
|
57
|
+
"Be thorough - this analysis will inform the entire implementation strategy"
|
|
58
|
+
]
|
|
61
59
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"prompt": "Your goal is to produce a thorough and actionable plan of attack. Do not write any code. Your plan must be detailed, broken into committable phases, and justified.\n\nYour plan must include these sections:\n1. **Goal Clarification:** Your understanding of the goal, assumptions, and success criteria.\n2. **Impact Assessment:** Affected codebase parts, dependencies, and risks.\n3. **Implementation Strategy:** A list of discrete, actionable steps. Each step must detail the task, its rationale, inputs, and outputs.\n4. **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\nPresent this as a formal proposal.",
|
|
76
|
-
"guidance": [
|
|
77
|
-
"The agent will now proceed to critique its own plan in the next step. Withhold your final approval until after that critique.",
|
|
78
|
-
"This step is automatically skipped for Small tasks based on the complexity classification"
|
|
79
|
-
]
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"id": "phase-2b-devil-advocate-review",
|
|
83
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
84
|
-
"title": "Phase 2b: Devil's Advocate Plan Review",
|
|
85
|
-
"prompt": "Your new goal is to act as a skeptical but fair senior principal engineer. Your task is to perform a 'devil's advocate' review of the implementation plan you just created in Phase 2. 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, 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, give a confidence score (1-10) for the plan *if* your suggestions are implemented.",
|
|
86
|
-
"guidance": [
|
|
87
|
-
"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.",
|
|
88
|
-
"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.",
|
|
89
|
-
"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.",
|
|
90
|
-
"This step is automatically skipped for Small tasks based on the complexity classification"
|
|
91
|
-
],
|
|
92
|
-
"requireConfirmation": true
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"id": "phase-3-iterative-implementation",
|
|
96
|
-
"title": "Phase 3: Iterative Implementation (PREP -> IMPLEMENT -> VERIFY)",
|
|
97
|
-
"prompt": "The implementation phase has now begun. **Please provide me with the next single step from the approved plan.** If we are on the 'Small' path, provide a single, clear implementation instruction.\n\nI will execute *only* that step using the PREP -> IMPLEMENT -> VERIFY cycle defined in the guidance below, and then await your command for the subsequent step. This process will repeat until all steps are complete.",
|
|
98
|
-
"guidance": [
|
|
99
|
-
"**Efficiency Tip:** For high-confidence plans, you may provide multiple step instructions at once. I will execute them sequentially, performing the P->I->V cycle for each, and will only pause to ask for input if I encounter a verification failure or ambiguity.",
|
|
100
|
-
"**PREP:** Before implementing each step, you must first PREPARE. Re-read the step's description, confirm the previous step was completed correctly, verify the plan for this step is still valid in the current codebase, and list all required inputs or files. Do not proceed if anything is unclear.",
|
|
101
|
-
"**IMPLEMENT:** After preparation is confirmed, you will IMPLEMENT the step. Focus only on this single step. Use your tools to make the necessary code changes, adhering to all quality standards. Provide a commit message upon completion.",
|
|
102
|
-
"**VERIFY:** Immediately after implementation, you must VERIFY your work. Your verification for this step **is not complete until you have**:\n1. **Written necessary unit/integration tests** for the new logic.\n2. **Run the full test suite** to ensure no regressions were introduced.\n3. **Performed a critical self-review** of the changes against the plan, checking for code quality, side effects, and architectural alignment.\n\n**Failure Protocol:** If a verification failure cannot be resolved after two attempts, you must halt. Do not try a third time. Instead, present a summary of the problem, detail your failed attempts, and recommend a course of action to the user (e.g., 'revert this step and re-plan', 'request more information', 'proceed with a known issue')."
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
"id": "phase-4-final-review",
|
|
107
|
-
"title": "Phase 4: Final Review & Completion",
|
|
108
|
-
"prompt": "All planned steps have been implemented and verified. Your final goal is to perform a holistic review by validating the work against the **'Final Review Checklist'** created and approved during Phase 2.\n\nFor each item on that checklist, provide a confirmation and evidence that it has been met. Conclude with a summary of any potential follow-ups or new dependencies to note.",
|
|
109
|
-
"guidance": [
|
|
110
|
-
"This is the final quality check. Ensure the agent's summary and checklist validation align with your understanding of the completed work."
|
|
111
|
-
],
|
|
112
|
-
"requireConfirmation": true,
|
|
113
|
-
"validationCriteria": [
|
|
114
|
-
{
|
|
115
|
-
"type": "contains",
|
|
116
|
-
"value": "checklist",
|
|
117
|
-
"message": "Should reference the final review checklist"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"type": "contains",
|
|
121
|
-
"value": "complete",
|
|
122
|
-
"message": "Should confirm completion of all requirements"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"type": "length",
|
|
126
|
-
"min": 150,
|
|
127
|
-
"condition": {
|
|
128
|
-
"var": "taskComplexity",
|
|
129
|
-
"not_equals": "Small"
|
|
60
|
+
{
|
|
61
|
+
"id": "phase-1b-deep-analysis-optional",
|
|
62
|
+
"runCondition": {
|
|
63
|
+
"and": [
|
|
64
|
+
{
|
|
65
|
+
"var": "taskComplexity",
|
|
66
|
+
"equals": "Medium"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"var": "requestDeepAnalysis",
|
|
70
|
+
"equals": true
|
|
71
|
+
}
|
|
72
|
+
]
|
|
130
73
|
},
|
|
131
|
-
"
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
74
|
+
"title": "Phase 1b: Optional Deep Codebase Analysis",
|
|
75
|
+
"prompt": "You requested optional deep analysis for this Medium task. Your goal is to become an expert on the attached codebase. Your 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.\n\nProvide summaries and code examples to illustrate your findings. Be exhaustive, as if preparing onboarding documentation for a senior engineer.",
|
|
76
|
+
"askForFiles": true,
|
|
77
|
+
"guidance": [
|
|
78
|
+
"This optional analysis was requested for a Medium task",
|
|
79
|
+
"Ensure all relevant source files are attached or accessible to the agent before running this step",
|
|
80
|
+
"Focus on areas most relevant to the current task"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "phase-2-planning",
|
|
85
|
+
"runCondition": {
|
|
86
|
+
"var": "taskComplexity",
|
|
87
|
+
"not_equals": "Small"
|
|
88
|
+
},
|
|
89
|
+
"title": "Phase 2: Create Detailed Implementation Plan",
|
|
90
|
+
"prompt": "Your goal is to produce a thorough and actionable plan of attack. Do not write any code. Your plan must be detailed, broken into committable phases, and justified.\n\nYour plan must include these sections:\n1. **Goal Clarification:** Your understanding of the goal, assumptions, and success criteria.\n2. **Impact Assessment:** Affected codebase parts, dependencies, and risks.\n3. **Implementation Strategy:** A list of discrete, actionable steps. Each step must detail the task, its rationale, inputs, and outputs.\n4. **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\nPresent this as a formal proposal.",
|
|
91
|
+
"guidance": [
|
|
92
|
+
"The agent will now proceed to critique its own plan in the next step. Withhold your final approval until after that critique.",
|
|
93
|
+
"This step is automatically skipped for Small tasks based on the complexity classification"
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"id": "phase-2b-devil-advocate-review",
|
|
98
|
+
"runCondition": {
|
|
99
|
+
"var": "taskComplexity",
|
|
100
|
+
"not_equals": "Small"
|
|
101
|
+
},
|
|
102
|
+
"title": "Phase 2b: Devil's Advocate Plan Review",
|
|
103
|
+
"prompt": "Your new goal is to act as a skeptical but fair senior principal engineer. Your task is to perform a 'devil's advocate' review of the implementation plan you just created in Phase 2. 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, 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, give a confidence score (1-10) for the plan *if* your suggestions are implemented.",
|
|
104
|
+
"guidance": [
|
|
105
|
+
"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.",
|
|
106
|
+
"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.",
|
|
107
|
+
"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.",
|
|
108
|
+
"This step is automatically skipped for Small tasks based on the complexity classification"
|
|
109
|
+
],
|
|
110
|
+
"requireConfirmation": true
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"id": "phase-3-iterative-implementation",
|
|
114
|
+
"title": "Phase 3: Iterative Implementation (PREP -> IMPLEMENT -> VERIFY)",
|
|
115
|
+
"prompt": "The implementation phase has now begun. **Please provide me with the next single step from the approved plan.** If we are on the 'Small' path, provide a single, clear implementation instruction.\n\nI will execute *only* that step using the PREP -> IMPLEMENT -> VERIFY cycle defined in the guidance below, and then await your command for the subsequent step. This process will repeat until all steps are complete.",
|
|
116
|
+
"guidance": [
|
|
117
|
+
"**Efficiency Tip:** For high-confidence plans, you may provide multiple step instructions at once. I will execute them sequentially, performing the P->I->V cycle for each, and will only pause to ask for input if I encounter a verification failure or ambiguity.",
|
|
118
|
+
"**PREP:** Before implementing each step, you must first PREPARE. Re-read the step's description, confirm the previous step was completed correctly, verify the plan for this step is still valid in the current codebase, and list all required inputs or files. Do not proceed if anything is unclear.",
|
|
119
|
+
"**IMPLEMENT:** After preparation is confirmed, you will IMPLEMENT the step. Focus only on this single step. Use your tools to make the necessary code changes, adhering to all quality standards. Provide a commit message upon completion.",
|
|
120
|
+
"**VERIFY:** Immediately after implementation, you must VERIFY your work. Your verification for this step **is not complete until you have**:\n1. **Written necessary unit/integration tests** for the new logic.\n2. **Run the full test suite** to ensure no regressions were introduced.\n3. **Performed a critical self-review** of the changes against the plan, checking for code quality, side effects, and architectural alignment.\n\n**Failure Protocol:** If a verification failure cannot be resolved after two attempts, you must halt. Do not try a third time. Instead, present a summary of the problem, detail your failed attempts, and recommend a course of action to the user (e.g., 'revert this step and re-plan', 'request more information', 'proceed with a known issue')."
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"id": "phase-4-final-review",
|
|
125
|
+
"title": "Phase 4: Final Review & Completion",
|
|
126
|
+
"prompt": "All planned steps have been implemented and verified. Your final goal is to perform a holistic review by validating the work against the **'Final Review Checklist'** created and approved during Phase 2.\n\nFor each item on that checklist, provide a confirmation and evidence that it has been met. Conclude with a summary of any potential follow-ups or new dependencies to note.",
|
|
127
|
+
"guidance": [
|
|
128
|
+
"This is the final quality check. Ensure the agent's summary and checklist validation align with your understanding of the completed work."
|
|
129
|
+
],
|
|
130
|
+
"requireConfirmation": true,
|
|
131
|
+
"validationCriteria": [
|
|
132
|
+
{
|
|
133
|
+
"type": "contains",
|
|
134
|
+
"value": "checklist",
|
|
135
|
+
"message": "Should reference the final review checklist"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"type": "contains",
|
|
139
|
+
"value": "complete",
|
|
140
|
+
"message": "Should confirm completion of all requirements"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"type": "length",
|
|
144
|
+
"min": 150,
|
|
145
|
+
"condition": {
|
|
146
|
+
"var": "taskComplexity",
|
|
147
|
+
"not_equals": "Small"
|
|
148
|
+
},
|
|
149
|
+
"message": "Complex tasks require detailed final review"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "regex",
|
|
153
|
+
"pattern": "(?!.*TODO)",
|
|
154
|
+
"message": "Should not contain TODO items"
|
|
155
|
+
}
|
|
156
|
+
],
|
|
157
|
+
"hasValidation": true
|
|
158
|
+
}
|
|
140
159
|
]
|
|
141
|
-
}
|
|
160
|
+
}
|