@exaudeus/workrail 0.8.5 → 0.8.6
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.
|
@@ -283,21 +283,41 @@ function createEnhancedMultiSourceWorkflowStorage(overrides = {}) {
|
|
|
283
283
|
const cacheBaseDir = process.env['WORKRAIL_CACHE_DIR'] ||
|
|
284
284
|
path_1.default.join(os_1.default.homedir(), '.workrail', 'cache');
|
|
285
285
|
logger.debug('Using cache directory', { cacheBaseDir });
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
286
|
+
const urls = gitReposJson.split(',').map(url => url.trim());
|
|
287
|
+
const localFileUrls = [];
|
|
288
|
+
const actualGitUrls = [];
|
|
289
|
+
for (const url of urls) {
|
|
290
|
+
if (url.startsWith('file://') || (!url.includes('://') && url.startsWith('/'))) {
|
|
291
|
+
localFileUrls.push(url);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
actualGitUrls.push(url);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (localFileUrls.length > 0) {
|
|
298
|
+
config.customPaths = config.customPaths || [];
|
|
299
|
+
for (const url of localFileUrls) {
|
|
300
|
+
const localPath = url.startsWith('file://') ? url.substring(7) : url;
|
|
301
|
+
config.customPaths.push(localPath);
|
|
302
|
+
logger.info('Using direct file access for local repository', { localPath });
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (actualGitUrls.length > 0) {
|
|
306
|
+
config.gitRepositories = actualGitUrls.map((url, index) => {
|
|
307
|
+
const repoName = url.split('/').pop()?.replace(/\.git$/, '') || `repo-${index}`;
|
|
308
|
+
return {
|
|
309
|
+
repositoryUrl: url,
|
|
310
|
+
branch: 'main',
|
|
311
|
+
localPath: path_1.default.join(cacheBaseDir, `git-${index}-${repoName}`),
|
|
312
|
+
authToken: resolveAuthToken(url),
|
|
313
|
+
syncInterval: 60
|
|
314
|
+
};
|
|
315
|
+
});
|
|
316
|
+
logger.info('Parsed remote Git repositories from comma-separated list', {
|
|
317
|
+
count: config.gitRepositories.length,
|
|
318
|
+
repos: config.gitRepositories.map(r => ({ url: r.repositoryUrl, branch: r.branch, path: r.localPath }))
|
|
319
|
+
});
|
|
320
|
+
}
|
|
301
321
|
}
|
|
302
322
|
const gitRepoUrl = process.env['WORKFLOW_GIT_REPO_URL'];
|
|
303
323
|
if (gitRepoUrl) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "bug-investigation",
|
|
3
|
-
"name": "Bug Investigation (Agentic)",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
2
|
+
"id": "bug-investigation-agentic",
|
|
3
|
+
"name": "Bug Investigation (Adaptive - Agentic)",
|
|
4
|
+
"version": "3.0.0",
|
|
5
|
+
"description": "Adaptive bug investigation workflow that adjusts rigor based on complexity assessed after Phase 0. Automatically chooses between QUICK (minimal delegation), STANDARD (sequential delegation), or THOROUGH (parallel delegation) modes.",
|
|
6
6
|
"clarificationPrompts": [
|
|
7
7
|
"What type of system is this? (web app, backend service, CLI tool, etc.)",
|
|
8
8
|
"How reproducible is this bug? (always, sometimes, rarely)",
|
|
@@ -20,14 +20,13 @@
|
|
|
20
20
|
"WHY THIS WORKFLOW EXISTS: It gives you a systematic process to avoid the traps that catch other investigators - jumping to conclusions, confirmation bias, surface-level analysis.",
|
|
21
21
|
"HOW IT WORKS: Each phase has two steps: First you PLAN your approach (think strategically), then you EXECUTE it (do the work).",
|
|
22
22
|
"This planning step is critical - it forces you to think about HOW you'll investigate before diving in. Better plans lead to better investigations.",
|
|
23
|
+
"DELEGATION: This workflow will explicitly tell you when to delegate to the WorkRail Executor. Do NOT delegate spontaneously - ONLY when the workflow says 'Delegate to the WorkRail Executor'. If the workflow doesn't mention delegation, do the work yourself.",
|
|
23
24
|
"THE PHASES:",
|
|
24
|
-
"Phase 0:
|
|
25
|
-
"Phase 1:
|
|
26
|
-
"Phase 2:
|
|
27
|
-
"Phase 3:
|
|
28
|
-
"Phase 4:
|
|
29
|
-
"Phase 5: Validate your conclusion rigorously (be your harshest critic)",
|
|
30
|
-
"Phase 6: Document your findings so others can understand and fix it (prove your case)",
|
|
25
|
+
"Phase 0: Investigate and understand the code (both structure and execution flow)",
|
|
26
|
+
"Phase 1: Form multiple hypotheses about what could be causing this (stay open-minded)",
|
|
27
|
+
"Phase 2: Design and add instrumentation to gather evidence (set up your surveillance)",
|
|
28
|
+
"Phase 3: Run instrumented code and collect evidence (gather proof, not assumptions)",
|
|
29
|
+
"Phase 4: Validate your conclusion rigorously and hand off (be your harshest critic)",
|
|
31
30
|
"CRITICAL DISTINCTION - THEORY VS PROOF:",
|
|
32
31
|
"When you read code and think 'I found it!', you have a THEORY. Theories feel certain but are often wrong.",
|
|
33
32
|
"PROOF comes from running instrumented code, collecting evidence, ruling out alternatives, and validating rigorously.",
|
|
@@ -38,75 +37,176 @@
|
|
|
38
37
|
],
|
|
39
38
|
"steps": [
|
|
40
39
|
{
|
|
41
|
-
"id": "phase-
|
|
42
|
-
"title": "Phase
|
|
43
|
-
"prompt": "**
|
|
44
|
-
"agentRole": "You are
|
|
45
|
-
"requireConfirmation": false
|
|
40
|
+
"id": "phase-0a-plan",
|
|
41
|
+
"title": "Phase 0A: Plan Your Investigation Strategy",
|
|
42
|
+
"prompt": "**PLAN HOW YOU'LL INVESTIGATE THIS BUG**\n\nBefore diving in, think strategically about HOW you'll investigate.\n\n**Understand the Problem:**\n- What's the bug? (symptoms, reproduction steps)\n- Where does execution start? (API call, user action, test, scheduled job?)\n- What's the error or unexpected behavior?\n\n**Plan Your Investigation:**\n\n1. **Context Gathering Strategy:**\n - What parts of the codebase are relevant?\n - What components/systems are involved?\n - How will you identify the key areas to investigate?\n\n2. **Execution Tracing Strategy:**\n - Will you trace from entry point to error?\n - Or start at the error and work backwards?\n - What's the execution path you need to understand?\n\n3. **Risk Mitigation:**\n - What could cause you to miss the real issue?\n - Focusing too narrowly? Missing indirect causes?\n - Assuming things work as documented?\n\n**OUTPUT**: Create BUG_investigation.md with \"Investigation Plan\":\n- Problem summary\n- Investigation strategy (context + execution)\n- Key questions to answer\n- Risks to watch out for\n\n**Self-Check**: Is your plan specific enough to follow? Does it account for ways you might miss the real cause?",
|
|
43
|
+
"agentRole": "You are a strategic investigator planning your approach. Think before you dive in.",
|
|
44
|
+
"requireConfirmation": false,
|
|
45
|
+
"guidance": [
|
|
46
|
+
"STRATEGY: Plan both context gathering AND execution tracing",
|
|
47
|
+
"SCOPE: Identify relevant parts of codebase",
|
|
48
|
+
"RISKS: Identify ways you might miss the real cause",
|
|
49
|
+
"OUTPUT: Create BUG_investigation.md with your plan"
|
|
50
|
+
]
|
|
46
51
|
},
|
|
47
52
|
{
|
|
48
|
-
"id": "phase-
|
|
49
|
-
"title": "Phase
|
|
50
|
-
"prompt": "**
|
|
51
|
-
"agentRole": "You are
|
|
52
|
-
"requireConfirmation": false
|
|
53
|
+
"id": "phase-0b-execute",
|
|
54
|
+
"title": "Phase 0B: Execute Investigation (Context + Execution)",
|
|
55
|
+
"prompt": "**INVESTIGATE THE CODE - UNDERSTAND STRUCTURE AND EXECUTION**\n\nNow execute your investigation plan. You need to understand BOTH what code exists AND what it does.\n\n**STEP 1: GATHER CONTEXT (What code exists)**\n\nDO NOT DELEGATE - Do this investigation yourself. Use systematic techniques to understand the codebase structure.\n\n**Prepare your Work Package:**\n```\nMISSION: Understand how [feature/system from bug report] works in this codebase\n\nTARGET: [Extract from bug report]\n- Bug: \"Login fails with 401\" \u2192 Target: \"authentication system\"\n- Bug: \"Export crashes\" \u2192 Target: \"data export functionality\"\n\nCONTEXT:\n- Bug Description: [Paste the bug description]\n- Reproduction Steps: [How to trigger the bug]\n- Symptoms: [What you observe]\n\nDEPTH: 2 (Explore - balance breadth and detail)\n\nDELIVERABLE: Working notes for BUG_investigation.md\n- Component map (what exists, how it's organized)\n- Key files and their purposes\n- Architecture patterns observed\n```\n\n**Execute the routine:**\n```\nUse the tools directly (list_dir, codebase_search, grep, read_file) at depth=2 (Explore level).\n\nWork Package: [Paste the work package from above]\n```\n\n**STEP 2: TRACE EXECUTION (What code does)**\n\nNow trace the execution flow from entry point to error.\n\n**Trace the execution:**\n- Where does execution begin? (entry point)\n- Follow the call chain step-by-step (with file:line)\n- Track how data flows and transforms\n- Note state changes along the way\n- Identify suspicious points\n\n**STEP 3: DOCUMENT EVERYTHING**\n\nUpdate BUG_investigation.md with complete investigation:\n\n```markdown\n# Bug Investigation\n\n## Problem Summary\n[Bug description, reproduction steps, symptoms]\n\n## Codebase Context\n### Component Map\n[What code exists, how it's organized]\n\n### Key Files\n- [file:line] - [purpose]\n\n### Architecture Patterns\n[Patterns observed]\n\n## Execution Flow\n### Entry Point\n[Where execution begins]\n\n### Call Chain\n1. [file:line] - [what happens]\n2. [file:line] - [what happens]\n...\n\n### Data Flow\n[How data transforms]\n\n### State Changes\n[What gets modified]\n\n### Suspicious Points\n[Code that could be problematic]\n\n## Gaps & Uncertainties\n[What we don't understand yet]\n```\n\n**Self-Critique**:\n- Did you understand both structure AND execution?\n- Did you actually trace the execution flow, or just read code?\n- What surprised you?\n- What are you still uncertain about?\n\n**Before Proceeding**: Can you explain how this code works (both structure and execution) to someone else?",
|
|
56
|
+
"agentRole": "You are executing your investigation plan systematically. Document both structure and execution.",
|
|
57
|
+
"requireConfirmation": false,
|
|
58
|
+
"guidance": [
|
|
59
|
+
"DO NOT DELEGATE: Execute investigation yourself, don't delegate to subagent",
|
|
60
|
+
"TECHNIQUES: Use Context Gathering Routine techniques (list_dir, codebase_search, grep, read_file)",
|
|
61
|
+
"TRACING: Manually trace execution flow from entry to error",
|
|
62
|
+
"DOCUMENTATION: Create BUG_investigation.md with BOTH structure and execution",
|
|
63
|
+
"CITATIONS: Include file:line references for everything",
|
|
64
|
+
"DISCIPLINE: Follow your plan, don't jump to conclusions"
|
|
65
|
+
]
|
|
53
66
|
},
|
|
54
67
|
{
|
|
55
|
-
"id": "phase-
|
|
56
|
-
"title": "Phase
|
|
57
|
-
"prompt": "**
|
|
58
|
-
"agentRole": "You are
|
|
59
|
-
"requireConfirmation": false
|
|
68
|
+
"id": "phase-0c-assess",
|
|
69
|
+
"title": "Phase 0C: Assess Complexity & Choose Mode",
|
|
70
|
+
"prompt": "**ASSESS INVESTIGATION COMPLEXITY & CHOOSE MODE**\n\nBased on your Phase 0 investigation, assess the complexity and choose the appropriate mode.\n\n**COMPLEXITY ASSESSMENT:**\n\nReview your BUG_investigation.md:\n\n1. **Scope:** Components involved [count], Systems interacting [count]\n2. **Execution:** Call chain depth [steps], Execution paths [count]\n3. **Understanding:** Suspicious points [count], Gaps [count], Confidence [1-10]\n4. **Risk:** Production system? Critical bug? Multiple causes? Unclear path?\n\n**MODE DECISION CRITERIA:**\n\n**THOROUGH** (Use if ANY true):\n- 5+ components OR 10+ step call chain OR 5+ suspicious points\n- Confidence < 7/10 OR Many gaps\n- Production + Critical bug OR Multiple possible causes\n\n**QUICK** (Use if ALL true):\n- 1-2 components AND < 5 step call chain AND 1-2 suspicious points\n- Few gaps AND Confidence 8+/10\n- Non-critical bug AND Clear single cause\n\n**STANDARD** (Otherwise): Middle ground between QUICK and THOROUGH\n\n**MAKE YOUR DECISION:**\n\nChoose: **QUICK**, **STANDARD**, or **THOROUGH**\n\nDocument in BUG_investigation.md:\n```markdown\n## Mode Decision: [QUICK/STANDARD/THOROUGH]\n**Rationale:** [Your reasoning based on criteria above]\n```\n\n**What Each Mode Means:**\n\n- **QUICK**: You'll form hypotheses yourself, minimal delegation, move fast\n- **STANDARD**: You'll form hypotheses, then get sequential challenge/validation\n- **THOROUGH**: You'll use parallel ideation + parallel challenge + parallel validation\n\n**Remember your choice** for later phases!",
|
|
71
|
+
"agentRole": "You are assessing complexity to choose the right level of rigor.",
|
|
72
|
+
"requireConfirmation": false,
|
|
73
|
+
"guidance": [
|
|
74
|
+
"HONEST ASSESSMENT: Don't underestimate complexity",
|
|
75
|
+
"USE CRITERIA: Follow the decision rules, don't just pick your favorite",
|
|
76
|
+
"DOCUMENT: Write your decision and rationale clearly",
|
|
77
|
+
"REMEMBER: You'll adapt your approach in later phases"
|
|
78
|
+
]
|
|
60
79
|
},
|
|
61
80
|
{
|
|
62
|
-
"id": "phase-
|
|
63
|
-
"title": "Phase
|
|
64
|
-
"prompt": "**
|
|
81
|
+
"id": "phase-0d-audit",
|
|
82
|
+
"title": "Phase 0D: Audit Investigation (Optional - THOROUGH mode)",
|
|
83
|
+
"prompt": "**AUDIT YOUR INVESTIGATION** (THOROUGH mode only)\n\n\u26a0\ufe0f **MODE CHECK**: Did you choose THOROUGH mode in Phase 0C?\n- If YES: Continue with this audit\n- If NO (STANDARD or QUICK): Skip this step, proceed to Phase 1\n\n**AUDIT YOUR INVESTIGATION FOR COMPLETENESS AND DEPTH**\n\nYou've investigated the code. Now get independent review.\n\n**PARALLEL CONTEXT AUDIT**\n\n\u26a0\ufe0f **CRITICAL: Delegate to the WorkRail Executor TWICE SIMULTANEOUSLY, not sequentially.**\n\nDelegate to the WorkRail Executor TWICE AT THE SAME TIME with different focuses:\n\n**Delegation (Completeness Focus):**\n```\nPlease execute the 'Context Gathering Routine' workflow in audit mode.\n\nAudit Request:\nMISSION: Audit my investigation for COMPLETENESS\n\nMY INVESTIGATION:\n[Paste the contents of BUG_investigation.md]\n\nFOCUS: Completeness\n- Did I miss any critical files or areas?\n- Are there important components I didn't investigate?\n- Did I trace the complete execution path?\n- What else should I have looked at?\n```\n\n**Delegation (Depth Focus):**\n```\nPlease execute the 'Context Gathering Routine' workflow in audit mode.\n\nAudit Request:\nMISSION: Audit my investigation for DEPTH\n\nMY INVESTIGATION:\n[Paste the contents of BUG_investigation.md]\n\nFOCUS: Depth\n- Did I go deep enough in my understanding?\n- Did I understand WHY, not just WHAT?\n- Should I have read implementations instead of just signatures?\n- What areas need deeper investigation?\n```\n\n**SYNTHESIZE AUDIT FEEDBACK**\n\nReview both audit deliverables:\n1. Completeness audit: What did I miss?\n2. Depth audit: Where should I go deeper?\n\n**Synthesis Strategy:**\n- Common concerns: If both flag same area \u2192 High priority\n- Unique insights: Each may catch different gaps\n- Conflicting advice: Investigate to understand why\n\n**ITERATE IF NEEDED**\n\nBased on feedback, investigate further if significant gaps:\n- Run Context Gathering Routine again (depth=3 or different target)\n- Trace additional execution paths\n- Read implementations you skipped\n\n**FINALIZE INVESTIGATION**\n\nUpdate BUG_investigation.md with:\n- Audit findings synthesized\n- Additional investigation completed\n- Final understanding of structure and execution\n\n**Before Proceeding**: Did both auditors confirm your understanding is sufficient?",
|
|
84
|
+
"agentRole": "You are getting independent review of your investigation to ensure completeness and depth.",
|
|
85
|
+
"requireConfirmation": false,
|
|
86
|
+
"guidance": [
|
|
87
|
+
"MODE: Only do this if you chose THOROUGH mode in Phase 0C",
|
|
88
|
+
"PARALLEL: Delegate twice to WorkRail Executor SIMULTANEOUSLY",
|
|
89
|
+
"DIVERSITY: Each has different focus (completeness vs depth)",
|
|
90
|
+
"SYNTHESIS: Combine both perspectives",
|
|
91
|
+
"ITERATE: Investigate further if significant gaps found",
|
|
92
|
+
"QUALITY GATE: Don't proceed until both perspectives satisfied"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "phase-1a-plan",
|
|
97
|
+
"title": "Phase 1A: Plan Your Hypothesis Development",
|
|
98
|
+
"prompt": "**CRITICAL CHECKPOINT: IS THIS ACTUALLY A BUG?**\n\nBefore forming hypotheses about what's wrong, investigate the original intent.\n\n**Investigate Original Intent:**\n\n1. **Check git history:**\n - Use git log/blame on relevant files\n - Look for commit messages explaining this behavior\n - When was this code written? By whom?\n\n2. **Search for documentation:**\n - Comments explaining the behavior\n - README or design docs\n - ADRs (Architecture Decision Records)\n - Issue/ticket history\n\n3. **Examine tests:**\n - What behavior do tests validate?\n - Do tests expect this behavior?\n - Are there tests that would fail if you \"fixed\" this?\n\n4. **Consider constraints:**\n - What requirements might explain this?\n - What technical constraints could justify this?\n - What trade-offs might have been made?\n\n**CRITICAL QUESTION**: Could this be working as designed, not a bug?\n\n---\n\n**PLAN HOW YOU'LL FORM HYPOTHESES**\n\nBased on your investigation, you'll now develop hypotheses about what's causing the bug.\n\n**Think Through**:\n\n1. **What patterns did you notice?**\n - From your execution flow tracing, what stood out?\n - What code seemed suspicious?\n - What assumptions are baked into the code?\n\n2. **What types of causes should you consider?**\n - Logic errors in the code?\n - Data issues (wrong format, corruption, missing)?\n - Timing or race conditions?\n - Environment or configuration issues?\n - Integration problems with dependencies?\n - **Working as designed** (not actually a bug)?\n\n3. **How will you avoid anchoring on your first idea?**\n - How many alternative hypotheses will you generate?\n - How will you challenge your initial impressions?\n - What evidence would contradict your leading theory?\n\n4. **What makes a good hypothesis?**\n - Specific enough to test\n - Explains all the symptoms\n - Has clear evidence for/against\n - Can be proven or disproven\n\n**OUTPUT**: Update BUG_investigation.md with \"Phase 2 Hypothesis Strategy\":\n- Results of your intent investigation\n- How you'll generate multiple hypotheses\n- What types of causes you'll consider (including \"not a bug\")\n- How you'll avoid confirmation bias\n- How you'll test your hypotheses\n\n**Self-Check**: Are you committed to generating multiple hypotheses, or are you already attached to one idea? Have you seriously considered that this might not be a bug?",
|
|
65
99
|
"agentRole": "You are strategizing about hypothesis formation. Commit to staying open-minded.",
|
|
66
|
-
"requireConfirmation": false
|
|
100
|
+
"requireConfirmation": false,
|
|
101
|
+
"guidance": [
|
|
102
|
+
"INTENT: Check git history, comments, tests, docs for original intent",
|
|
103
|
+
"QUESTION: Could this be working as designed?",
|
|
104
|
+
"MINDSET: Commit to generating multiple hypotheses, not just one",
|
|
105
|
+
"DIVERSITY: Consider different types of causes (including 'not a bug')",
|
|
106
|
+
"BIAS: Plan how you'll avoid anchoring on your first idea",
|
|
107
|
+
"OUTPUT: Document intent investigation and hypothesis strategy"
|
|
108
|
+
]
|
|
67
109
|
},
|
|
68
110
|
{
|
|
69
|
-
"id": "phase-
|
|
70
|
-
"title": "Phase
|
|
71
|
-
"prompt": "**FORM MULTIPLE HYPOTHESES ABOUT THE BUG**\n\
|
|
111
|
+
"id": "phase-1b-execute",
|
|
112
|
+
"title": "Phase 1B: Form Hypotheses (Mode-Adaptive)",
|
|
113
|
+
"prompt": "**FORM HYPOTHESES BASED ON YOUR CHOSEN MODE**\n\n\u26a0\ufe0f **CHECK YOUR MODE** (from Phase 0C): QUICK, STANDARD, or THOROUGH?\n\n---\n\n**IF YOU CHOSE THOROUGH MODE:**\n\n**FORM MULTIPLE HYPOTHESES ABOUT THE BUG**\n\nYou've completed your investigation and traced execution flow. Now generate hypotheses about what's causing the bug.\n\n**PARALLEL IDEATION - DIVERGENT THINKING**\n\n\u26a0\ufe0f **CRITICAL: Delegate to the WorkRail Executor THREE TIMES SIMULTANEOUSLY, not sequentially.**\n\nInstead of forming hypotheses yourself, delegate to the WorkRail Executor THREE TIMES SIMULTANEOUSLY with different perspectives:\n\n**Delegation - Logic Errors Perspective:**\n```\nPlease execute the 'Ideation Routine' workflow.\n\nIdeation Request:\nPROBLEM: What is causing this bug?\n\nCONSTRAINTS:\n- Must explain all observed symptoms\n- Must be testable with instrumentation\n- Must be specific (file:line level)\n\nCONTEXT:\nRead these files:\n- BUG_investigation.md (codebase context)\n- BUG_investigation.md (execution trace)\n\nPERSPECTIVE: Logic Errors\nFocus on: Wrong conditions, off-by-one errors, incorrect operators, \nmissing checks, wrong order of operations, flawed algorithms\n\nQUANTITY: 5-7 hypotheses\n\nDELIVERABLE: BUG_hypotheses_logic.md\n```\n\n**Delegation - Data/State Perspective:**\n```\nPlease execute the 'Ideation Routine' workflow.\n\nIdeation Request:\nPROBLEM: What is causing this bug?\n\nCONSTRAINTS:\n- Must explain all observed symptoms\n- Must be testable with instrumentation\n- Must be specific (file:line level)\n\nCONTEXT:\nRead these files:\n- BUG_investigation.md (codebase context)\n- BUG_investigation.md (execution trace)\n\nPERSPECTIVE: Data/State Issues\nFocus on: Data corruption, wrong state management, race conditions,\nuninitialized variables, type mismatches, mutation issues\n\nQUANTITY: 5-7 hypotheses\n\nDELIVERABLE: BUG_hypotheses_data.md\n```\n\n**Delegation - Integration/Environment Perspective:**\n```\nPlease execute the 'Ideation Routine' workflow.\n\nIdeation Request:\nPROBLEM: What is causing this bug?\n\nCONSTRAINTS:\n- Must explain all observed symptoms\n- Must be testable with instrumentation\n- Must be specific (file:line level)\n\nCONTEXT:\nRead these files:\n- BUG_investigation.md (codebase context)\n- BUG_investigation.md (execution trace)\n\nPERSPECTIVE: Integration/Environment\nFocus on: Dependency issues, config problems, environment differences,\nAPI contract violations, timing issues, resource constraints\n\nQUANTITY: 5-7 hypotheses\n\nDELIVERABLE: BUG_hypotheses_integration.md\n```\n\n**SYNTHESIZE ALL HYPOTHESES**\n\nReview all three deliverables (15-21 hypotheses total):\n1. Logic errors perspective\n2. Data/state perspective \n3. Integration/environment perspective\n\n**Synthesis Process:**\n1. **Deduplicate**: Combine similar hypotheses from different perspectives\n2. **Refine**: Improve clarity and specificity\n3. **Rank**: Order by likelihood based on evidence\n4. **Select**: Pick top 5-7 most promising hypotheses\n\n**Create BUG_hypotheses.md** with:\n- Synthesized hypothesis list (5-7 hypotheses)\n- Each hypothesis using this template:\n - **ID**: H1, H2, H3, etc.\n - **Statement**: \"The bug occurs because [specific cause]\"\n - **Source**: Which perspective(s) generated this\n - **Evidence For**: What from investigation supports this\n - **Evidence Against**: What contradicts this\n - **How to Test**: What evidence would prove/disprove this\n - **Likelihood** (1-10): Based on current evidence\n\n**PARALLEL ADVERSARIAL CHALLENGE**\n\n\u26a0\ufe0f **CRITICAL: Spawn BOTH challengers SIMULTANEOUSLY.**\n\nAfter synthesizing hypotheses, delegate to TWO Hypothesis Challengers AT THE SAME TIME:\n\n**Delegation - Moderate Rigor (rigor=3):**\n```\nPlease execute the 'Hypothesis Challenge Routine' workflow at rigor=3.\n\nChallenge Request:\nHYPOTHESES: [Paste your 5-7 synthesized hypotheses from BUG_hypotheses.md]\n\nEVIDENCE:\nRead these files:\n- BUG_investigation.md\n- BUG_investigation.md\n\nRIGOR: 3 (Thorough adversarial analysis)\n\nChallenge each hypothesis and find weaknesses.\n\nDELIVERABLE: BUG_challenges_moderate.md\n```\n\n**Delegation - Maximum Rigor (rigor=5):**\n```\nPlease execute the 'Hypothesis Challenge Routine' workflow at rigor=5.\n\nChallenge Request:\nLEADING HYPOTHESIS: [Your most likely hypothesis from BUG_hypotheses.md]\n\nEVIDENCE:\nRead these files:\n- BUG_investigation.md\n- BUG_investigation.md\n\nRIGOR: 5 (Try to completely break this)\n\nTry to prove this hypothesis is WRONG. Find any way it could fail.\n\nDELIVERABLE: BUG_challenges_maximum.md\n```\n\n**FINAL SYNTHESIS**\n\nReview both challenge deliverables:\n- If Challenger 1 finds issues: Strengthen or revise hypotheses\n- If Challenger 2 breaks leading hypothesis: Reconsider alternatives\n- If both give green light: High confidence in your hypotheses\n\n**Update BUG_hypotheses.md** with:\n- Challenge results and findings\n- Revised hypotheses (if needed)\n- Updated likelihood scores\n- Final ranking for testing\n\n**\ud83d\udea8 CRITICAL - YOU ARE NOT DONE:**\n\nYou now have theories. You do NOT have proof.\n\nEven if H1 has 10/10 likelihood, it's based on reading code, not evidence from running code.\n\nYou MUST continue to Phase 2 (design instrumentation) and Phase 2 (collect evidence).\n\nThis is not optional. High confidence without evidence = educated guess, not diagnosis.\n\nCall workflow_next to continue.\n\n---\n\n**IF YOU CHOSE STANDARD MODE:**\n\nSkip the parallel ideation. Instead:\n\n1. **Form 5-7 hypotheses yourself** using the investigation\n2. **Delegate to ONE Hypothesis Challenger** (rigor=3):\n ```\n Please execute the 'Hypothesis Challenge Routine' workflow at rigor=3.\n \n Challenge Request:\n HYPOTHESES: [Your 5-7 hypotheses]\n EVIDENCE: Read BUG_investigation.md\n RIGOR: 3\n \n Challenge each hypothesis.\n ```\n3. **Refine** based on challenge feedback\n\n---\n\n**IF YOU CHOSE QUICK MODE:**\n\nSkip all delegation. Instead:\n\n1. **Form 3-5 hypotheses yourself** quickly\n2. **Self-challenge**: What could I be wrong about?\n3. **Rank** by likelihood\n4. **Move on** - don't over-analyze\n\n---\n\n**OUTPUT:** BUG_hypotheses.md (format based on your mode)",
|
|
72
114
|
"agentRole": "You are forming competing hypotheses and subjecting them to rigorous challenge. Stay open to alternatives even if one seems obvious.",
|
|
73
|
-
"requireConfirmation": false
|
|
115
|
+
"requireConfirmation": false,
|
|
116
|
+
"guidance": [
|
|
117
|
+
"MODE: Adapt your approach based on your Phase 0C decision",
|
|
118
|
+
"PARALLEL IDEATION: Delegate 3 times to WorkRail Executor SIMULTANEOUSLY (not one-by-one)",
|
|
119
|
+
"DIVERSITY: Each ideator has different perspective (logic, data, integration)",
|
|
120
|
+
"SYNTHESIS: Combine all hypotheses, deduplicate, refine to top 5-7",
|
|
121
|
+
"PARALLEL CHALLENGE: Delegate twice to WorkRail Executor SIMULTANEOUSLY",
|
|
122
|
+
"RIGOR: Different challenge levels (3 and 5)",
|
|
123
|
+
"FINAL SYNTHESIS: Integrate all perspectives",
|
|
124
|
+
"REMINDER: High confidence \u2260 proof. You still need evidence."
|
|
125
|
+
]
|
|
74
126
|
},
|
|
75
127
|
{
|
|
76
|
-
"id": "phase-
|
|
77
|
-
"title": "Phase
|
|
78
|
-
"prompt": "**PLAN HOW YOU'LL GATHER EVIDENCE**\n\nYou have hypotheses. Now design how you'll gather evidence to test them.\n\n**Think Through**:\n\n1. **What evidence would prove each hypothesis?**\n - For H1, what specific data points would confirm it?\n - For H2, what would you observe if it's correct?\n - How can you distinguish between competing hypotheses?\n\n2. **Where should you add instrumentation?**\n - What points in the execution flow are critical?\n - Where could you observe the data/state you need?\n - What's already being logged vs what do you need to add?\n\n3. **What's the right level of detail?**\n - Too much logging = noise and hard to analyze\n - Too little = gaps and missing evidence\n - How will you balance this?\n\n4. **Can you use existing tests?**\n - Are there tests you can enhance instead of adding new logging?\n - Can you modify tests to expose the state you need?\n - Should you write new targeted tests?\n\n**OUTPUT**: Update
|
|
128
|
+
"id": "phase-2a-plan",
|
|
129
|
+
"title": "Phase 2A: Design Your Instrumentation Strategy",
|
|
130
|
+
"prompt": "**PLAN HOW YOU'LL GATHER EVIDENCE**\n\nYou have hypotheses. Now design how you'll gather evidence to test them.\n\n**Think Through**:\n\n1. **What evidence would prove each hypothesis?**\n - For H1, what specific data points would confirm it?\n - For H2, what would you observe if it's correct?\n - How can you distinguish between competing hypotheses?\n\n2. **Where should you add instrumentation?**\n - What points in the execution flow are critical?\n - Where could you observe the data/state you need?\n - What's already being logged vs what do you need to add?\n\n3. **What's the right level of detail?**\n - Too much logging = noise and hard to analyze\n - Too little = gaps and missing evidence\n - How will you balance this?\n\n4. **Can you use existing tests?**\n - Are there tests you can enhance instead of adding new logging?\n - Can you modify tests to expose the state you need?\n - Should you write new targeted tests?\n\n**OUTPUT**: Update BUG_investigation.md with \"Phase 3 Instrumentation Plan\":\n- What evidence you need for each hypothesis\n- Where you'll add instrumentation (file:line)\n- What you'll log/observe at each point\n- Test scenarios you'll prepare\n- How you'll organize output to distinguish hypotheses\n\n**Self-Check**: Will this instrumentation actually give you the evidence you need? What might you miss?",
|
|
79
131
|
"agentRole": "You are designing your evidence collection strategy. Think carefully about what you need to prove.",
|
|
80
|
-
"requireConfirmation": false
|
|
132
|
+
"requireConfirmation": false,
|
|
133
|
+
"guidance": [
|
|
134
|
+
"EVIDENCE: Define what would prove/disprove each hypothesis",
|
|
135
|
+
"INSTRUMENTATION: Plan where to add logging/debugging",
|
|
136
|
+
"BALANCE: Enough detail to distinguish hypotheses, not so much you drown in noise",
|
|
137
|
+
"OUTPUT: Document your instrumentation plan"
|
|
138
|
+
]
|
|
81
139
|
},
|
|
82
140
|
{
|
|
83
|
-
"id": "phase-
|
|
84
|
-
"title": "Phase
|
|
85
|
-
"prompt": "**ADD INSTRUMENTATION AND PREPARE TEST SCENARIOS**\n\nNow implement the instrumentation strategy you designed.\n\n**DELEGATION OPPORTUNITY: Execution Simulation**\n\nBefore adding instrumentation, consider simulating execution to predict outcomes and refine your strategy.\n\n**
|
|
141
|
+
"id": "phase-2b-execute",
|
|
142
|
+
"title": "Phase 2B: Implement Your Instrumentation",
|
|
143
|
+
"prompt": "**ADD INSTRUMENTATION AND PREPARE TEST SCENARIOS**\n\nNow implement the instrumentation strategy you designed.\n\n**DELEGATION OPPORTUNITY: Execution Simulation**\n\nBefore adding instrumentation, consider simulating execution to predict outcomes and refine your strategy.\n\n**HOW TO DELEGATE:**\n\n1. **Prepare the work package:**\n```\nMISSION: Simulate execution paths for my top hypotheses\n\nHYPOTHESES: [Paste top 3-5 hypotheses]\n\nCONTEXT:\n- BUG_investigation.md (file reference)\n- BUG_hypotheses.md (file reference)\n- Key files: [List critical files from investigation]\n\nMODE: trace (Detailed execution path analysis)\n\nDELIVERABLE:\nFor each hypothesis:\n- Predicted execution path (step-by-step)\n- State changes at each step\n- Where instrumentation would be most revealing\n- Expected outputs if hypothesis is correct\n- Distinguishing characteristics between hypotheses\n```\n\n2. **Delegate to the WorkRail Executor:**\n\nDelegate to the WorkRail Executor:\n```\nPlease execute the 'Execution Simulation Routine' workflow in trace mode.\n\nWork Package: [Paste the work package from above]\n```\n\n**AFTER DELEGATION:**\nUse the simulation results to refine your instrumentation plan.\n\n**Implement**:\n- Add debug logging at the points identified by simulation\n- Enhance or create tests to expose necessary state\n- Add assertions to catch violations\n- Set up controlled experiments if needed\n- Label everything clearly ([H1], [H2], etc.)\n\n**Prepare Test Scenarios**:\n- Minimal reproduction case\n- Edge cases that might behave differently\n- Working scenarios for comparison\n- Variations that test specific hypotheses\n\n**OUTPUT**: Update BUG_investigation.md with:\n- List of instrumentation added (what/where/why)\n- Test scenarios prepared\n- Expected outcomes for each hypothesis (from simulation)\n- How you'll analyze results\n\n**Self-Critique**:\n- Did you add the instrumentation you planned?\n- Did you skip any because it seemed unnecessary?\n- Is your instrumentation labeled clearly?\n- Are your test scenarios sufficient?\n\n**Readiness Check**: If you run these tests, will you get the evidence you need to prove/disprove your hypotheses?",
|
|
86
144
|
"agentRole": "You are implementing your evidence collection plan with precision, informed by execution simulation. Good instrumentation is the foundation of proof.",
|
|
87
|
-
"requireConfirmation": false
|
|
145
|
+
"requireConfirmation": false,
|
|
146
|
+
"guidance": [
|
|
147
|
+
"DELEGATION: Consider using execution-simulator subagent first",
|
|
148
|
+
"TOOLS: Use edit tools to add instrumentation",
|
|
149
|
+
"LABELING: Mark instrumentation clearly ([H1], [H2], etc.)",
|
|
150
|
+
"TESTS: Prepare test scenarios before running"
|
|
151
|
+
]
|
|
88
152
|
},
|
|
89
153
|
{
|
|
90
|
-
"id": "phase-
|
|
91
|
-
"title": "Phase
|
|
92
|
-
"prompt": "**RUN INSTRUMENTED CODE AND COLLECT EVIDENCE**\n\nNow run your test scenarios and collect the evidence.\n\n**Execute**:\n- Run minimal reproduction case\n- Run edge cases and variations\n- Run working scenarios for comparison\n- Capture all output (logs, errors, test results)\n\n**Organize Evidence**:\nFor each hypothesis, create
|
|
154
|
+
"id": "phase-3-execute",
|
|
155
|
+
"title": "Phase 3: Collect Evidence",
|
|
156
|
+
"prompt": "**RUN INSTRUMENTED CODE AND COLLECT EVIDENCE**\n\nNow run your test scenarios and collect the evidence.\n\n**Execute**:\n- Run minimal reproduction case\n- Run edge cases and variations\n- Run working scenarios for comparison\n- Capture all output (logs, errors, test results)\n\n**Organize Evidence**:\nFor each hypothesis, create BUG_evidence_H1.md, BUG_evidence_H2.md, etc.:\n- What did the instrumentation reveal?\n- Does behavior match predictions?\n- What unexpected findings emerged?\n- Quality rating (1-10): How strong is this evidence?\n\n**Analyze Patterns**:\n- Which hypotheses are supported by evidence?\n- Which are contradicted?\n- Are there patterns you didn't predict?\n- Do you need different instrumentation?\n- Should you form new hypotheses?\n\n**Update Hypotheses**:\nUpdate BUG_hypotheses.md with:\n- Evidence collected for each\n- New likelihood scores based on evidence\n- Evidence quality ratings\n- New insights or remaining questions\n\n**Decision Point**:\n- Strong evidence (8+/10) for one hypothesis? \u2192 Proceed to validation\n- Need more instrumentation? \u2192 Go back and add it\n- Need to revise hypotheses? \u2192 Update them\n\nBut you're not done until you have strong evidence. Keep investigating.",
|
|
93
157
|
"agentRole": "You are collecting evidence systematically. Let the data guide you, not your assumptions.",
|
|
94
|
-
"requireConfirmation": false
|
|
158
|
+
"requireConfirmation": false,
|
|
159
|
+
"guidance": [
|
|
160
|
+
"EXECUTION: Run your test scenarios and capture all output",
|
|
161
|
+
"ORGANIZATION: Create BUG_evidence_H1.md, BUG_evidence_H2.md, etc.",
|
|
162
|
+
"ANALYSIS: Compare actual behavior to predictions",
|
|
163
|
+
"ITERATION: If evidence is weak, add more instrumentation"
|
|
164
|
+
]
|
|
95
165
|
},
|
|
96
166
|
{
|
|
97
|
-
"id": "phase-
|
|
98
|
-
"title": "Phase
|
|
99
|
-
"prompt": "**RIGOROUSLY VALIDATE YOUR FINDING**\n\nYou have a leading hypothesis with evidence. Now be your harshest critic.\n\n**State Your Conclusion**:\n- What hypothesis has the strongest evidence?\n- What's your confidence (1-10)?\n- What evidence supports it?\n\n**DELEGATION OPPORTUNITY: Adversarial Validation**\n\nYour conclusion needs rigorous challenge. Delegate to
|
|
167
|
+
"id": "phase-4a-validate",
|
|
168
|
+
"title": "Phase 4A: Validate Conclusion (Mode-Adaptive)",
|
|
169
|
+
"prompt": "**VALIDATE YOUR CONCLUSION BASED ON YOUR MODE**\n\n\u26a0\ufe0f **CHECK YOUR MODE** (from Phase 0C): QUICK, STANDARD, or THOROUGH?\n\n---\n\n**IF YOU CHOSE THOROUGH MODE:**\n\nUse parallel multi-perspective validation:\n\n**RIGOROUSLY VALIDATE YOUR FINDING**\n\nYou have a leading hypothesis with evidence. Now be your harshest critic.\n\n**State Your Conclusion**:\n- What hypothesis has the strongest evidence?\n- What's your confidence (1-10)?\n- What evidence supports it?\n\n**DELEGATION OPPORTUNITY: Adversarial Validation**\n\nYour conclusion needs rigorous challenge. Delegate to the WorkRail Executor for maximum-rigor adversarial review.\n\n**HOW TO DELEGATE:**\n\n1. **Prepare the work package:**\n```\nMISSION: Rigorously validate my bug diagnosis\n\nHYPOTHESES:\n- Leading hypothesis: [Your conclusion]\n- Alternatives considered: [List other hypotheses you ruled out]\n\nEVIDENCE:\n- BUG_evidence_H*.md files (file references)\n- BUG_hypotheses.md (file reference)\n- BUG_investigation.md (file reference)\n- Instrumentation output/logs (file references or inline)\n\nRIGOR: 5 (Maximum - exhaustive adversarial review)\n\nDELIVERABLE:\n- Strengths of leading hypothesis\n- Weaknesses and gaps\n- Alternative explanations not yet ruled out\n- Contradicting evidence\n- Edge cases that might break the explanation\n- Verdict with confidence assessment\n- Recommendations for additional validation\n```\n\n2. **Instruct the Hypothesis Challenger:**\n\nDelegate to the WorkRail Executor:\n```\nPlease execute the 'Hypothesis Challenge Routine' workflow at rigor=5 (Maximum level).\n\nWork Package: [Paste the work package from above]\n```\n\n**AFTER DELEGATION:**\nReview the Hypothesis Challenger's adversarial critique.\n\n**If confidence < 9/10**:\n- What specific test would raise confidence?\n- What alternative should you rule out?\n- What additional evidence do you need?\n- Go collect that evidence\n\n**Final Assessment**:\nAnswer these YES/NO:\n- Does this explain all observed symptoms?\n- Have you ruled out major alternatives?\n- Can you reproduce the bug based on this understanding?\n- Would you stake your reputation on this diagnosis?\n- Is there any contradicting evidence?\n- Did the adversarial review strengthen or weaken your confidence?\n\n**OUTPUT**: BUG_validation.md with:\n- Leading hypothesis and evidence\n- Alternatives considered and ruled out\n- Adversarial review findings (from Hypothesis Challenger)\n- Final confidence score\n- Remaining uncertainties\n\n**Threshold**: 9+/10 confidence with strong evidence to proceed. If not, keep investigating.\n\n**PARALLEL MULTI-PERSPECTIVE VALIDATION**\n\n\u26a0\ufe0f **CRITICAL: Spawn ALL THREE subagents SIMULTANEOUSLY.**\n\nBefore committing to your conclusion, get three independent perspectives AT THE SAME TIME:\n\n**Validator 1 - Hypothesis Challenger (rigor=5):**\n```\nPlease execute the 'Hypothesis Challenge Routine' workflow at rigor=5.\n\nChallenge Request:\nCONCLUSION: [Your final conclusion about the bug]\nEVIDENCE: [All evidence supporting this conclusion]\nRIGOR: 5 (Maximum adversarial review)\n\nTry to prove this conclusion is WRONG. Find any holes in the logic.\n```\n\n**Validator 2 - Execution Simulator:**\n```\nPlease execute the 'Execution Simulation Routine' workflow.\n\nSimulation Request:\nMISSION: Simulate the proposed fix\n\nPROPOSED FIX: [Your fix from BUG_validation.md]\nCONTEXT: [Relevant code context]\n\nSCENARIOS:\n1. Does the fix resolve the bug?\n2. Does the fix introduce new issues?\n3. Are there edge cases the fix doesn't handle?\n\nDELIVERABLE: BUG_fix_simulation.md\n```\n\n**Validator 3 - Plan Analyzer:**\n```\nPlease execute the 'Plan Analysis Routine' workflow.\n\nAnalysis Request:\nPLAN: [Your fix plan from BUG_validation.md]\n\nANALYZE:\n- Is the plan complete?\n- Are there missing steps?\n- Are there risks or gotchas?\n- Does it follow best practices?\n\nDELIVERABLE: BUG_plan_analysis.md\n```\n\n**FINAL SYNTHESIS - TRIPLE VALIDATION GATE:**\n\nReview all three perspectives:\n1. Hypothesis Challenger: Can they break your conclusion?\n2. Execution Simulator: Does the fix work in simulation?\n3. Plan Analyzer: Is the fix plan sound?\n\n**Quality Gate:**\n- \u2705 ALL THREE give green light \u2192 Proceed with confidence\n- \u26a0\ufe0f ONE raises concerns \u2192 Investigate and address\n- \ud83d\uded1 TWO+ raise concerns \u2192 Return to Phase 1 (re-form hypotheses)\n\n**ONLY PROCEED if you have triple validation.**\n\nUpdate BUG_validation.md with all validation results.\n\n---\n\n**IF YOU CHOSE STANDARD MODE:**\n\nUse sequential validation:\n\n1. **Delegate to Hypothesis Challenger** (rigor=5):\n ```\n Please execute the 'Hypothesis Challenge Routine' workflow at rigor=5.\n \n Challenge Request:\n CONCLUSION: [Your conclusion]\n EVIDENCE: Read BUG_investigation.md and evidence files\n RIGOR: 5\n \n Try to prove this is WRONG.\n ```\n\n2. **Address concerns** if any raised\n3. **Proceed** if validation passes\n\n---\n\n**IF YOU CHOSE QUICK MODE:**\n\nSelf-validate:\n\n1. **Self-challenge**: What could I be wrong about?\n2. **Check**: Does this explain ALL symptoms?\n3. **Verify**: Can I reproduce based on this understanding?\n4. **Proceed** if confident\n\n---\n\n",
|
|
100
170
|
"agentRole": "You are validating your conclusion with maximum rigor, leveraging adversarial challenge to ensure you haven't missed anything.",
|
|
101
|
-
"requireConfirmation": false
|
|
171
|
+
"requireConfirmation": false,
|
|
172
|
+
"guidance": [
|
|
173
|
+
"MODE: Adapt validation rigor based on your Phase 0C decision",
|
|
174
|
+
"CONSTRAINT: Validate your conclusion, but do NOT implement the fix",
|
|
175
|
+
"DELEGATION: Use hypothesis-challenger subagent at maximum rigor",
|
|
176
|
+
"THRESHOLD: Need 9+/10 confidence to proceed",
|
|
177
|
+
"ALTERNATIVES: Ensure you've ruled out major competing explanations",
|
|
178
|
+
"HONESTY: If confidence is low, go back and gather more evidence",
|
|
179
|
+
"PARALLEL: Spawn all 3 validators SIMULTANEOUSLY",
|
|
180
|
+
"DIVERSITY: Three different cognitive modes (adversarial, simulation, planning)",
|
|
181
|
+
"TRIPLE GATE: ALL THREE must validate before proceeding",
|
|
182
|
+
"ITERATE: If 2+ raise concerns, return to Phase 2"
|
|
183
|
+
]
|
|
102
184
|
},
|
|
103
185
|
{
|
|
104
|
-
"id": "phase-
|
|
105
|
-
"title": "Phase
|
|
106
|
-
"prompt": "**DOCUMENT YOUR INVESTIGATION - PROVE YOU FOUND THE TRUE SOURCE**\n\nYou've found the true source of the bug. Now prove it to others.\n\n**Your Task**: Create a diagnostic writeup that proves your case.\n\n**Structure**:\n\n**1. EXECUTIVE SUMMARY** (3-5 sentences)\n- What's the bug?\n- What's the true cause?\n- How confident are you? (should be 9-10/10)\n- What's the impact?\n\n**2. THE TRUE SOURCE** (detailed)\n- Explain the root cause\n- Why this causes the observed symptoms\n- Code locations (file:line)\n- Relevant code snippets\n\n**3. THE PROOF** (your evidence)\n- Key evidence that proves this diagnosis\n- How you collected it (instrumentation, tests)\n- Evidence quality and sources\n- Why alternative explanations don't fit\n\n**4. HOW TO REPRODUCE**\n- Minimal steps to reproduce\n- What to observe that confirms the diagnosis\n- Conditions required\n\n**5. YOUR INVESTIGATION**\n- What you analyzed\n- Hypotheses you tested\n- How you arrived at the conclusion\n- Key turning points\n\n**6. FIXING IT**\n- Suggested approach (conceptual)\n- Risks to consider\n- How to verify the fix\n- Tests that should be added\n\n**7. UNCERTAINTIES** (if any)\n- What you're still unsure about\n- Edge cases needing more investigation\n\n**OUTPUT**:
|
|
186
|
+
"id": "phase-4b-writeup",
|
|
187
|
+
"title": "Phase 4B: Prove Your Case",
|
|
188
|
+
"prompt": "**DOCUMENT YOUR INVESTIGATION - PROVE YOU FOUND THE TRUE SOURCE**\n\nYou've found the true source of the bug. Now prove it to others.\n\n**Your Task**: Create a diagnostic writeup that proves your case.\n\n**Structure**:\n\n**1. EXECUTIVE SUMMARY** (3-5 sentences)\n- What's the bug?\n- What's the true cause?\n- How confident are you? (should be 9-10/10)\n- What's the impact?\n\n**2. THE TRUE SOURCE** (detailed)\n- Explain the root cause\n- Why this causes the observed symptoms\n- Code locations (file:line)\n- Relevant code snippets\n\n**3. THE PROOF** (your evidence)\n- Key evidence that proves this diagnosis\n- How you collected it (instrumentation, tests)\n- Evidence quality and sources\n- Why alternative explanations don't fit\n\n**4. HOW TO REPRODUCE**\n- Minimal steps to reproduce\n- What to observe that confirms the diagnosis\n- Conditions required\n\n**5. YOUR INVESTIGATION**\n- What you analyzed\n- Hypotheses you tested\n- How you arrived at the conclusion\n- Key turning points\n\n**6. FIXING IT**\n- Suggested approach (conceptual)\n- Risks to consider\n- How to verify the fix\n- Tests that should be added\n\n**7. UNCERTAINTIES** (if any)\n- What you're still unsure about\n- Edge cases needing more investigation\n\n**OUTPUT**: BUG_diagnostic.md\n\n**Quality Check**:\n- Could someone fix this bug confidently from your writeup?\n- Have you proven your case with evidence?\n- Is it clear WHY this is the true source, not just a symptom?\n\n**Mission Complete**: You've tracked down the true source and proven it. Well done.",
|
|
107
189
|
"agentRole": "You are documenting your successful investigation. You found the truth - now prove it to others.",
|
|
108
|
-
"requireConfirmation": false
|
|
190
|
+
"requireConfirmation": false,
|
|
191
|
+
"guidance": [
|
|
192
|
+
"AUDIENCE: Write for someone who will fix the bug",
|
|
193
|
+
"PROOF: Include evidence, not just assertions",
|
|
194
|
+
"REPRODUCTION: Provide clear steps to reproduce",
|
|
195
|
+
"OUTPUT: Create BUG_diagnostic.md"
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "phase-4b-handoff",
|
|
200
|
+
"title": "Phase 4B: Investigation Complete - Handoff",
|
|
201
|
+
"prompt": "**INVESTIGATION COMPLETE - DO NOT IMPLEMENT THE FIX**\n\n\u26a0\ufe0f **CRITICAL BOUNDARY: This workflow is for INVESTIGATION ONLY.**\n\nYour job was to:\n- \u2705 Understand the bug\n- \u2705 Trace execution flow\n- \u2705 Form and test hypotheses\n- \u2705 Identify the root cause\n- \u2705 Validate your conclusion\n\nYour job is NOT to:\n- \u274c Write the fix\n- \u274c Modify any code\n- \u274c Create a PR\n- \u274c Implement the solution\n\n**HANDOFF DELIVERABLE:**\n\nCreate a final handoff document that someone else can use to implement the fix:\n\n**File: BUG_[VERSION]_handoff.md**\n\n```markdown\n# Bug Investigation Handoff\n\n## Executive Summary\n- **Bug**: [One sentence description]\n- **Root Cause**: [What's actually wrong]\n- **Confidence**: [High/Medium/Low based on validation]\n\n## Investigation Files\n- Investigation context: BUG_[VERSION]_investigation.md\n- Execution flow: BUG_[VERSION]_execution_flow.md\n- Hypotheses: BUG_[VERSION]_hypotheses.md\n- Validation: BUG_[VERSION]_validation.md\n\n## Root Cause Analysis\n[Detailed explanation of what's wrong and why]\n\n## Recommended Fix\n[High-level description of what needs to change]\n\n**Files to modify:**\n- [file:line] - [what needs to change]\n- [file:line] - [what needs to change]\n\n**Why this fixes it:**\n[Explain how the fix addresses the root cause]\n\n## Edge Cases & Risks\n[Things to watch out for when implementing]\n\n## Testing Recommendations\n[How to verify the fix works]\n\n## Next Steps\n1. Review this investigation\n2. Implement the recommended fix\n3. Test thoroughly\n4. Submit for code review\n```\n\n**OUTPUT**: BUG_[VERSION]_handoff.md with complete investigation summary\n\n**Before Finishing**: Have you clearly documented the root cause and recommended fix so someone else can implement it?",
|
|
202
|
+
"agentRole": "You are completing your investigation and handing off to an implementation team. Document everything clearly.",
|
|
203
|
+
"requireConfirmation": false,
|
|
204
|
+
"guidance": [
|
|
205
|
+
"BOUNDARY: Do NOT implement the fix yourself",
|
|
206
|
+
"HANDOFF: Create clear documentation for implementation team",
|
|
207
|
+
"COMPLETENESS: Include all investigation artifacts",
|
|
208
|
+
"CLARITY: Someone else should be able to implement from your handoff"
|
|
209
|
+
]
|
|
109
210
|
}
|
|
110
211
|
]
|
|
111
|
-
}
|
|
112
|
-
|
|
212
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "routine-ideation",
|
|
3
|
+
"name": "Ideation Routine",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Systematic idea generation routine for exploring solution spaces and generating diverse approaches to problems. Supports different perspectives (simplicity, performance, maintainability, etc.) for parallel ideation. Expected inputs: problem, constraints, context, perspective (optional), quantity, deliverable name.",
|
|
6
|
+
"steps": [
|
|
7
|
+
{
|
|
8
|
+
"id": "step-understand-problem",
|
|
9
|
+
"title": "Step 1: Understand the Problem Space",
|
|
10
|
+
"prompt": "**UNDERSTAND WHAT YOU'RE SOLVING**\n\nBefore generating ideas, deeply understand the problem space.\n\n**Analyze the Problem:**\n- What is the core problem to solve?\n- What are the constraints (technical, business, time)?\n- What context matters (existing code, requirements, patterns)?\n- What perspective should you prioritize (if any)?\n\n**Identify Solution Dimensions:**\n- What are the key decisions to make?\n- What are the main trade-off spaces?\n- What are the different approaches others have taken?\n\n**WORKING NOTES:**\n- Problem Summary\n- Key Constraints\n- Solution Dimensions\n- Trade-off Spaces",
|
|
11
|
+
"agentRole": "You are analyzing the problem space to understand what you're solving.",
|
|
12
|
+
"requireConfirmation": false,
|
|
13
|
+
"guidance": [
|
|
14
|
+
"DEPTH: Understand the problem deeply before ideating",
|
|
15
|
+
"DIMENSIONS: Identify the key decision points",
|
|
16
|
+
"TRADE-OFFS: Understand what can be traded off"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": "step-diverge",
|
|
21
|
+
"title": "Step 2: Diverge - Generate Many Ideas",
|
|
22
|
+
"prompt": "**GENERATE DIVERSE IDEAS**\n\nNow generate many ideas exploring different solution spaces.\n\n**Divergent Thinking:**\n- Generate {quantity} ideas minimum\n- Explore different approaches, not variations of the same idea\n- Don't judge or filter yet - quantity over quality\n- Push beyond the obvious first ideas\n\n**Solution Spaces to Explore:**\n- **Architectural**: Different ways to structure the solution\n- **Algorithmic**: Different approaches to the core logic\n- **Technological**: Different tools or frameworks\n- **Temporal**: Different timing or sequencing strategies\n- **Spatial**: Different data organization or distribution\n- **Behavioral**: Different user interactions or workflows\n\n**If you have a PERSPECTIVE focus:**\n- Prioritize ideas that excel in that dimension\n- But still explore diverse approaches within that lens\n\n**WORKING NOTES:**\n- Idea 1: [Name] - [Core concept]\n- Idea 2: [Name] - [Core concept]\n- ...\n- Idea N: [Name] - [Core concept]",
|
|
23
|
+
"agentRole": "You are in divergent mode - generating many ideas without judgment.",
|
|
24
|
+
"requireConfirmation": false,
|
|
25
|
+
"guidance": [
|
|
26
|
+
"QUANTITY: Generate more ideas than requested, then refine",
|
|
27
|
+
"DIVERSITY: Explore different solution spaces, not variations",
|
|
28
|
+
"NO JUDGMENT: Don't filter yet, just generate",
|
|
29
|
+
"PERSPECTIVE: If focused, prioritize that lens"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "step-develop",
|
|
34
|
+
"title": "Step 3: Develop - Flesh Out Each Idea",
|
|
35
|
+
"prompt": "**DEVELOP EACH IDEA**\n\nNow take each idea and develop it into a complete proposal.\n\n**For Each Idea:**\n\n### [Idea Name]\n\n**Core Concept:**\n- 2-3 sentence explanation of the approach\n\n**How It Works:**\n- Step-by-step breakdown\n- Key components or mechanisms\n- How it addresses the problem\n\n**Pros:**\n- What makes this approach attractive\n- What problems it solves well\n- What constraints it satisfies\n\n**Cons:**\n- What are the downsides\n- What problems it doesn't solve\n- What constraints it violates\n\n**Implementation Complexity:**\n- Low / Medium / High\n- Brief justification\n\n**Example (if helpful):**\n- Code sketch, diagram, or concrete scenario\n\n**WORKING NOTES:**\nDevelop all ideas using this structure",
|
|
36
|
+
"agentRole": "You are developing each idea into a complete, evaluable proposal.",
|
|
37
|
+
"requireConfirmation": false,
|
|
38
|
+
"guidance": [
|
|
39
|
+
"COMPLETENESS: Each idea needs all sections",
|
|
40
|
+
"OBJECTIVITY: Present pros AND cons honestly",
|
|
41
|
+
"CONCRETENESS: Be specific, not vague",
|
|
42
|
+
"EXAMPLES: Code sketches help clarify ideas"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "step-refine",
|
|
47
|
+
"title": "Step 4: Refine - Select Best Ideas",
|
|
48
|
+
"prompt": "**REFINE YOUR IDEA SET**\n\nNow refine your ideas to the target quantity.\n\n**Selection Criteria:**\n- **Diversity**: Keep ideas that explore different solution spaces\n- **Viability**: Keep ideas that could actually work given constraints\n- **Completeness**: Keep ideas that are well-developed\n- **Perspective Fit**: If focused, keep ideas that excel in that dimension\n\n**Remove:**\n- Duplicate or very similar ideas (keep the best version)\n- Ideas that violate hard constraints\n- Ideas that are too vague or underdeveloped\n\n**Target:** {quantity} ideas (or explain why fewer)\n\n**WORKING NOTES:**\n- Final idea set\n- Why these were chosen\n- What was filtered out and why",
|
|
49
|
+
"agentRole": "You are refining your idea set to the most diverse and viable options.",
|
|
50
|
+
"requireConfirmation": false,
|
|
51
|
+
"guidance": [
|
|
52
|
+
"DIVERSITY: Prioritize different approaches over similar ones",
|
|
53
|
+
"QUALITY: Each idea should be complete and viable",
|
|
54
|
+
"QUANTITY: Hit the target number if possible",
|
|
55
|
+
"JUSTIFICATION: Explain your selection criteria"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"id": "step-deliver",
|
|
60
|
+
"title": "Step 5: Deliver - Create Structured Artifact",
|
|
61
|
+
"prompt": "**CREATE THE DELIVERABLE**\n\nCreate {deliverable} with your refined ideas.\n\n**Structure:**\n\n```markdown\n# Ideation Results\n\n## Problem Summary\n[Brief restatement of the problem]\n\n## Constraints\n- [Constraint 1]\n- [Constraint 2]\n\n## Perspective\n[If focused: Simplicity / Performance / etc.]\n[If general: Balanced exploration]\n\n## Ideas Generated: {quantity}\n\n---\n\n### Idea 1: [Name]\n\n**Core Concept:**\n[2-3 sentences]\n\n**How It Works:**\n1. [Step 1]\n2. [Step 2]\n3. [Step 3]\n\n**Pros:**\n- [Pro 1]\n- [Pro 2]\n\n**Cons:**\n- [Con 1]\n- [Con 2]\n\n**Implementation Complexity:** [Low/Medium/High]\n[Justification]\n\n**Example:**\n```[language]\n[Code sketch or diagram]\n```\n\n---\n\n[Repeat for each idea]\n\n---\n\n## Summary\n\n**Recommended Next Steps:**\n- [How main agent should evaluate these ideas]\n- [What additional info might help decide]\n- [Potential combinations or hybrids]\n```\n\n**OUTPUT:** Create {deliverable} with this structure\n\n**Before Finishing:** Does each idea have all required sections? Are they diverse? Are they concrete and actionable?",
|
|
62
|
+
"agentRole": "You are creating the final structured deliverable for the main agent.",
|
|
63
|
+
"requireConfirmation": false,
|
|
64
|
+
"guidance": [
|
|
65
|
+
"STRUCTURE: Follow the template exactly",
|
|
66
|
+
"COMPLETENESS: Every idea has all sections",
|
|
67
|
+
"OBJECTIVITY: Present options, don't pick a winner",
|
|
68
|
+
"NEXT STEPS: Help main agent know how to proceed"
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
|