@exaudeus/workrail 3.6.2 → 3.7.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/README.md
CHANGED
|
@@ -245,8 +245,12 @@ support [conditions, loops, validation criteria](docs/authoring.md), and more.
|
|
|
245
245
|
|
|
246
246
|
- [All Workflows](docs/workflows.md) – Full list with detailed descriptions
|
|
247
247
|
- [Writing Workflows](docs/authoring.md) – Custom workflow creation guide
|
|
248
|
+
- [Workflow Authoring Principles (v2)](docs/authoring-v2.md) – Cross-workflow design rules and authoring principles
|
|
248
249
|
- [Configuration](docs/configuration.md) – Git repos, environment variables, local paths
|
|
249
250
|
- [Advanced Features](docs/advanced.md) – Loops, conditionals, validation
|
|
251
|
+
- **Integrations**
|
|
252
|
+
- [Claude Code Setup](docs/integrations/claude-code.md) – Complete guide for Desktop & CLI
|
|
253
|
+
- [Firebender Setup](docs/integrations/firebender.md) – Firebender integration
|
|
250
254
|
|
|
251
255
|
---
|
|
252
256
|
|
package/package.json
CHANGED
package/spec/mcp-api-v1.0.md
CHANGED
|
@@ -175,20 +175,17 @@ Retrieves workflow information with configurable detail level. Supports progress
|
|
|
175
175
|
"jsonrpc": "2.0",
|
|
176
176
|
"id": 2,
|
|
177
177
|
"result": {
|
|
178
|
-
"id": "coding-task-workflow-
|
|
179
|
-
"name": "
|
|
180
|
-
"description": "
|
|
178
|
+
"id": "coding-task-workflow-agentic",
|
|
179
|
+
"name": "Lean Agentic Coding Task Workflow",
|
|
180
|
+
"description": "Lean workflow for executing coding tasks with scoped design, bounded delegation, and explicit verification.",
|
|
181
181
|
"version": "0.1.0",
|
|
182
|
-
"preconditions": ["
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"totalSteps": 8,
|
|
182
|
+
"preconditions": ["Task description is available and any required codebase or artifact access is accessible to the agent."],
|
|
183
|
+
"metaGuidance": ["Stay outcome-focused and evidence-based throughout the task."],
|
|
184
|
+
"totalSteps": 14,
|
|
186
185
|
"firstStep": {
|
|
187
|
-
"id": "phase-0-
|
|
188
|
-
"title": "Phase 0:
|
|
189
|
-
"prompt": "
|
|
190
|
-
"agentRole": "You are a technical assessment specialist...",
|
|
191
|
-
"guidance": ["Be thorough in your analysis"],
|
|
186
|
+
"id": "phase-0-understand-and-classify",
|
|
187
|
+
"title": "Phase 0: Understand & Classify",
|
|
188
|
+
"prompt": "Understand this before you touch anything....",
|
|
192
189
|
"requireConfirmation": true
|
|
193
190
|
}
|
|
194
191
|
}
|
|
@@ -201,14 +198,13 @@ Retrieves workflow information with configurable detail level. Supports progress
|
|
|
201
198
|
"jsonrpc": "2.0",
|
|
202
199
|
"id": 2,
|
|
203
200
|
"result": {
|
|
204
|
-
"id": "coding-task-workflow-
|
|
205
|
-
"name": "
|
|
206
|
-
"description": "
|
|
201
|
+
"id": "coding-task-workflow-agentic",
|
|
202
|
+
"name": "Lean Agentic Coding Task Workflow",
|
|
203
|
+
"description": "Lean workflow for executing coding tasks with scoped design, bounded delegation, and explicit verification.",
|
|
207
204
|
"version": "0.1.0",
|
|
208
|
-
"preconditions": ["
|
|
209
|
-
"
|
|
210
|
-
"
|
|
211
|
-
"totalSteps": 8
|
|
205
|
+
"preconditions": ["Task description is available and any required codebase or artifact access is accessible to the agent."],
|
|
206
|
+
"metaGuidance": ["Stay outcome-focused and evidence-based throughout the task."],
|
|
207
|
+
"totalSteps": 14
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
```
|
|
@@ -7,10 +7,6 @@
|
|
|
7
7
|
"recommendedAutonomy": "guided",
|
|
8
8
|
"recommendedRiskPolicy": "conservative"
|
|
9
9
|
},
|
|
10
|
-
"features": [
|
|
11
|
-
"wr.features.subagent_guidance",
|
|
12
|
-
"wr.features.memory_context"
|
|
13
|
-
],
|
|
14
10
|
"preconditions": [
|
|
15
11
|
"User specifies source and target platforms.",
|
|
16
12
|
"Agent has read access to the source codebase.",
|
|
@@ -22,6 +18,13 @@
|
|
|
22
18
|
"SCOPE DISCIPLINE: convert only what the user scoped. Do not expand to adjacent features or modules unless explicitly asked.",
|
|
23
19
|
"DEPENDENCY MAPPING: never assume a library exists on the target platform. Map each dependency to its target equivalent or flag it as needing a custom solution.",
|
|
24
20
|
"PLATFORM CONVENTIONS: follow the target platform's conventions for project structure, naming, error handling, concurrency, and testing.",
|
|
21
|
+
"SEMANTIC CONTRACTS: preserve caller-visible guarantees and lifecycle behavior, not just type names or structure. Map contract-to-contract, not construct-to-construct.",
|
|
22
|
+
"ANTI-ANCHORING: existing target-platform conventions are evidence, not proof. Follow them only when they preserve the source boundary's intent and guarantees.",
|
|
23
|
+
"UNCERTAINTY STOPS PROGRESSION: if a non-trivial boundary cannot be mapped confidently, mark it uncertain and escalate instead of guessing.",
|
|
24
|
+
"TARGET REPO FIT: migrate into the target repo's actual architectural seams, not just the target platform's generic idioms.",
|
|
25
|
+
"EVIDENCE OVER FAMILIARITY: choose reuse, adaptation, or new integration points based on concrete target-repo evidence, not on the first similar-looking abstraction.",
|
|
26
|
+
"ADAPTATION DEPTH: when source and target architectures differ materially, plan the adaptation explicitly before implementation. Do not treat redesign as translation.",
|
|
27
|
+
"SEPARATE SIZE FROM ADAPTATION: a small migration can still require deep architectural adaptation. Do not use file count as a proxy for design difficulty.",
|
|
25
28
|
"BUILD PROOF: code that does not build is not done. Run build or typecheck after every conversion batch.",
|
|
26
29
|
"PRESERVE INTENT: the goal is functional equivalence, not line-by-line correspondence. Restructure when the target platform has a better way.",
|
|
27
30
|
"TRIAGE FIRST: not all code is equal. Separate trivial translations from code needing real design decisions. Delegate the easy stuff, focus on the hard stuff.",
|
|
@@ -33,7 +36,33 @@
|
|
|
33
36
|
{
|
|
34
37
|
"id": "phase-0-scope",
|
|
35
38
|
"title": "Phase 0: Scope & Platform Analysis",
|
|
36
|
-
"
|
|
39
|
+
"promptBlocks": {
|
|
40
|
+
"goal": "Understand the migration scope, platforms, target repo location, and rough size before any implementation begins.",
|
|
41
|
+
"constraints": [
|
|
42
|
+
"If the user has not specified scope boundaries, ask. Do not guess at scope.",
|
|
43
|
+
"Find the target repo yourself before asking the user.",
|
|
44
|
+
"Check saved repo mappings in agent config or memory before falling back to broader discovery."
|
|
45
|
+
],
|
|
46
|
+
"procedure": [
|
|
47
|
+
"Determine what is being converted: single file, module, feature, full component, or entire app.",
|
|
48
|
+
"Identify the source platform and target platform.",
|
|
49
|
+
"Estimate conversion size using file count and rough LOC.",
|
|
50
|
+
"Classify `conversionComplexity` as Small, Medium, or Large using this guidance: Small = 1-3 files and mostly mechanical; Medium = module or feature with mixed difficulty; Large = many files with deep platform coupling and multiple idiom-mapping decisions."
|
|
51
|
+
],
|
|
52
|
+
"outputRequired": {
|
|
53
|
+
"sourcePlatform": "The source platform being migrated from.",
|
|
54
|
+
"targetPlatform": "The target platform being migrated to.",
|
|
55
|
+
"conversionScope": "The bounded scope of the migration.",
|
|
56
|
+
"targetRepoPath": "Where the converted code should land.",
|
|
57
|
+
"estimatedSize": "A rough estimate of migration size.",
|
|
58
|
+
"conversionComplexity": "Small, Medium, or Large."
|
|
59
|
+
},
|
|
60
|
+
"verify": [
|
|
61
|
+
"The migration scope is explicit and bounded.",
|
|
62
|
+
"The target repo location is identified or intentionally escalated.",
|
|
63
|
+
"The complexity classification matches the actual size and risk of the work."
|
|
64
|
+
]
|
|
65
|
+
},
|
|
37
66
|
"requireConfirmation": {
|
|
38
67
|
"var": "conversionComplexity",
|
|
39
68
|
"not_equals": "Small"
|
|
@@ -42,7 +71,7 @@
|
|
|
42
71
|
{
|
|
43
72
|
"id": "phase-1-understand-source",
|
|
44
73
|
"title": "Phase 1: Understand Source Code",
|
|
45
|
-
"prompt": "Read and analyze the source code through a conversion lens — what will be easy to convert, what will be hard, and why.\n\nMap out:\n- Architecture and module structure\n- Key patterns used (MVI, MVVM, dependency injection, etc.)\n- External dependencies and what they do\n- Entry points and public API surface\n- Platform coupling depth: is the code cleanly layered or is platform-specific code smeared throughout? This directly determines how much falls into easy vs. hard buckets.\n- Concurrency model: Coroutines, Combine, RxJS, async/await? This is often the single hardest mapping decision.\n- DI approach: Dagger/Hilt, Swinject, Koin? DI frameworks rarely map 1:1.\n- Test coverage shape: unit tests on business logic (convert easily), UI tests (likely rewrite), integration tests (depends on infra).\n- Shared code boundaries: is there already a shared/common module that might not need conversion at all?\n\nCapture:\n- `sourceArchitecture`\n- `dependencies`\n- `publicApiSurface`\n- `platformCouplingAssessment`\n- `concurrencyModel`\n- `testCoverageShape`",
|
|
74
|
+
"prompt": "Read and analyze the source code through a conversion lens — what will be easy to convert, what will be hard, and why.\n\nMap out:\n- Architecture and module structure\n- Key patterns used (MVI, MVVM, dependency injection, etc.)\n- External dependencies and what they do\n- Entry points and public API surface\n- Platform coupling depth: is the code cleanly layered or is platform-specific code smeared throughout? This directly determines how much falls into easy vs. hard buckets.\n- Concurrency model: Coroutines, Combine, RxJS, async/await? This is often the single hardest mapping decision.\n- DI approach: Dagger/Hilt, Swinject, Koin? DI frameworks rarely map 1:1.\n- Test coverage shape: unit tests on business logic (convert easily), UI tests (likely rewrite), integration tests (depends on infra).\n- Shared code boundaries: is there already a shared/common module that might not need conversion at all?\n- Non-trivial migration boundaries: public APIs, externally consumed module boundaries, and lifecycle/state/concurrency/resource boundaries that callers depend on.\n- Caller-visible guarantees for those boundaries. Examples include lifecycle/ownership, laziness vs eagerness, shared vs per-consumer behavior, cancellation/disposal, ordering/replay/buffering, failure behavior, threading/scheduling, or consistency/transaction guarantees.\n- Adaptation depth: classify whether the migration is `low`, `moderate`, or `high` adaptation based on architectural mismatch, missing target-side equivalents, lifecycle/state/concurrency mismatch, and the amount of adapter or redesign work needed.\n\nIdentify which files define or materially affect those boundaries and which of them will require target-repo integration analysis.\n\nCapture:\n- `sourceArchitecture`\n- `dependencies`\n- `publicApiSurface`\n- `platformCouplingAssessment`\n- `concurrencyModel`\n- `testCoverageShape`\n- `semanticBoundaryCandidates`\n- `boundaryCriticalFiles`\n- `adaptationProfile`",
|
|
46
75
|
"promptFragments": [
|
|
47
76
|
{
|
|
48
77
|
"id": "phase-1-small-light",
|
|
@@ -50,41 +79,146 @@
|
|
|
50
79
|
"text": "For Small conversions, keep this lightweight. A quick read of the files in scope is enough — don't map the entire architecture. Focus on identifying any platform-specific code that would prevent a straight translation."
|
|
51
80
|
}
|
|
52
81
|
],
|
|
53
|
-
"requireConfirmation":
|
|
82
|
+
"requireConfirmation": {
|
|
83
|
+
"var": "adaptationProfile",
|
|
84
|
+
"equals": "high"
|
|
85
|
+
}
|
|
54
86
|
},
|
|
55
87
|
{
|
|
56
88
|
"id": "phase-small-fast-path",
|
|
57
89
|
"title": "Small Conversion Fast Path",
|
|
58
90
|
"runCondition": {
|
|
59
|
-
"
|
|
60
|
-
|
|
91
|
+
"and": [
|
|
92
|
+
{ "var": "conversionComplexity", "equals": "Small" },
|
|
93
|
+
{ "var": "adaptationProfile", "equals": "low" }
|
|
94
|
+
]
|
|
61
95
|
},
|
|
62
|
-
"prompt": "For Small conversions, skip triage and planning — just convert.\n\n- Translate the files to the target platform idiomatically\n- Follow target platform naming and structure conventions\n- Map any dependencies to target equivalents\n- Convert tests if they exist\n- Run build or typecheck to verify\n\nIf something turns out harder than expected (deep platform coupling, no clean dependency equivalent), update `conversionComplexity` to `Medium` and stop. The full triage and planning pipeline will activate for the remaining work.\n\nCapture:\n- `filesConverted`\n- `buildPassed`\n- `conversionComplexity`",
|
|
96
|
+
"prompt": "For Small conversions, skip triage and planning — just convert.\n\n- Translate the files to the target platform idiomatically\n- Follow target platform naming and structure conventions\n- Map any dependencies to target equivalents\n- Convert tests if they exist\n- Run build or typecheck to verify\n\nIf something turns out harder than expected (deep platform coupling, no clean dependency equivalent, or meaningful architectural mismatch), update `conversionComplexity` to `Medium`, update `adaptationProfile` to `moderate` or `high` based on the newly discovered mismatch, and stop. The full triage and planning pipeline will activate for the remaining work.\n\nCapture:\n- `filesConverted`\n- `buildPassed`\n- `conversionComplexity`\n- `adaptationProfile`",
|
|
63
97
|
"requireConfirmation": false
|
|
64
98
|
},
|
|
65
99
|
{
|
|
66
100
|
"id": "phase-2-triage",
|
|
67
101
|
"title": "Phase 2: Triage & Sort",
|
|
68
102
|
"runCondition": {
|
|
69
|
-
"
|
|
70
|
-
|
|
103
|
+
"or": [
|
|
104
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
105
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
106
|
+
]
|
|
71
107
|
},
|
|
72
|
-
"prompt": "Classify every file or module in scope into one of three buckets:\n\n**Bucket A — Literal translation**: Platform-agnostic business logic, data models, utilities, pure functions. These use no platform-specific APIs or libraries. Conversion is mechanical: translate the language syntax, follow target naming conventions, done. These will be delegated to subagents.\n\n**Bucket B — Library substitution**: Code that uses platform-specific libraries (networking, persistence, serialization, DI) but follows standard patterns. These need dependency mapping but the structure stays the same.\n\n**Bucket C — Platform-specific**: Code deeply tied to the platform (UI layer, lifecycle management, concurrency/threading, navigation, platform APIs). These need design decisions about target-platform idioms.\n\nFor each file or module, list:\n- File/module name\n- Bucket (A, B, or C)\n- One-line reason for classification\n- Dependencies it has on other files in scope (so we know conversion order)\n\nSort the work items within each bucket by dependency order (convert dependencies first).\n\nGroup Bucket A files into parallel batches of 3-5 files each. Each batch should contain files with no cross-dependencies so subagents can work independently.\n\nGroup Bucket B and C files into sequential batches by dependency order.\n\nEach batch should have: `name` (short label), `bucket` (A, B, or C), and `files` (list of file paths).\n\nCapture:\n- `bucketABatches` (parallel batches for subagent delegation)\n- `bucketBCBatches` (sequential batches for main agent)\n- `bucketACounts`\n- `bucketBCounts`\n- `bucketCCounts`",
|
|
108
|
+
"prompt": "Classify every file or module in scope into one of three buckets:\n\n**Bucket A — Literal translation**: Platform-agnostic business logic, data models, utilities, pure functions. These use no platform-specific APIs or libraries. Conversion is mechanical: translate the language syntax, follow target naming conventions, done. These will be delegated to subagents.\n\n**Bucket B — Library substitution**: Code that uses platform-specific libraries (networking, persistence, serialization, DI) but follows standard patterns. These need dependency mapping but the structure stays the same.\n\n**Bucket C — Platform-specific**: Code deeply tied to the platform (UI layer, lifecycle management, concurrency/threading, navigation, platform APIs). These need design decisions about target-platform idioms.\n\nFor each file or module, list:\n- File/module name\n- Bucket (A, B, or C)\n- One-line reason for classification\n- Dependencies it has on other files in scope (so we know conversion order)\n- Whether it is `boundaryCritical` for a non-trivial migration boundary\n- Which semantic boundaries it affects from `semanticBoundaryCandidates`\n- Whether it will require target-repo integration analysis\n\nBoundary-critical files must not be treated as blind mechanical translation just because the syntax looks simple. If a file materially affects a semantic boundary or destination-repo seam, keep it with main-agent review.\n\nSort the work items within each bucket by dependency order (convert dependencies first).\n\nGroup Bucket A files into parallel batches of 3-5 files each. Each batch should contain files with no cross-dependencies so subagents can work independently.\n\nGroup Bucket B and C files into sequential batches by dependency order.\n\nEach batch should have: `name` (short label), `bucket` (A, B, or C), and `files` (list of file paths).\n\nCapture:\n- `bucketABatches` (parallel batches for subagent delegation)\n- `bucketBCBatches` (sequential batches for main agent)\n- `bucketACounts`\n- `bucketBCounts`\n- `bucketCCounts`\n- `boundaryCriticalItems`",
|
|
73
109
|
"requireConfirmation": true
|
|
74
110
|
},
|
|
75
111
|
{
|
|
76
|
-
"id": "phase-
|
|
77
|
-
"title": "Phase
|
|
112
|
+
"id": "phase-3a-semantic-contracts",
|
|
113
|
+
"title": "Phase 3a: Semantic Contract Inventory",
|
|
78
114
|
"runCondition": {
|
|
79
|
-
"
|
|
80
|
-
|
|
115
|
+
"or": [
|
|
116
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
117
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"prompt": "Before planning implementation, create a compact semantic contract inventory for the non-trivial migration boundaries in scope.\n\nFocus on:\n- Public APIs\n- Externally consumed module boundaries\n- Lifecycle/state/concurrency/resource boundaries that callers rely on\n\nFor each boundary, record:\n- `boundary`: short identifier for the surface\n- `sourceSurface`: source API or construct\n- `keyGuarantees`: the caller-visible guarantees that must remain true\n- `targetConstruct`: chosen target type or pattern\n- `status`: `preserved`, `intentionally_changed`, or `uncertain`\n- `rationale`\n- `verificationPlan`\n\nUse examples of semantic dimensions as examples only, not a mandatory checklist: lifecycle/ownership, laziness vs eagerness, shared vs per-consumer behavior, cancellation/disposal, ordering/replay/buffering, failure behavior, threading/scheduling, or consistency/transaction guarantees.\n\nIf a boundary cannot be mapped confidently, mark it `uncertain` rather than guessing.\n\nCapture:\n- `semanticContractInventory`\n- `hasUncertainBoundaries`\n- `hasIntentionalBoundaryChanges`",
|
|
121
|
+
"promptFragments": [
|
|
122
|
+
{
|
|
123
|
+
"id": "phase-3a-medium-focused",
|
|
124
|
+
"when": { "var": "conversionComplexity", "equals": "Medium" },
|
|
125
|
+
"text": "For Medium conversions, inventory only the non-trivial boundaries actually touched by the scoped work. Don't expand this into a whole-system audit."
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"id": "phase-3a-high-adaptation",
|
|
129
|
+
"when": { "var": "adaptationProfile", "equals": "high" },
|
|
130
|
+
"text": "For high-adaptation migrations, cover every touched non-trivial boundary and explicitly call out where the contract is likely to be preserved, intentionally changed, or under architectural pressure."
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"requireConfirmation": {
|
|
134
|
+
"or": [
|
|
135
|
+
{ "var": "hasUncertainBoundaries", "equals": true },
|
|
136
|
+
{ "var": "hasIntentionalBoundaryChanges", "equals": true }
|
|
137
|
+
]
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"id": "phase-3b-target-integration",
|
|
142
|
+
"title": "Phase 3b: Target Integration Analysis",
|
|
143
|
+
"runCondition": {
|
|
144
|
+
"or": [
|
|
145
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
146
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
147
|
+
]
|
|
148
|
+
},
|
|
149
|
+
"prompt": "For each touched non-trivial migration boundary, analyze how it should fit into the target repo.\n\nThis step is about destination-repo fit, not source semantic guarantees. `semanticContractInventory` defines what must remain true. This step defines where the migrated boundary belongs and what target seams it must satisfy.\n\nFocus only on touched boundaries, not the whole target repo.\n\nFor each boundary, record:\n- `boundary`\n- `targetArea`: target module/layer/package/file area it belongs in\n- `existingPattern`: nearest relevant target abstraction or convention\n- `integrationPoints`: callers, adapters, DI/state/navigation/lifecycle hooks, persistence/network seams, or other required target touchpoints\n- `constraints`: repo-specific rules this boundary must satisfy\n- `decision`: `reuse_as_is`, `reuse_with_adapter`, `extend_existing`, `introduce_new`, or `defer_pending_decision`\n- `fitAssessment`: why the nearest existing abstraction is appropriate, insufficient, or misleading\n- `integrationRisk`: `low`, `medium`, or `high`\n- `uncertain`: `true` or `false`\n- `evidenceFiles`: concrete target files observed\n- `evidenceSymbols`: concrete target symbols observed\n- `rationale`\n\nUse concrete evidence from the target repo. Existing target code is evidence, not authority.\n\nCapture:\n- `targetIntegrationAnalysis`\n- `hasUncertainIntegrationPoints`",
|
|
150
|
+
"promptFragments": [
|
|
151
|
+
{
|
|
152
|
+
"id": "phase-3b-medium-focused",
|
|
153
|
+
"when": { "var": "conversionComplexity", "equals": "Medium" },
|
|
154
|
+
"text": "For Medium conversions, analyze only the touched boundaries that need real destination-repo decisions. Do not expand this into a broad target-architecture survey."
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"id": "phase-3b-high-adaptation",
|
|
158
|
+
"when": { "var": "adaptationProfile", "equals": "high" },
|
|
159
|
+
"text": "For high-adaptation migrations, compare at least one plausible alternative target area or seam for each important boundary and explain why the chosen fit is still the best one."
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"requireConfirmation": {
|
|
163
|
+
"var": "hasUncertainIntegrationPoints",
|
|
164
|
+
"equals": true
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"id": "phase-3c-design-brief",
|
|
169
|
+
"title": "Phase 3c: Prepare High-Adaptation Design Brief",
|
|
170
|
+
"runCondition": {
|
|
171
|
+
"var": "adaptationProfile",
|
|
172
|
+
"equals": "high"
|
|
173
|
+
},
|
|
174
|
+
"prompt": "Prepare a concise design brief for the high-adaptation design routine.\n\nSummarize:\n- the migration scope and non-goals\n- the most important rows from `semanticContractInventory`\n- the most important rows from `targetIntegrationAnalysis`\n- the architectural tensions driving adaptation difficulty\n- the constraints that make this migration more than straightforward translation\n\nTurn that into explicit routine inputs:\n- `problemStatement`: what design problem the routine should solve\n- `acceptanceCriteria`: the contract and target-fit outcomes the design must satisfy\n- `nonGoals`: what the migration should not expand into\n- `relevantFiles`: the most important source and target files the routine should study\n- `philosophySources`: any repo rules or sources that should constrain the design\n\nWrite the human-readable brief to `conversion-design-brief.md`, but make the captured context variables the primary handoff to the routine.\n\nCapture:\n- `designBriefReady`\n- `problemStatement`\n- `acceptanceCriteria`\n- `nonGoals`\n- `relevantFiles`\n- `philosophySources`",
|
|
175
|
+
"requireConfirmation": false
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"id": "phase-3d-design-generation",
|
|
179
|
+
"title": "Phase 3d: High-Adaptation Design Generation",
|
|
180
|
+
"runCondition": {
|
|
181
|
+
"var": "adaptationProfile",
|
|
182
|
+
"equals": "high"
|
|
81
183
|
},
|
|
82
|
-
"
|
|
184
|
+
"templateCall": {
|
|
185
|
+
"templateId": "wr.templates.routine.tension-driven-design",
|
|
186
|
+
"args": {
|
|
187
|
+
"deliverableName": "conversion-design-candidates.md"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"requireConfirmation": false
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"id": "phase-3e-select-adaptation-approach",
|
|
194
|
+
"title": "Phase 3e: Select Adaptation Approach",
|
|
195
|
+
"runCondition": {
|
|
196
|
+
"var": "adaptationProfile",
|
|
197
|
+
"equals": "high"
|
|
198
|
+
},
|
|
199
|
+
"prompt": "Read `conversion-design-candidates.md`, compare the candidates against `semanticContractInventory` and `targetIntegrationAnalysis`, and choose the adaptation approach.\n\nBe explicit about:\n- what the design work confirmed\n- what changed your mind\n- what target-repo fit or contract pressure matters most\n- what architecture-level adaptation is intentional rather than accidental\n\nCapture:\n- `selectedAdaptationApproach`\n- `runnerUpAdaptationApproach`\n- `architectureAdaptationPlan`\n- `adaptationPivotTriggers`\n- `adaptationFailureModes`",
|
|
200
|
+
"requireConfirmation": true
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "phase-3f-plan-hard-items",
|
|
204
|
+
"title": "Phase 3f: Plan Platform-Specific Conversions",
|
|
205
|
+
"runCondition": {
|
|
206
|
+
"or": [
|
|
207
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
208
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
"prompt": "For Bucket B and Bucket C items, plan the conversion before writing code.\n\nUse both `semanticContractInventory` and `targetIntegrationAnalysis` as required inputs. If `adaptationProfile` is `high`, also use `architectureAdaptationPlan` as a required input. The implementation plan must preserve boundary contracts and fit the target repo's actual seams.\n\nFor Bucket B (library substitution):\n- Map each source dependency to its target-platform equivalent\n- If no equivalent exists, flag it and propose an alternative\n\nFor Bucket C (platform-specific):\n- Threading/concurrency model mapping\n- UI framework mapping\n- DI framework mapping\n- State management mapping\n- Error handling mapping\n- Navigation patterns\n- Lifecycle management approach\n- Testing framework mapping\n- Target module/layer placement and adapter seams\n\nFor anything with no clean target equivalent, propose an idiomatic solution and explain the tradeoff.\n\nBucket A items don't need a plan. They're mechanical translation handled by subagents.\n\nCapture:\n- `idiomMapping`\n- `dependencyMapping`\n- `tradeoffs`",
|
|
83
212
|
"promptFragments": [
|
|
84
213
|
{
|
|
85
|
-
"id": "phase-
|
|
214
|
+
"id": "phase-3f-medium-focused",
|
|
86
215
|
"when": { "var": "conversionComplexity", "equals": "Medium" },
|
|
87
216
|
"text": "For Medium conversions, focus the plan on the items that actually need design decisions. Don't exhaustively map every dimension — only the ones relevant to the files in scope."
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "phase-3f-high-adaptation",
|
|
220
|
+
"when": { "var": "adaptationProfile", "equals": "high" },
|
|
221
|
+
"text": "For high-adaptation migrations, state clearly what is translated directly, what is adapted through seams or adapters, and what is intentionally redesigned."
|
|
88
222
|
}
|
|
89
223
|
],
|
|
90
224
|
"requireConfirmation": true
|
|
@@ -94,11 +228,40 @@
|
|
|
94
228
|
"title": "Phase 4: Delegate Bucket A (Parallel Subagents)",
|
|
95
229
|
"runCondition": {
|
|
96
230
|
"and": [
|
|
97
|
-
{
|
|
231
|
+
{
|
|
232
|
+
"or": [
|
|
233
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
234
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
235
|
+
]
|
|
236
|
+
},
|
|
98
237
|
{ "var": "bucketACounts", "not_equals": 0 }
|
|
99
238
|
]
|
|
100
239
|
},
|
|
101
|
-
"
|
|
240
|
+
"promptBlocks": {
|
|
241
|
+
"goal": "Delegate only safe mechanical conversion work from Bucket A while keeping all real judgment and synthesis with the main agent.",
|
|
242
|
+
"constraints": [
|
|
243
|
+
"Delegate only files that are not boundary-critical and do not require unresolved target integration analysis.",
|
|
244
|
+
"If `adaptationProfile` is `high`, delegate only clearly mechanical files with no boundary or integration ambiguity.",
|
|
245
|
+
"If a supposedly easy file affects a semantic boundary, a target-repo seam, or requires contract judgment, keep it with main-agent review."
|
|
246
|
+
],
|
|
247
|
+
"procedure": [
|
|
248
|
+
"If subagent delegation is not available in your environment, convert Bucket A files yourself sequentially instead.",
|
|
249
|
+
"For each batch in `bucketABatches`, delegate a bounded translation task using `sourcePlatform`, `targetPlatform`, `targetRepoPath`, and the specific files in that batch.",
|
|
250
|
+
"Instruct subagents to perform only platform-agnostic translation, follow target naming conventions, preserve the public API, and convert tests if they exist.",
|
|
251
|
+
"After all batches finish, spot-check the output, flag misclassified files, and move them back to the appropriate main-agent bucket.",
|
|
252
|
+
"Run build or typecheck on the Bucket A output before continuing."
|
|
253
|
+
],
|
|
254
|
+
"outputRequired": {
|
|
255
|
+
"bucketAComplete": "Whether Bucket A work is complete.",
|
|
256
|
+
"bucketABuildPassed": "Whether the delegated Bucket A output builds or typechecks cleanly.",
|
|
257
|
+
"reclassifiedFiles": "Any files that were delegated but need to return to main-agent handling."
|
|
258
|
+
},
|
|
259
|
+
"verify": [
|
|
260
|
+
"No ambiguous or boundary-critical files were delegated as mechanical work.",
|
|
261
|
+
"Delegated output was reviewed by the main agent before proceeding.",
|
|
262
|
+
"Misclassified files were re-routed instead of being silently accepted."
|
|
263
|
+
]
|
|
264
|
+
},
|
|
102
265
|
"requireConfirmation": false
|
|
103
266
|
},
|
|
104
267
|
{
|
|
@@ -106,8 +269,10 @@
|
|
|
106
269
|
"type": "loop",
|
|
107
270
|
"title": "Phase 5: Convert Bucket B & C (Main Agent)",
|
|
108
271
|
"runCondition": {
|
|
109
|
-
"
|
|
110
|
-
|
|
272
|
+
"or": [
|
|
273
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
274
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
275
|
+
]
|
|
111
276
|
},
|
|
112
277
|
"loop": {
|
|
113
278
|
"type": "forEach",
|
|
@@ -120,7 +285,45 @@
|
|
|
120
285
|
{
|
|
121
286
|
"id": "phase-5a-convert-batch",
|
|
122
287
|
"title": "Convert Current Batch",
|
|
123
|
-
"
|
|
288
|
+
"promptBlocks": {
|
|
289
|
+
"goal": "Convert the current Bucket B or C batch using the approved plan, contract inventory, and target-integration analysis.",
|
|
290
|
+
"constraints": [
|
|
291
|
+
"Follow target platform conventions.",
|
|
292
|
+
"Preserve public API contracts where possible.",
|
|
293
|
+
"Fit the target repo's actual architectural seams.",
|
|
294
|
+
"Add TODO comments for anything uncertain.",
|
|
295
|
+
"Convert tests alongside production code when source tests exist."
|
|
296
|
+
],
|
|
297
|
+
"procedure": [
|
|
298
|
+
"Convert `{{currentBatch.name}}` using the dependency mapping and idiom mapping from Phase 3f.",
|
|
299
|
+
"For any touched boundary, consult both `semanticContractInventory` and `targetIntegrationAnalysis`.",
|
|
300
|
+
"If `adaptationProfile` is `high`, also follow `architectureAdaptationPlan`.",
|
|
301
|
+
"If the chosen target construct, target seam, or reuse/adaptation decision changes, update the relevant artifact rows rather than letting implementation drift silently.",
|
|
302
|
+
"Also handle any `reclassifiedFiles` that returned from Bucket A delegation.",
|
|
303
|
+
"Run build or typecheck after this batch and fix failures before moving on."
|
|
304
|
+
],
|
|
305
|
+
"outputRequired": {
|
|
306
|
+
"batchFilesConverted": "The files converted in this batch.",
|
|
307
|
+
"batchBuildPassed": "Whether the batch builds or typechecks cleanly.",
|
|
308
|
+
"batchIssues": "Problems encountered while converting the batch.",
|
|
309
|
+
"bucketDriftDetected": "Whether the batch proved harder than its original bucket classification.",
|
|
310
|
+
"unexpectedDependency": "Whether the batch exposed a dependency missing from the prior plan.",
|
|
311
|
+
"buildBroke": "Whether build or typecheck failed after the batch.",
|
|
312
|
+
"contractDriftDetected": "Whether implementation forced a semantic-contract change.",
|
|
313
|
+
"contractRowsUpdated": "Whether semantic contract rows were revised.",
|
|
314
|
+
"contractUncertain": "Whether a touched boundary can no longer be mapped confidently.",
|
|
315
|
+
"integrationDriftDetected": "Whether implementation forced a change to target seam or reuse/adaptation choice.",
|
|
316
|
+
"integrationAnalysisUpdated": "Whether target integration rows were revised.",
|
|
317
|
+
"integrationUncertain": "Whether a touched boundary no longer has a confident target-repo fit.",
|
|
318
|
+
"architectureDriftDetected": "Whether high-adaptation implementation diverged from the architecture adaptation plan.",
|
|
319
|
+
"adaptationPlanUpdated": "Whether the architecture adaptation plan was revised for this batch."
|
|
320
|
+
},
|
|
321
|
+
"verify": [
|
|
322
|
+
"Any contract or integration drift is reflected explicitly in the tracked artifacts.",
|
|
323
|
+
"No touched boundary is left without a clear contract and target-fit status.",
|
|
324
|
+
"The batch is build-clean or the failure has been captured for immediate follow-up."
|
|
325
|
+
]
|
|
326
|
+
},
|
|
124
327
|
"requireConfirmation": false
|
|
125
328
|
},
|
|
126
329
|
{
|
|
@@ -130,13 +333,47 @@
|
|
|
130
333
|
"or": [
|
|
131
334
|
{ "var": "bucketDriftDetected", "equals": true },
|
|
132
335
|
{ "var": "unexpectedDependency", "equals": true },
|
|
133
|
-
{ "var": "buildBroke", "equals": true }
|
|
336
|
+
{ "var": "buildBroke", "equals": true },
|
|
337
|
+
{ "var": "contractDriftDetected", "equals": true },
|
|
338
|
+
{ "var": "contractUncertain", "equals": true },
|
|
339
|
+
{ "var": "integrationDriftDetected", "equals": true },
|
|
340
|
+
{ "var": "integrationUncertain", "equals": true },
|
|
341
|
+
{ "var": "architectureDriftDetected", "equals": true }
|
|
342
|
+
]
|
|
343
|
+
},
|
|
344
|
+
"promptBlocks": {
|
|
345
|
+
"goal": "Resolve unexpected batch drift before continuing so downstream work is not based on stale assumptions.",
|
|
346
|
+
"constraints": [
|
|
347
|
+
"Do not silently absorb drift.",
|
|
348
|
+
"If a boundary can no longer be mapped confidently, stop and surface it instead of guessing."
|
|
349
|
+
],
|
|
350
|
+
"procedure": [
|
|
351
|
+
"If `bucketDriftDetected`, update the idiom or dependency mapping from Phase 3f so later batches do not repeat the same surprise.",
|
|
352
|
+
"If `unexpectedDependency`, map it now and assess whether other batches also depend on it.",
|
|
353
|
+
"If `buildBroke`, determine whether the failure is local to this batch or cross-batch integration related, then fix it before continuing.",
|
|
354
|
+
"If `contractDriftDetected`, update `semanticContractInventory` to match the real implementation.",
|
|
355
|
+
"If `integrationDriftDetected`, update `targetIntegrationAnalysis` to match the actual target seam and reuse/adaptation choice.",
|
|
356
|
+
"If `architectureDriftDetected`, update `architectureAdaptationPlan` before continuing."
|
|
357
|
+
],
|
|
358
|
+
"outputRequired": {
|
|
359
|
+
"mappingUpdated": "Whether the implementation mapping was revised.",
|
|
360
|
+
"contractInventoryUpdated": "Whether the semantic contract inventory was revised.",
|
|
361
|
+
"targetIntegrationUpdated": "Whether the target integration analysis was revised.",
|
|
362
|
+
"adaptationPlanUpdated": "Whether the architecture adaptation plan was revised.",
|
|
363
|
+
"verificationPassed": "Whether the batch is safe to continue past."
|
|
364
|
+
},
|
|
365
|
+
"verify": [
|
|
366
|
+
"Any real drift is reflected in the planning artifacts.",
|
|
367
|
+
"Uncertainty is surfaced instead of hidden.",
|
|
368
|
+
"The next batch will not proceed from stale assumptions."
|
|
134
369
|
]
|
|
135
370
|
},
|
|
136
|
-
"prompt": "Something unexpected happened in this batch. Before moving on, check what went wrong.\n\nIf `bucketDriftDetected`: the file was harder than classified. Update the idiom or dependency mapping from Phase 3 so downstream batches don't hit the same surprise. Record what changed.\n\nIf `unexpectedDependency`: a dependency wasn't in the Phase 3 plan. Map it now and check whether other batches depend on the same thing.\n\nIf `buildBroke`: diagnose whether the failure is local to this batch or a cross-batch integration issue. Fix it before continuing.\n\nIf the drift is severe enough that the Phase 3 plan is unreliable, say so. Don't silently absorb complexity.\n\nCapture:\n- `mappingUpdated`\n- `verificationPassed`",
|
|
137
371
|
"requireConfirmation": {
|
|
138
|
-
"
|
|
139
|
-
|
|
372
|
+
"or": [
|
|
373
|
+
{ "var": "contractUncertain", "equals": true },
|
|
374
|
+
{ "var": "integrationUncertain", "equals": true },
|
|
375
|
+
{ "var": "architectureDriftDetected", "equals": true }
|
|
376
|
+
]
|
|
140
377
|
}
|
|
141
378
|
}
|
|
142
379
|
]
|
|
@@ -146,8 +383,10 @@
|
|
|
146
383
|
"type": "loop",
|
|
147
384
|
"title": "Phase 6: Final Verification",
|
|
148
385
|
"runCondition": {
|
|
149
|
-
"
|
|
150
|
-
|
|
386
|
+
"or": [
|
|
387
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
388
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
389
|
+
]
|
|
151
390
|
},
|
|
152
391
|
"loop": {
|
|
153
392
|
"type": "while",
|
|
@@ -162,7 +401,7 @@
|
|
|
162
401
|
{
|
|
163
402
|
"id": "phase-6a-full-build",
|
|
164
403
|
"title": "Full Build and Integration Check",
|
|
165
|
-
"prompt": "Run a full build or typecheck on the entire converted codebase — both subagent-converted and main-agent-converted code together.\n\nCheck for:\n- Build/compile errors from cross-batch integration issues\n- Inconsistencies between subagent output and main agent output (naming, patterns)\n- Non-idiomatic patterns that slipped through\n- Missing error handling at module boundaries\n- Threading or concurrency issues across modules\n- Broken public API contracts\n\nFix each issue. If a fix is a band-aid over a deeper mapping problem, go back and fix the mapping.\n\nCapture:\n- `fullBuildPassed`\n- `integrationIssues`\n- `issuesFixed`",
|
|
404
|
+
"prompt": "Run a full build or typecheck on the entire converted codebase — both subagent-converted and main-agent-converted code together.\n\nCheck for:\n- Build/compile errors from cross-batch integration issues\n- Inconsistencies between subagent output and main agent output (naming, patterns)\n- Non-idiomatic patterns that slipped through\n- Missing error handling at module boundaries\n- Threading or concurrency issues across modules\n- Broken public API contracts\n- Contract inventory drift: every row in `semanticContractInventory` is still accounted for, no `uncertain` rows remain, preserved contracts still look preserved, and intentional changes are still justified\n- Target integration drift: code landed in the intended target layer/module, reuse/adaptation decisions still fit the observed target seams, and no unresolved target integration uncertainties remain\n- High-adaptation architecture drift: if `adaptationProfile` is `high`, the final code still matches `architectureAdaptationPlan` and any deviations are explicit and justified\n\nFix each issue. If a fix is a band-aid over a deeper mapping problem, go back and fix the mapping.\n\nCapture:\n- `fullBuildPassed`\n- `integrationIssues`\n- `issuesFixed`",
|
|
166
405
|
"requireConfirmation": false
|
|
167
406
|
},
|
|
168
407
|
{
|
|
@@ -179,7 +418,7 @@
|
|
|
179
418
|
{
|
|
180
419
|
"id": "phase-7-handoff",
|
|
181
420
|
"title": "Phase 7: Handoff",
|
|
182
|
-
"prompt": "Summarize what was converted.\n\nInclude:\n- Source and target platforms\n- Total files converted\n- Build/typecheck status\n- Known gaps, TODOs, or limitations\n- What would need manual attention\n\nKeep it concise. The converted code is the deliverable.",
|
|
421
|
+
"prompt": "Summarize what was converted.\n\nInclude:\n- Source and target platforms\n- Total files converted\n- Build/typecheck status\n- Adaptation profile used\n- Known gaps, TODOs, or limitations\n- What would need manual attention\n\nKeep it concise. The converted code is the deliverable.",
|
|
183
422
|
"promptFragments": [
|
|
184
423
|
{
|
|
185
424
|
"id": "phase-7-small-summary",
|
|
@@ -188,8 +427,13 @@
|
|
|
188
427
|
},
|
|
189
428
|
{
|
|
190
429
|
"id": "phase-7-full-summary",
|
|
191
|
-
"when": {
|
|
192
|
-
|
|
430
|
+
"when": {
|
|
431
|
+
"or": [
|
|
432
|
+
{ "var": "conversionComplexity", "not_equals": "Small" },
|
|
433
|
+
{ "var": "adaptationProfile", "not_equals": "low" }
|
|
434
|
+
]
|
|
435
|
+
},
|
|
436
|
+
"text": "Also include: bucket breakdown (A/B/C counts), delegation results (how many files delegated, subagent quality, any reclassified), key idiom mapping decisions, dependency substitutions, notable preserved contracts, notable target integration decisions, any intentional semantic changes, the selected adaptation approach, any architecture adaptation choices, and any boundaries needing manual review."
|
|
193
437
|
}
|
|
194
438
|
],
|
|
195
439
|
"notesOptional": true,
|
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "coding-task-workflow-with-loops",
|
|
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
|
-
"**FUNCTION DEFINITIONS:** fun updateDecisionLog() = 'Update Decision Log in CONTEXT.md: file paths/ranges, excerpts, why important, outcome impact. Limit 3-5 files/decision.'",
|
|
15
|
-
"fun useTools() = 'Use tools to verify—never guess. Expand file reads to imports/models/interfaces/classes/deps. Trace all dependencies.'",
|
|
16
|
-
"fun createFile(filename) = 'Use edit_file to create/update {filename}. NEVER output full content in chat—only summarize. If fails, request user help & log command.'",
|
|
17
|
-
"fun applyUserRules() = 'Apply & reference user-defined rules, patterns & preferences. Document alignment in Decision Log. Explain rule influence in decisions.'",
|
|
18
|
-
"fun matchPatterns() = 'Use codebase_search/grep to find similar patterns. Reference Decision Log patterns. Match target area unless user rules override.'",
|
|
19
|
-
"fun addResumptionJson(phase) = 'Update CONTEXT.md with: 1) workflow_get (id: coding-task-workflow-with-loops, mode: preview), 2) workflow_next JSON with workflowId, completedSteps up to {phase}, all continue_workflow context keys.'",
|
|
20
|
-
"fun gitCommit(type, msg) = 'If git available: commit with {type}: {msg}. If unavailable: log in CONTEXT.md with timestamp.'",
|
|
21
|
-
"fun verifyImplementation() = '1) Test coverage >80%, 2) Run full test suite, 3) Self-review. Max 2 attempts before failure protocol.'",
|
|
22
|
-
"fun checkAutomation(action) = 'High: auto-{action} if confidence >8. Medium: request confirmation. Low: extra confirmations.'",
|
|
23
|
-
"fun trackProgress(completed, current) = '✅ Completed: {completed}, 🔄 Current: {current}, ⏳ Remaining phases, 📁 Files created.'",
|
|
24
|
-
"This workflow follows the ANALYZE -> CLARIFY -> PREP -> IMPLEMENT -> VERIFY pattern with bidirectional dynamic re-triage capabilities.",
|
|
25
|
-
"Deep codebase analysis occurs early to inform intelligent requirements clarification and all subsequent planning phases.",
|
|
26
|
-
"Dynamic re-triage allows complexity upgrades and safe downgrades based on new insights from analysis and clarifications.",
|
|
27
|
-
"Automation levels (Low/Medium/High) control confirmation requirements to balance autonomy with safety.",
|
|
28
|
-
"Failure bounds prevent resource waste: word limits (2000), step tracking (>20), and escalation protocols.",
|
|
29
|
-
"Context documentation is maintained throughout to enable seamless handoffs between chat sessions, with updates triggered by progress milestones, failures, or user interventions.",
|
|
30
|
-
"For specialized tasks (e.g., debugging), call sub-workflows via workflow_get tool when available.",
|
|
31
|
-
"Limit all documentation outputs to 2000 words max; use bullet points for scannability.",
|
|
32
|
-
"Output markdown content in response; use read_file/edit_file tools to create/update actual files if available, else request user upload.",
|
|
33
|
-
"Align with custom instructions: Use --quiet flags for commands; output to files; prefer workflows for debugging.",
|
|
34
|
-
"Human approval is required after the Devil's Advocate review and before final completion.",
|
|
35
|
-
"Each implementation step should be a small, logical, and committable chunk of work.",
|
|
36
|
-
"The agent should never guess or assume. Always ask for clarification or use tools to find missing information.",
|
|
37
|
-
"If you fail to get test results or other tool outputs on the first attempt, ask the user to run it manually.",
|
|
38
|
-
"Document all user interventions, change requests, and feedback immediately in context documentation to ensure continuity.",
|
|
39
|
-
"**Git Fallback:** If git unavailable/fails, skip commits/branches, log changes in CONTEXT.md with timestamps. Warn at phase-6. Document file mods for manual VC.",
|
|
40
|
-
"**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.",
|
|
41
|
-
"Persist variables across steps via context/external state/response metadata. Reset flags (e.g., proposedDowngrade) after confirmation.",
|
|
42
|
-
"Use safe git: feature branches, commit on success, clear messages, revert on fail. Log hashes in CONTEXT.md for traceability.",
|
|
43
|
-
"Maintain existing coding conventions and architectural patterns found in the codebase.",
|
|
44
|
-
"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.",
|
|
45
|
-
"When you see function calls like updateDecisionLog() or createFile(spec.md), refer to the function definitions above for full instructions.",
|
|
46
|
-
"For resumption: Include function definitions in CONTEXT.md so new sessions understand these references. Always provide explicit workflow_get and workflow_next instructions.",
|
|
47
|
-
"Auto-advance: after completing each step, immediately get the next step; only pause for explicit requireConfirmation or missing critical inputs."
|
|
48
|
-
],
|
|
49
|
-
"steps": [
|
|
50
|
-
{
|
|
51
|
-
"id": "phase-0-intelligent-triage",
|
|
52
|
-
"title": "Phase 0: Intelligent Task Triage & Complexity Analysis",
|
|
53
|
-
"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.",
|
|
54
|
-
"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.",
|
|
55
|
-
"guidance": [
|
|
56
|
-
"Be thorough in your analysis - this determines the entire workflow path",
|
|
57
|
-
"Consider both technical complexity and business risk",
|
|
58
|
-
"When in doubt, err on the side of more thorough analysis (higher complexity)",
|
|
59
|
-
"Always allow human override of your classification",
|
|
60
|
-
"Set these keys in the next `continue_workflow` call's `context` object that will be used for conditional step execution and automation",
|
|
61
|
-
"Automation levels: High=auto-approve confidence >8, Medium=standard, Low=extra confirmations"
|
|
62
|
-
],
|
|
63
|
-
"requireConfirmation": true
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"id": "phase-0b-user-rules-identification",
|
|
67
|
-
"title": "Phase 0b: Identify Relevant User Rules",
|
|
68
|
-
"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.**",
|
|
69
|
-
"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.",
|
|
70
|
-
"guidance": [
|
|
71
|
-
"This step runs for ALL complexity levels (Small, Medium, Large)",
|
|
72
|
-
"Be thorough but concise - capture the essence of each rule",
|
|
73
|
-
"If no explicit rules exist, note that and proceed with standard practices",
|
|
74
|
-
"These rules will be referenced throughout the workflow",
|
|
75
|
-
"Update this list if new rules are discovered during the workflow"
|
|
76
|
-
],
|
|
77
|
-
"requireConfirmation": false
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"id": "phase-0c-overview-gathering",
|
|
81
|
-
"runCondition": {
|
|
82
|
-
"or": [
|
|
83
|
-
{"var": "taskComplexity", "equals": "Large"},
|
|
84
|
-
{
|
|
85
|
-
"and": [
|
|
86
|
-
{"var": "taskComplexity", "equals": "Medium"},
|
|
87
|
-
{"var": "requestDeepAnalysis", "equals": true}
|
|
88
|
-
]
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
"title": "Phase 0c: High-Level Architecture Overview",
|
|
93
|
-
"prompt": "Before deep analysis, gather a high-level overview of the codebase architecture to guide subsequent focused explorations.\n\n**OVERVIEW TASKS:**\n1. **Project Structure:** Use `list_dir` to map the directory structure and identify key areas\n2. **Entry Points:** Use `grep_search` and `read_file` to locate and understand main entry points (e.g., main.ts, index.js, app.js)\n3. **Configuration:** Read package.json, tsconfig.json, or similar files to understand dependencies and setup\n4. **Key Patterns:** Use `grep_search` to identify architectural patterns (e.g., dependency injection, MVC, microservices)\n5. **Task Relevance:** Note which modules/areas seem most relevant to the current task\n\n**OUTPUT REQUIREMENTS:**\n- Summarize the overall architecture in 500 words or less\n- Identify 3-5 key areas that warrant deeper investigation for this task\n- Note any discovered patterns that align with or conflict with user rules\n- Set `architectureOverview` context variable with your findings\n\n**Start the Decision Log:** createFile(CONTEXT.md) and updateDecisionLog() with top 3-5 files, why important, how they'll guide analysis.\n\n**Remember:** useTools() for every architectural insight.",
|
|
94
|
-
"agentRole": "You are an architectural scout mapping the codebase landscape. Your role is to quickly identify the project's structure, key patterns, and areas relevant to the task at hand. You excel at using tools efficiently to build a mental map that will guide deeper exploration.",
|
|
95
|
-
"guidance": [
|
|
96
|
-
"This step provides context for more focused deep dives",
|
|
97
|
-
"Use tools liberally but efficiently - broad strokes first",
|
|
98
|
-
"The overview should inform where to focus in subsequent analysis",
|
|
99
|
-
"Start the Decision Log that will be maintained throughout the workflow",
|
|
100
|
-
"Note alignment/conflicts with user rules from the start"
|
|
101
|
-
],
|
|
102
|
-
"requireConfirmation": false
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"id": "phase-small-prep",
|
|
106
|
-
"runCondition": {"var": "taskComplexity", "equals": "Small"},
|
|
107
|
-
"title": "Phase Small: Preparation and Simplified Execution",
|
|
108
|
-
"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.",
|
|
109
|
-
"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.",
|
|
110
|
-
"guidance": [
|
|
111
|
-
"This is a mini-version of PREP->IMPLEMENT->VERIFY for Small tasks",
|
|
112
|
-
"Use available tools to verify basic assumptions quickly",
|
|
113
|
-
"Escape to phase-2b re-triage if complexities are discovered",
|
|
114
|
-
"Keep the plan simple but actionable",
|
|
115
|
-
"Better to escalate than to proceed with insufficient preparation"
|
|
116
|
-
],
|
|
117
|
-
"requireConfirmation": false
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
"id": "phase-small-implement",
|
|
121
|
-
"runCondition": {"var": "taskComplexity", "equals": "Small"},
|
|
122
|
-
"title": "Phase Small: Simple Implementation",
|
|
123
|
-
"prompt": "Execute the simple plan you created in the preparation phase.\n\n**IMPLEMENTATION:**\n1. Review user rules from Phase 0b\n2. Work through your 2-5 step plan\n3. applyUserRules() in all changes\n4. Write basic tests as needed\n5. Verify each change works\n\n**GUIDELINES:**\n- matchPatterns() from codebase\n- Keep changes focused and minimal\n- If complexity emerges, recommend upgrade to Medium/Large\n- gitCommit(type, message) after success\n\n**VERIFICATION:**\n- Run relevant tests\n- Quick self-review\n- Ensure objectives met\n- Confirm applyUserRules()\n\nThis is streamlined for genuinely simple tasks.",
|
|
124
|
-
"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.",
|
|
125
|
-
"guidance": [
|
|
126
|
-
"Execute the plan from phase-small-prep",
|
|
127
|
-
"Keep implementation lightweight but correct",
|
|
128
|
-
"Escalate if complexity exceeds Small task scope",
|
|
129
|
-
"Single commit at the end for all changes"
|
|
130
|
-
],
|
|
131
|
-
"requireConfirmation": false
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "phase-1-multi-analysis",
|
|
135
|
-
"type": "loop",
|
|
136
|
-
"title": "Phase 1: Multi-Step Focused Codebase Analysis",
|
|
137
|
-
"runCondition": {
|
|
138
|
-
"or": [
|
|
139
|
-
{"var": "taskComplexity", "equals": "Large"},
|
|
140
|
-
{
|
|
141
|
-
"and": [
|
|
142
|
-
{"var": "taskComplexity", "equals": "Medium"},
|
|
143
|
-
{"var": "requestDeepAnalysis", "equals": true}
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
]
|
|
147
|
-
},
|
|
148
|
-
"loop": {
|
|
149
|
-
"type": "for",
|
|
150
|
-
"count": 4,
|
|
151
|
-
"maxIterations": 4,
|
|
152
|
-
"iterationVar": "analysisStep"
|
|
153
|
-
},
|
|
154
|
-
"body": [
|
|
155
|
-
{
|
|
156
|
-
"id": "phase-1-step-structure",
|
|
157
|
-
"title": "Analysis Step 1/4: Structure",
|
|
158
|
-
"prompt": "**STEP 1: STRUCTURAL MAPPING**\\n\\nBuild on phase-0c overview, dive deeper into structure:\\n\\n1. Module organization (packages/services)\\n2. Core components (controllers/services/models)\\n3. Architectural patterns from overview\\n4. File naming conventions\\n5. Code organization\\n\\n**Actions:** useTools() with list_dir, grep_search (class/interface/export), read 2-3 files\\n\\n**Output (400 words):**\\n- Structure summary\\n- User rules alignment\\n- Areas for next steps\\n\\nupdateDecisionLog() with 3-5 key files",
|
|
159
|
-
"agentRole": "You are conducting focused analysis step 1 of 4. Your expertise lies in understanding code structure and organization. Use tools extensively and never make assumptions.",
|
|
160
|
-
"guidance": [
|
|
161
|
-
"This is step 1 of a 4-step analysis process",
|
|
162
|
-
"Each step builds on the previous findings",
|
|
163
|
-
"Use tools liberally - verify everything",
|
|
164
|
-
"Update the Decision Log with key discoveries",
|
|
165
|
-
"Respect word limits to prevent context bloat",
|
|
166
|
-
"Note alignment/conflicts with user rules"
|
|
167
|
-
],
|
|
168
|
-
"runCondition": {"var": "analysisStep", "equals": 1},
|
|
169
|
-
"requireConfirmation": false
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
"id": "phase-1-step-modules",
|
|
173
|
-
"title": "Analysis Step 2/4: Modules",
|
|
174
|
-
"prompt": "**STEP 2: TASK-RELEVANT MODULES**\\n\\nFocus on task-specific modules:\\n\\n1. Target areas from mapping\\n2. Core business logic\\n3. Data models (interfaces/types/schemas)\\n4. API contracts\\n5. Pattern implementation\\n\\n**Actions:** useTools() and matchPatterns() with codebase_search, read complete files (with imports), trace flows\\n\\n**Output (400 words):**\\n- Module responsibilities\\n- Patterns to match\\n- Integration points\\n\\nupdateDecisionLog() with core logic files",
|
|
175
|
-
"agentRole": "You are conducting focused analysis step 2 of 4. Your expertise lies in identifying and analyzing task-specific components. Use tools extensively and never make assumptions.",
|
|
176
|
-
"guidance": [
|
|
177
|
-
"This is step 2 of a 4-step analysis process",
|
|
178
|
-
"Each step builds on the previous findings",
|
|
179
|
-
"Use tools liberally - verify everything",
|
|
180
|
-
"Update the Decision Log with key discoveries",
|
|
181
|
-
"Respect word limits to prevent context bloat",
|
|
182
|
-
"Note alignment/conflicts with user rules"
|
|
183
|
-
],
|
|
184
|
-
"runCondition": {"var": "analysisStep", "equals": 2},
|
|
185
|
-
"requireConfirmation": false
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"id": "phase-1-step-dependencies",
|
|
189
|
-
"title": "Analysis Step 3/4: Dependencies",
|
|
190
|
-
"prompt": "**STEP 3: DEPENDENCIES & FLOWS**\\n\\nTrace dependencies and execution:\\n\\n1. Import mapping\\n2. Data flow tracing\\n3. Integration points\\n4. Side effects\\n5. Testing patterns\\n\\n**Actions:** useTools() to follow imports, find test files, trace error handling\\n\\n**Output (400 words):**\\n- Dependency map\\n- Integration challenges\\n- Testing strategies\\n- Risk indicators\\n\\nupdateDecisionLog() with dependencies and test approaches",
|
|
191
|
-
"agentRole": "You are conducting focused analysis step 3 of 4. Your expertise lies in tracing dependencies and system flows. Use tools extensively and never make assumptions.",
|
|
192
|
-
"guidance": [
|
|
193
|
-
"This is step 3 of a 4-step analysis process",
|
|
194
|
-
"Each step builds on the previous findings",
|
|
195
|
-
"Use tools liberally - verify everything",
|
|
196
|
-
"Update the Decision Log with key discoveries",
|
|
197
|
-
"Respect word limits to prevent context bloat",
|
|
198
|
-
"Note alignment/conflicts with user rules"
|
|
199
|
-
],
|
|
200
|
-
"runCondition": {"var": "analysisStep", "equals": 3},
|
|
201
|
-
"requireConfirmation": false
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
"id": "phase-1-step-patterns",
|
|
205
|
-
"title": "Analysis Step 4/4: Patterns",
|
|
206
|
-
"prompt": "**STEP 4: PATTERN DISCOVERY**\\n\\nIdentify established patterns relevant to the task type. Analyze if this is a pattern-heavy task (tests, telemetry, logging, APIs, UI components).\\n\\n**Actions:** useTools() extensively - codebase_search for concepts, grep_search for pattern markers, read_file for full examples\\n\\n**Output (400 words):**\\n- Pattern types discovered\\n- Reference implementations (with file paths)\\n- Key conventions to follow\\n- Pattern alignment recommendations\\n\\nupdateDecisionLog() with pattern templates and reference files",
|
|
207
|
-
"agentRole": "You are conducting focused analysis step 4 of 4. Your expertise lies in discovering and documenting established implementation patterns for the specific task type. Use tools extensively and never make assumptions.",
|
|
208
|
-
"guidance": [
|
|
209
|
-
"This is step 4 of a 4-step analysis process",
|
|
210
|
-
"Each step builds on the previous findings",
|
|
211
|
-
"Use tools liberally - verify everything",
|
|
212
|
-
"Update the Decision Log with key discoveries",
|
|
213
|
-
"Respect word limits to prevent context bloat",
|
|
214
|
-
"Note alignment/conflicts with user rules",
|
|
215
|
-
"TASK TYPE ANALYSIS: Determine if this is adding tests (find test utilities, mocking patterns), telemetry/analytics (find tracking implementations, event schemas), logging/monitoring (find log formats, monitoring integrations), API endpoints (find route patterns, validation, error handling), UI components (find component patterns, styling conventions), or other pattern-heavy work",
|
|
216
|
-
"PATTERN SEARCH STRATEGY: Use codebase_search with queries like 'How is [telemetry|testing|logging|API] implemented?'. Use grep_search for pattern markers (e.g., track, analytics, test, describe, log). Find 3-5 reference implementations similar to your task. Look for shared utilities, helpers, or base classes. Check for pattern documentation in README or docs",
|
|
217
|
-
"PATTERN EXTRACTION: Document file structure and naming conventions, common imports and dependencies, implementation approach (functional vs class-based), error handling patterns, configuration patterns, and testing approach for this type of feature",
|
|
218
|
-
"PATTERN VALIDATION: List discovered patterns with file references. Note any conflicting patterns or multiple approaches. Ask user: 'Found these pattern examples: [list files]. Should I follow these patterns, or are there other preferred examples?' Set establishedPatterns context variable",
|
|
219
|
-
"FOCUS ON REUSABILITY: Patterns help avoid reinventing the wheel. Look especially for utility functions, base classes, shared components, or established conventions that should be followed"
|
|
220
|
-
],
|
|
221
|
-
"runCondition": {"var": "analysisStep", "equals": 4},
|
|
222
|
-
"requireConfirmation": false
|
|
223
|
-
}
|
|
224
|
-
],
|
|
225
|
-
"requireConfirmation": false
|
|
226
|
-
},
|
|
227
|
-
{
|
|
228
|
-
"id": "phase-2-informed-clarification",
|
|
229
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
230
|
-
"title": "Phase 2: Informed Requirements Clarification",
|
|
231
|
-
"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.**",
|
|
232
|
-
"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.",
|
|
233
|
-
"guidance": [
|
|
234
|
-
"This step is automatically skipped for Small tasks based on complexity classification",
|
|
235
|
-
"Ask questions that could only be formulated after understanding the codebase",
|
|
236
|
-
"Focus on questions that will significantly impact the specification and implementation approach",
|
|
237
|
-
"Avoid generic questions - make them specific to the codebase and task at hand",
|
|
238
|
-
"Present questions in a clear, prioritized manner",
|
|
239
|
-
"Include questions about potential complexity changes based on your analysis"
|
|
240
|
-
],
|
|
241
|
-
"requireConfirmation": {
|
|
242
|
-
"or": [
|
|
243
|
-
{"var": "automationLevel", "equals": "Low"},
|
|
244
|
-
{"var": "automationLevel", "equals": "Medium"}
|
|
245
|
-
]
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
"id": "phase-2b-dynamic-retriage",
|
|
250
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
251
|
-
"title": "Phase 2b: Dynamic Complexity Re-Triage",
|
|
252
|
-
"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.",
|
|
253
|
-
"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.",
|
|
254
|
-
"guidance": [
|
|
255
|
-
"This step allows both upgrading and downgrading complexity based on new insights",
|
|
256
|
-
"Only change complexity if there are clear, justifiable reasons",
|
|
257
|
-
"For downgrades, set proposedDowngrade flag and require explicit user approval unless automationLevel=High and confidence >8",
|
|
258
|
-
"Be specific about what new information led to the reassessment",
|
|
259
|
-
"If changing complexity, the workflow will continue with the new complexity path",
|
|
260
|
-
"Downgrades must be justified with evidence of reduced risk/scope",
|
|
261
|
-
"Reset proposedDowngrade to false after user confirmation or rejection"
|
|
262
|
-
],
|
|
263
|
-
"requireConfirmation": {
|
|
264
|
-
"or": [
|
|
265
|
-
{"var": "automationLevel", "equals": "Low"},
|
|
266
|
-
{"var": "automationLevel", "equals": "Medium"},
|
|
267
|
-
{"var": "proposedDowngrade", "equals": true}
|
|
268
|
-
]
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
"id": "phase-3-specification",
|
|
273
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
274
|
-
"title": "Phase 3: Create Specification",
|
|
275
|
-
"prompt": "Create a precise specification from Phase 1 analysis, Phase 2 clarifications, and any re-triage insights.\n\n**Spec Sections:**\n- Task Description [from clarifications]\n- Key Objectives & Success Criteria\n- Scope and Constraints\n\n**Must Include:**\n- Existing patterns/conventions from analysis\n- System integration approach\n- Impact on components/workflows\n- Testing/quality alignment\n- Phase 2 decisions\n- Complexity insights\n- applyUserRules()\n- matchPatterns()\n\n**Actions:**\n- createFile(spec.md)\n- updateDecisionLog()\n- Sanity check complexity level",
|
|
276
|
-
"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.",
|
|
277
|
-
"guidance": [
|
|
278
|
-
"Provide a complete task description based on all previous analysis and clarifications",
|
|
279
|
-
"The output of this step should be the content for `spec.md`",
|
|
280
|
-
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
281
|
-
"Leverage your codebase analysis and clarifications to ensure the specification is precise and implementable",
|
|
282
|
-
"Reference specific decisions made during the clarification phase",
|
|
283
|
-
"Consider any complexity changes from the re-triage phase"
|
|
284
|
-
],
|
|
285
|
-
"requireConfirmation": false
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"id": "phase-3b-create-context-doc",
|
|
289
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
290
|
-
"title": "Phase 3b: Create Context Documentation",
|
|
291
|
-
"prompt": "Create CONTEXT.md capturing workflow progress. High automation: 1000 words; else 2000.\n\n**Include Sections:**\n\n1. ORIGINAL TASK CONTEXT\n- Task description, complexity level, re-triage decisions, automation level\n\n2. USER RULES AND PREFERENCES\n- Rules from Phase 0b, task impact, new discoveries\n\n3. CODEBASE ANALYSIS SUMMARY\n- Patterns, components, testing, dependencies, complexity indicators\n\n4. DECISION LOG\n- Phase 0c: Files/patterns/impact\n- Phase 1: Key files per sub-step\n- Phase 2: Clarification decisions\n- Phase 3: Spec influences\n\n5. CLARIFICATIONS AND DECISIONS\n- Q&A, resolved ambiguities, scope, technical approach\n\n6. SPECIFICATION SUMMARY\n- Objectives, constraints, design principles, integration\n\n7. WORKFLOW PROGRESS\n- trackProgress(0-3b, Phase 4)\n- ⏳ Remaining: 4-7\n- 📋 Context vars set\n\n8. RESUMPTION INSTRUCTIONS\n**How to Resume:**\n1. Call workflow_get with id: \"coding-task-workflow-with-loops\", mode: \"preview\"\n2. Call workflow_next with the JSON from addResumptionJson(phase-3b)\n3. Include function definitions from metaGuidance for reference\n\n9. HANDOFF INSTRUCTIONS\n- Files to attach: spec.md, CONTEXT.md\n- Key files from Decision Log\n- Critical decisions\n\ncreateFile(CONTEXT.md)",
|
|
292
|
-
"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.",
|
|
293
|
-
"guidance": [
|
|
294
|
-
"This step is automatically skipped for Small tasks",
|
|
295
|
-
"Create a document that would allow a completely new agent to pick up the work seamlessly",
|
|
296
|
-
"Include specific file paths, component names, and technical details discovered",
|
|
297
|
-
"Reference all key decisions made in previous phases",
|
|
298
|
-
"Make the progress tracking section very clear for workflow continuation",
|
|
299
|
-
"Consider this document as critical as the specification itself",
|
|
300
|
-
"Use bullet points for scannability; limit to word count based on automation level"
|
|
301
|
-
],
|
|
302
|
-
"requireConfirmation": false
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
"id": "phase-4-architectural-design",
|
|
306
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
307
|
-
"title": "Phase 4: Architectural Design",
|
|
308
|
-
"prompt": "Create architectural design from spec.md, analysis, and requirements.\n\n**Design Sections:**\n1. High-Level Approach (builds on patterns)\n2. Component Breakdown (new/modified)\n3. Data Models (schemas/structures)\n4. API Contracts (follow conventions)\n5. Key Interactions (components diagram)\n6. Integration Points\n7. Phase 2 Decisions Impact\n8. Complexity Factors\n9. Pattern Alignment (cite files)\n10. applyUserRules()\n\n**Actions:**\n- matchPatterns()\n- useTools()\n- createFile(design.md)\n- updateDecisionLog()",
|
|
309
|
-
"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.",
|
|
310
|
-
"guidance": [
|
|
311
|
-
"The `design.md` should be detailed enough for an engineer to write an implementation plan from it.",
|
|
312
|
-
"This step is automatically skipped for Small tasks.",
|
|
313
|
-
"Ensure the design builds upon and aligns with the existing codebase architecture identified in your analysis",
|
|
314
|
-
"Reference specific clarification decisions that influenced the design",
|
|
315
|
-
"Consider complexity factors identified during re-triage"
|
|
316
|
-
],
|
|
317
|
-
"requireConfirmation": false
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
"id": "phase-5-planning",
|
|
321
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
322
|
-
"title": "Phase 5: Create Detailed Implementation Plan",
|
|
323
|
-
"prompt": "Create detailed implementation_plan.md from spec.md, design.md, analysis.\n\n**Plan Sections:**\n1. Goal Clarification - understanding from spec/clarifications\n2. applyUserRules() - how plan follows user patterns\n3. Pattern Matching Strategy - existing code templates per step\n4. Impact Assessment - affected parts, deps, risks\n5. Implementation Strategy - discrete steps with rationale/I/O\n6. Testing Strategy - follow existing patterns (cite files)\n7. Failure Handling - test fails, tool issues\n8. Final Review Checklist - completion criteria\n\n**Actions:**\n- matchPatterns() for each step\n- useTools() to find examples\n- createFile(implementation_plan.md)\n- updateDecisionLog()",
|
|
324
|
-
"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.",
|
|
325
|
-
"guidance": [
|
|
326
|
-
"The agent will now proceed to critique its own plan in the next step. Withhold your final approval until after that critique.",
|
|
327
|
-
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
328
|
-
"Leverage your codebase analysis and clarified requirements to ensure the plan works within existing architectural constraints",
|
|
329
|
-
"Reference how clarified requirements influenced the planning decisions",
|
|
330
|
-
"Include explicit failure handling protocols and quantitative metrics where applicable"
|
|
331
|
-
],
|
|
332
|
-
"requireConfirmation": false
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
"id": "phase-5b-devil-advocate-review",
|
|
336
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
337
|
-
"title": "Phase 5b: Devil's Advocate Plan Review",
|
|
338
|
-
"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.",
|
|
339
|
-
"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.",
|
|
340
|
-
"guidance": [
|
|
341
|
-
"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.",
|
|
342
|
-
"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.",
|
|
343
|
-
"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.",
|
|
344
|
-
"This step is automatically skipped for Small tasks based on the complexity classification",
|
|
345
|
-
"CRITICAL: Set confidenceScore variable (1-10) in your response",
|
|
346
|
-
"For automationLevel=High with confidenceScore >8, auto-approve if no critical risks identified"
|
|
347
|
-
],
|
|
348
|
-
"requireConfirmation": {
|
|
349
|
-
"or": [
|
|
350
|
-
{"var": "automationLevel", "equals": "Low"},
|
|
351
|
-
{"var": "automationLevel", "equals": "Medium"},
|
|
352
|
-
{"and": [
|
|
353
|
-
{"var": "automationLevel", "equals": "High"},
|
|
354
|
-
{"var": "confidenceScore", "lt": 8}
|
|
355
|
-
]}
|
|
356
|
-
]
|
|
357
|
-
}
|
|
358
|
-
},
|
|
359
|
-
{
|
|
360
|
-
"id": "phase-5c-finalize-plan",
|
|
361
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
362
|
-
"title": "Phase 5c: Finalize Implementation Plan",
|
|
363
|
-
"prompt": "Review initial `implementation_plan.md` from Phase 5 and Devil's Advocate critique from Phase 5b. Create final, consolidated plan incorporating valid feedback.\n\n**Output:**\n- Final implementation_plan.md\n- List valuable but out-of-scope suggestions as future tickets\n\ncreateFile(implementation_plan.md) with final version.",
|
|
364
|
-
"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.",
|
|
365
|
-
"guidance": [
|
|
366
|
-
"This is the final plan that will be executed. Ensure it is clear, actionable, and reflects the best path forward.",
|
|
367
|
-
"The list of out-of-scope items helps capture valuable ideas without derailing the current task."
|
|
368
|
-
],
|
|
369
|
-
"requireConfirmation": {
|
|
370
|
-
"or": [
|
|
371
|
-
{"var": "automationLevel", "equals": "Low"},
|
|
372
|
-
{"var": "automationLevel", "equals": "Medium"}
|
|
373
|
-
]
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
"id": "phase-5d-plan-sanity-check",
|
|
378
|
-
"runCondition": { "var": "taskComplexity", "not_equals": "Small" },
|
|
379
|
-
"title": "Phase 5d: Plan Sanity Check",
|
|
380
|
-
"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.",
|
|
381
|
-
"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.",
|
|
382
|
-
"guidance": [
|
|
383
|
-
"This is a quick verification step, not a full re-analysis. The goal is to catch glaring errors before implementation begins.",
|
|
384
|
-
"Use your code-browsing tools (grep_search, list_dir) to validate the plan's assumptions.",
|
|
385
|
-
"If tools fail, fall back to alternatives like file_search or request manual verification",
|
|
386
|
-
"If a check fails, it's crucial to pause and get human confirmation before proceeding with a potentially flawed plan."
|
|
387
|
-
],
|
|
388
|
-
"requireConfirmation": false
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
"id": "phase-5e-update-context-doc",
|
|
392
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
393
|
-
"title": "Phase 5e: Update Context Documentation with Final Plans",
|
|
394
|
-
"prompt": "Update CONTEXT.md with Phases 4-5 work. checkAutomation(summary): 500 words for High, else full.\n\n**Add/Update Sections:**\n\n4. DECISION LOG (EXPANDED)\n- Phase 4 Design: Files/patterns shaping architecture\n- Phase 5 Planning: Code examples for implementation\n- Pattern Matches: Template files\n\n5. ARCHITECTURAL DESIGN SUMMARY\n- Approach & rationale\n- Components added/modified\n- Integration points\n- Design decisions\n- Pattern alignment\n\n6. IMPLEMENTATION PLAN OVERVIEW\n- Goals & success criteria\n- Strategy overview\n- Risks & mitigation\n- Testing approach\n- Failure handling\n\n7. DEVILS ADVOCATE INSIGHTS\n- Concerns addressed\n- Plan improvements\n- Confidence score\n- Out-of-scope items\n\n8. WORKFLOW PROGRESS\n- trackProgress(0-5e, Implementation)\n- ⏳ Remaining: 6, 7\n- 📁 Files: spec/design/plan/CONTEXT.md\n\n9. RESUMPTION INSTRUCTIONS\n**How to Resume:**\n1. Call workflow_get with id: \"coding-task-workflow-with-loops\", mode: \"preview\"\n2. Call workflow_next with the JSON from addResumptionJson(phase-5e)\n3. Include function definitions from metaGuidance for reference\n\n10. IMPLEMENTATION READINESS\n- Sanity check results\n- Verified files/deps\n- Key files to re-read\n\ncreateFile(CONTEXT.md) with bullets for scannability.",
|
|
395
|
-
"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.",
|
|
396
|
-
"guidance": [
|
|
397
|
-
"This step is automatically skipped for Small tasks",
|
|
398
|
-
"Maintain the scannable structure while adding substantial new planning context",
|
|
399
|
-
"Ensure all critical planning decisions are captured for potential handoffs",
|
|
400
|
-
"Update progress tracking to reflect the current state accurately",
|
|
401
|
-
"Consider this update as crucial as the original context document creation",
|
|
402
|
-
"Limit output based on automation level; use bullet points for readability",
|
|
403
|
-
"After updating CONTEXT.md, commit the planning completion: 'docs(planning): finalize implementation plan and context' (auto-commit for High automation, suggest for Medium/Low)"
|
|
404
|
-
],
|
|
405
|
-
"requireConfirmation": false
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
"id": "phase-6-count-steps",
|
|
409
|
-
"title": "Phase 6 Preparation: Count Implementation Steps",
|
|
410
|
-
"prompt": "Before starting the implementation loop, count the discrete implementation steps in the approved `implementation_plan.md`.\n\n**Your task:**\n1. Read the implementation_plan.md\n2. Count each discrete, actionable step from the Implementation Strategy section\n3. Set `totalImplementationSteps` to the count (e.g., 8)\n\n**What counts as a step:**\n- Each bullet point or numbered item that represents a concrete implementation task\n- Each item that would result in a code change or file creation\n- Each item that could be a logical git commit\n\n**Example:**\nIf the plan has:\n- Create user model\n- Add authentication service\n- Implement validation\n- Write tests\n\nThen set `totalImplementationSteps` = 4\n\n**IMPORTANT:** Only count, don't extract or store the steps. You'll read them directly from the plan during implementation.",
|
|
411
|
-
"agentRole": "You are preparing the implementation phase by counting the steps to enable progress tracking.",
|
|
412
|
-
"guidance": [
|
|
413
|
-
"Count only actionable implementation steps",
|
|
414
|
-
"Don't include meta-tasks like 'review' or 'document'",
|
|
415
|
-
"This enables progress tracking without bloating context"
|
|
416
|
-
],
|
|
417
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
418
|
-
"requireConfirmation": false
|
|
419
|
-
},
|
|
420
|
-
{
|
|
421
|
-
"id": "phase-6-iterative-implementation",
|
|
422
|
-
"type": "loop",
|
|
423
|
-
"title": "Phase 6: Iterative Implementation Loop (PREP -> IMPLEMENT -> VERIFY)",
|
|
424
|
-
"runCondition": {"var": "taskComplexity", "not_equals": "Small"},
|
|
425
|
-
"loop": {
|
|
426
|
-
"type": "for",
|
|
427
|
-
"count": "totalImplementationSteps",
|
|
428
|
-
"indexVar": "currentStepNumber",
|
|
429
|
-
"maxIterations": 25
|
|
430
|
-
},
|
|
431
|
-
"body": [
|
|
432
|
-
{
|
|
433
|
-
"id": "phase-6-prep",
|
|
434
|
-
"title": "PREP: Prepare for Step {{currentStepNumber + 1}}",
|
|
435
|
-
"prompt": "**PREPARATION PHASE for Step {{currentStepNumber + 1}}/{{totalImplementationSteps}}**\n\nBefore implementing this step, you must first PREPARE:\n\n1. **Read implementation_plan.md** and locate step #{{currentStepNumber + 1}}\n2. **Extract step details**: Note the title, description, and expected outputs\n3. **Confirm prerequisites**: Verify the previous step (if any) was completed correctly\n4. **Validate current state**: Ensure the plan for this step is still valid in the current codebase\n5. **List requirements**: Identify all required inputs, files, or dependencies\n\n**BRANCH SETUP (first iteration only):** If this is the first implementation step ({{currentStepNumber}} === 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.**",
|
|
436
|
-
"agentRole": "You are preparing to implement a specific step from the plan. Be meticulous in verifying all prerequisites are met before proceeding.",
|
|
437
|
-
"guidance": [
|
|
438
|
-
"This is step {{currentStepNumber + 1}} of {{totalImplementationSteps}} total implementation steps",
|
|
439
|
-
"Read the step directly from implementation_plan.md",
|
|
440
|
-
"Focus only on preparation - implementation comes next",
|
|
441
|
-
"If this is the first step, handle git branch setup"
|
|
442
|
-
],
|
|
443
|
-
"requireConfirmation": false
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
"id": "phase-6-implement",
|
|
447
|
-
"title": "IMPLEMENT: Execute Step {{currentStepNumber + 1}}",
|
|
448
|
-
"prompt": "**IMPLEMENTATION PHASE for Step {{currentStepNumber + 1}}/{{totalImplementationSteps}}**\n\nNow implement the step you just prepared for:\n\n**Instructions:**\n1. Re-read step #{{currentStepNumber + 1}} from implementation_plan.md\n2. Focus only on this single step\n3. useTools() to make code changes\n4. Follow quality standards\n5. Adapt to unexpected discoveries\n6. createFile() for ALL code changes\n\n**Remember:** applyUserRules() and matchPatterns() throughout.\n\n**Progress Tracking:**\n- This is step {{currentStepNumber + 1}} of {{totalImplementationSteps}}\n- If we've done > 20 steps total, pause for user intervention\n\n**CONTEXT UPDATES:** If this is every 3rd step ({{currentStepNumber + 1}} % 3 === 0):\n- Update CONTEXT.md\n- addResumptionJson(phase-6-implement)\n- updateDecisionLog()\n- List files modified with line ranges\n\n",
|
|
449
|
-
"agentRole": "You are implementing a specific step from the approved plan. Focus on precise execution while maintaining code quality.",
|
|
450
|
-
"guidance": [
|
|
451
|
-
"Implement only what this step requires",
|
|
452
|
-
"Track progress for potential intervention",
|
|
453
|
-
"Update context documentation every 3 steps"
|
|
454
|
-
],
|
|
455
|
-
"requireConfirmation": false
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
"id": "phase-6-verify",
|
|
459
|
-
"title": "VERIFY: Validate Step {{currentStepNumber + 1}}",
|
|
460
|
-
"prompt": "**VERIFICATION PHASE for Step {{currentStepNumber + 1}}/{{totalImplementationSteps}}**\n\nVerify the implementation is complete and correct:\n\n**Required:** verifyImplementation()\n\n**COMMIT Decision (if all passes):**\n- checkAutomation(commit)\n- gitCommit(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\n3. updateDecisionLog() with failure details\n4. Present summary and recommendations\n5. Set 'verificationFailed' context variable to true\n\n",
|
|
461
|
-
"agentRole": "You are verifying the implementation meets all quality standards. Be thorough but respect failure bounds.",
|
|
462
|
-
"guidance": [
|
|
463
|
-
"All three verification steps must pass",
|
|
464
|
-
"Track failure attempts (max 2)",
|
|
465
|
-
"Commit only after successful verification",
|
|
466
|
-
"Update context on failures"
|
|
467
|
-
],
|
|
468
|
-
"runCondition": { "var": "verificationFailed", "not_equals": true },
|
|
469
|
-
"requireConfirmation": false
|
|
470
|
-
}
|
|
471
|
-
],
|
|
472
|
-
"requireConfirmation": false
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
"id": "phase-6b-refinement-check",
|
|
476
|
-
"title": "Phase 6b: Agile Refinement Check",
|
|
477
|
-
"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.",
|
|
478
|
-
"agentRole": "Agile refinement checker",
|
|
479
|
-
"runCondition": {"var": "implementationInProgress", "equals": true},
|
|
480
|
-
"requireConfirmation": true
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
"id": "phase-6c-update-spec",
|
|
484
|
-
"title": "Phase 6c: Update Specification",
|
|
485
|
-
"prompt": "Based on implementation insights, update spec.md with necessary changes. Justify updates and get user confirmation.",
|
|
486
|
-
"agentRole": "Specification updater",
|
|
487
|
-
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
488
|
-
"requireConfirmation": true
|
|
489
|
-
},
|
|
490
|
-
{
|
|
491
|
-
"id": "phase-6d-update-design",
|
|
492
|
-
"title": "Phase 6d: Update Design",
|
|
493
|
-
"prompt": "Update design.md based on new insights. Maintain alignment with codebase.",
|
|
494
|
-
"agentRole": "Design updater",
|
|
495
|
-
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
496
|
-
"requireConfirmation": true
|
|
497
|
-
},
|
|
498
|
-
{
|
|
499
|
-
"id": "phase-6e-update-plan",
|
|
500
|
-
"title": "Phase 6e: Update Implementation Plan",
|
|
501
|
-
"prompt": "Revise implementation_plan.md incorporating refinements. Reset 'needsRefinement' to false after updates.",
|
|
502
|
-
"agentRole": "Plan updater",
|
|
503
|
-
"runCondition": {"var": "needsRefinement", "equals": true},
|
|
504
|
-
"requireConfirmation": true
|
|
505
|
-
},
|
|
506
|
-
{
|
|
507
|
-
"id": "phase-7-final-review",
|
|
508
|
-
"title": "Phase 7: Final Review & Completion",
|
|
509
|
-
"prompt": "Perform final review against **'Final Review Checklist'** from `implementation_plan.md`.\n\n**Validate:** applyUserRules() compliance throughout. For each checklist item, provide confirmation and evidence.\n\n**Additional validation:**\n- User rules/preferences compliance\n- Architectural patterns match specs\n- Naming conventions and code style\n- Library/framework usage\n- matchPatterns() verification\n\n**Final commit:**\n- gitCommit(feat|fix|refactor, final implementation - summary)\n- Include metrics in body\n- checkAutomation(commit)\n\n**Branch cleanup (if git):**\n1. Merge: git checkout main && git merge --squash [featureBranch]\n2. Delete: git branch -d [featureBranch]\n3. checkAutomation(merge) with confidence >8\n4. Pause for conflicts\n5. Log in CONTEXT.md if no git\n\n**Update CONTEXT.md final sections:**\n\n## 9. COMPLETE DECISION LOG\nFull updateDecisionLog() with all files, patterns, user rules, design decisions\n\n## 10. FINAL STATUS\n- trackProgress(ALL, Complete)\n- ✅ Tests passing (metrics)\n- ✅ Checklist validated\n- ✅ applyUserRules() verified\n- 📁 Files modified (line ranges)\n- 📋 Known issues\n- 📜 Git history\n\n## 11. FINAL RESUMPTION\n**How to Resume (if needed for extensions):**\n1. Call workflow_get with id: \"coding-task-workflow-with-loops\", mode: \"preview\"\n2. Call workflow_next with the JSON from addResumptionJson(phase-7-final-review)\n**Note:** Task complete. This is for future extensions or follow-up work.\n\n## 12. HANDOFF\n- Accomplishments with file refs\n- Architecture decisions\n- Patterns established/followed\n- Follow-up recommendations\n\ncreateFile(CONTEXT.md) with final content.",
|
|
510
|
-
"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.",
|
|
511
|
-
"guidance": [
|
|
512
|
-
"This is the final quality check. Ensure the agent's summary and checklist validation align with your understanding of the completed work.",
|
|
513
|
-
"The final CONTEXT.md update should serve as a complete project archive",
|
|
514
|
-
"Include specific details that would help future developers understand and maintain the work",
|
|
515
|
-
"Ensure all promised deliverables have been completed and documented",
|
|
516
|
-
"Include quantitative metrics and validation results in the final status"
|
|
517
|
-
],
|
|
518
|
-
"requireConfirmation": true
|
|
519
|
-
}
|
|
520
|
-
]
|
|
521
|
-
}
|