@exaudeus/workrail 0.8.2 → 0.8.4

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.
@@ -0,0 +1,113 @@
1
+ {
2
+ "id": "routine-hypothesis-challenge",
3
+ "name": "Hypothesis Challenge Routine",
4
+ "version": "1.1.0",
5
+ "description": "Adversarial testing of hypotheses using an Ideate -> Plan -> Execute strategy. Configurable rigor levels (1-5) allow for progressively deeper skepticism and stress testing.",
6
+ "clarificationPrompts": [
7
+ "What hypotheses or assumptions should I challenge?",
8
+ "What rigor level do you need? (1=Surface, 3=Deep, 5=Maximum)",
9
+ "What evidence supports these hypotheses?",
10
+ "What context should I consider? (bug description, findings, constraints)"
11
+ ],
12
+ "preconditions": [
13
+ "Hypotheses or assumptions are clearly stated",
14
+ "Rigor level (1-5) is specified",
15
+ "Supporting evidence is available",
16
+ "Agent has read access to relevant context"
17
+ ],
18
+ "metaGuidance": [
19
+ "**ROUTINE PURPOSE:**",
20
+ "This routine performs adversarial testing. It separates strategy (Ideating attack vectors) from execution (Challenging/Stress Testing).",
21
+ "**PHASES:**",
22
+ "1. IDEATE: Brainstorm attack vectors and common flaws",
23
+ "2. STRATEGIZE: Define the challenge plan for the requested rigor",
24
+ "3. EXECUTE: Run the challenge (Surface/Deep/Max)",
25
+ "4. SYNTHESIZE: Deliver verdicts and alternative explanations",
26
+ "**CORE PRINCIPLES:**",
27
+ "- ADVERSARIAL: Actively try to disprove, don't confirm",
28
+ "- SYSTEMATIC: Challenge assumptions, logic, and evidence",
29
+ "- CONSTRUCTIVE: Goal is to strengthen truth, not just destroy"
30
+ ],
31
+ "steps": [
32
+ {
33
+ "id": "step-0-ideate-vectors",
34
+ "title": "Step 0: Ideate Challenge Strategy",
35
+ "prompt": "**IDEATE ATTACK VECTORS**\n\nBefore diving into specific hypotheses, step back and look at the whole picture.\n\n**YOUR MISSION:** Brainstorm ways to break these hypotheses.\n\n**EXECUTE:**\n1. Review all hypotheses together\n2. Identify shared assumptions (do they all assume X?)\n3. Brainstorm classes of failure (Concurrency? State? Logic?)\n4. Identify weak points in the evidence provided\n\n**REFLECT:**\n- Are these hypotheses too similar?\n- Are they missing a whole category of explanation?\n- What is the most likely \"unknown unknown\"?\n\n**WORKING NOTES:**\n- Common Assumptions\n- Potential Attack Vectors (e.g., Race Conditions, Edge Cases)\n- Evidence Weaknesses",
36
+ "agentRole": "You are a red-team strategist planning your attack.",
37
+ "requireConfirmation": false,
38
+ "guidance": [
39
+ "BRAINSTORM: Look for systemic issues first",
40
+ "CATEGORIES: Think in categories (Logic, Data, Timing, Environment)",
41
+ "SKEPTICISM: Assume the hypotheses are wrong. Why?"
42
+ ]
43
+ },
44
+ {
45
+ "id": "step-1-plan-challenge",
46
+ "title": "Step 1: Plan Challenge Tactics",
47
+ "prompt": "**DEFINE CHALLENGE PLAN**\n\nNow define your specific tactics for the requested rigor level.\n\n**YOUR MISSION:** Create a concrete plan to test these hypotheses.\n\n**EXECUTE:**\n1. Map attack vectors to specific hypotheses\n2. Define **Key Questions** to answer\n3. Select **Stress Tests** or **Counter-Examples** to search for\n4. Define criteria for \"disproof\"\n\n**DELIVERABLE:**\nCreate `challenge-strategy.md`:\n- Attack Plan for each Hypothesis\n- Key Assumptions to Probe\n- Required Evidence check",
48
+ "agentRole": "You are a lead auditor defining the scope of the audit.",
49
+ "requireConfirmation": false,
50
+ "guidance": [
51
+ "TACTICS: Be specific (e.g., \"Check for null user in auth flow\")",
52
+ "CRITERIA: What would convince you the hypothesis is false?"
53
+ ]
54
+ },
55
+ {
56
+ "id": "step-execute-rigor-1",
57
+ "title": "Execution: Rigor 1 (Surface)",
58
+ "runCondition": {
59
+ "var": "rigor",
60
+ "gte": 1
61
+ },
62
+ "prompt": "**EXECUTE RIGOR 1: SURFACE CHALLENGE**\n\nExecute your challenge plan at Rigor 1 (Surface).\n\n**MISSION:** Identify obvious flaws and simple counter-examples.\n\n**EXECUTE:**\n1. Follow `challenge-strategy.md`\n2. Check for obvious logical gaps\n3. Identify simple counter-examples\n4. Check for Occam's Razor alternatives\n\n**WORKING NOTES:**\n- Obvious Flaws\n- Simple Counter-Examples\n- Better Alternatives",
63
+ "agentRole": "You are a skeptical reviewer looking for quick wins.",
64
+ "requireConfirmation": false,
65
+ "guidance": [
66
+ "FOCUS: Obvious errors, simple logic gaps",
67
+ "SPEED: Don't dig deep yet, look for low-hanging fruit"
68
+ ]
69
+ },
70
+ {
71
+ "id": "step-execute-rigor-3",
72
+ "title": "Execution: Rigor 3 (Deep)",
73
+ "runCondition": {
74
+ "var": "rigor",
75
+ "gte": 3
76
+ },
77
+ "prompt": "**EXECUTE RIGOR 3: DEEP CHALLENGE**\n\nExecute your challenge plan at Rigor 3 (Deep Analysis).\n\n**MISSION:** Deeply challenge with edge cases and hidden assumptions.\n\n**EXECUTE:**\n1. Follow `challenge-strategy.md`\n2. Expose hidden assumptions\n3. Generate systematic edge cases\n4. Analyze timing and environment factors\n\n**WORKING NOTES:**\n- Hidden Assumptions Exposed\n- Edge Case Analysis\n- Environmental Factors",
78
+ "agentRole": "You are a rigorous auditor digging for structural flaws.",
79
+ "requireConfirmation": false,
80
+ "guidance": [
81
+ "FOCUS: Unstated assumptions, boundary conditions",
82
+ "DEPTH: trace logic chains to find breaks"
83
+ ]
84
+ },
85
+ {
86
+ "id": "step-execute-rigor-5",
87
+ "title": "Execution: Rigor 5 (Maximum)",
88
+ "runCondition": {
89
+ "var": "rigor",
90
+ "gte": 5
91
+ },
92
+ "prompt": "**EXECUTE RIGOR 5: MAX CHALLENGE**\n\nExecute your challenge plan at Rigor 5 (Maximum Skepticism).\n\n**MISSION:** Try to break it completely.\n\n**EXECUTE:**\n1. Follow `challenge-strategy.md`\n2. Exhaustive assumption enumeration\n3. Extreme edge cases and adversarial inputs\n4. Second-order effects and chaos scenarios\n\n**WORKING NOTES:**\n- Exhaustive Challenges\n- Extreme Scenarios\n- Disproof Attempts",
93
+ "agentRole": "You are a relentless adversary trying to prove it wrong.",
94
+ "requireConfirmation": false,
95
+ "guidance": [
96
+ "FOCUS: Breaking the system, extreme edge cases",
97
+ "MINDSET: Trust nothing, verify everything"
98
+ ]
99
+ },
100
+ {
101
+ "id": "step-synthesize",
102
+ "title": "Step 5: Synthesize Verdicts",
103
+ "prompt": "**SYNTHESIZE VERDICTS**\n\nSynthesize all challenges into final verdicts.\n\n**MISSION:** Deliver clear judgments on each hypothesis.\n\n**EXECUTE:**\n1. Review all Working Notes\n2. Assign Verdicts (Keep/Revise/Reject)\n3. Prioritize Alternatives\n4. Define Critical Tests\n\n**DELIVERABLE:**\nCreate `{deliverableName}`:\n- Executive Summary\n- Hypothesis Analysis & Verdicts\n- Critical Tests Needed\n- Recommendations",
104
+ "agentRole": "You are a judge delivering the final verdict.",
105
+ "requireConfirmation": false,
106
+ "guidance": [
107
+ "VERDICTS: Be decisive based on evidence",
108
+ "ALTERNATIVES: Propose concrete, better explanations",
109
+ "ACTION: What specifically needs to be tested?"
110
+ ]
111
+ }
112
+ ]
113
+ }
@@ -1,139 +1,100 @@
1
1
  {
2
2
  "id": "routine-plan-analysis",
3
3
  "name": "Plan Analysis Routine",
4
- "version": "1.0.0",
5
- "description": "Validates implementation plans for completeness, pattern adherence, and risk. Checks against requirements, constraints, and codebase patterns. Designed for delegation to Plan Analyzer subagent or manual execution by main agent.",
4
+ "version": "1.1.0",
5
+ "description": "Validates implementation plans using an Ideate -> Plan -> Execute strategy. Checks for completeness, pattern adherence, and risk. Designed for delegation to Plan Analyzer subagent.",
6
6
  "clarificationPrompts": [
7
- "What plan should I analyze? (file reference or inline)",
7
+ "What plan file should I analyze? (e.g., implementation-plan.md)",
8
8
  "What requirements must the plan address?",
9
9
  "What constraints must it follow? (patterns, rules, standards)",
10
10
  "What context should I consider? (codebase patterns, user rules, background)"
11
11
  ],
12
12
  "preconditions": [
13
- "Plan is available (as file or inline text)",
13
+ "Plan is available as a file (e.g., implementation-plan.md)",
14
14
  "Requirements are clearly stated",
15
15
  "Constraints are specified (patterns, rules, standards)",
16
- "Agent has read access to codebase for pattern verification"
16
+ "Agent has read access to codebase and plan file"
17
17
  ],
18
18
  "metaGuidance": [
19
19
  "**ROUTINE PURPOSE:**",
20
- "This routine validates implementation plans against requirements, constraints, and established patterns. It identifies gaps, risks, and deviations before execution begins.",
21
- "",
20
+ "This routine validates plans. It separates strategy (Ideating analysis vectors) from execution (Checking completeness/patterns/risk).",
21
+ "**PHASES:**",
22
+ "1. IDEATE: Classify the plan type and potential pitfalls",
23
+ "2. STRATEGIZE: Define the analysis focus and checklist",
24
+ "3. EXECUTE: Run the checks (Completeness, Patterns, Risk)",
25
+ "4. SYNTHESIZE: Deliver the final verdict and recommendations",
22
26
  "**CORE PRINCIPLES:**",
23
- "- COMPLETENESS: Verify all requirements are addressed",
24
- "- COMPLIANCE: Check adherence to patterns and rules",
25
- "- RISK-AWARE: Identify potential issues before they occur",
26
- "- CONSTRUCTIVE: Suggest improvements, not just criticize",
27
- "",
28
- "**EXPECTED INPUT FORMAT:**",
29
- "Plan: Can be a file reference (e.g., 'implementation-plan.md') or inline text. A plan typically includes: objectives, approach/strategy, steps/phases, dependencies, testing strategy, and success criteria.",
30
- "Requirements: List of what must be accomplished",
31
- "Constraints: Patterns to follow, rules to obey, standards to meet",
32
- "Context: Background information, codebase patterns, user rules",
33
- "",
34
- "**PLAN HANDLING:**",
35
- "If plan is a file reference, use read_file to load it. If plan is provided inline as text, work with it directly.",
36
- "",
37
- "**EXECUTION MODEL:**",
38
- "This routine is designed for autonomous execution. You will receive all necessary context upfront. Your role is to validate thoroughly and identify issues."
27
+ "- CONTEXT-AWARE: Adapt analysis to the plan type (UI vs Backend vs Migration)",
28
+ "- RISK-FOCUSED: Prioritize high-risk areas",
29
+ "- CONSTRUCTIVE: Suggest specific improvements"
39
30
  ],
40
31
  "steps": [
41
32
  {
42
- "id": "step-0-understand-plan",
43
- "title": "Step 0: Understand the Plan",
44
- "prompt": "**UNDERSTAND THE PLAN** (5-10 min) - Read and comprehend\n\n**YOUR MISSION:** Thoroughly understand what the plan proposes to do.\n\n**PLAN YOUR APPROACH:**\nBefore analyzing, think:\n- What is the plan trying to accomplish?\n- What are the major components or phases?\n- What's the overall strategy?\n\n**EXECUTE:**\n1. Read the plan (use read_file if it's a file reference)\n2. Identify the main objectives\n3. Break down into major components or phases\n4. Note the proposed approach/strategy\n5. Identify any dependencies or prerequisites\n\n**REFLECT:**\nAs you read, ask yourself:\n- What is this plan really trying to achieve?\n- What's the high-level strategy?\n- What are the major steps or phases?\n- Are there dependencies between components?\n- Is the plan clear and well-structured?\n\n**WORKING NOTES:**\nCapture your understanding:\n- Main objectives (what's being accomplished)\n- Major components/phases (how it's structured)\n- Proposed strategy (the approach)\n- Dependencies (what depends on what)\n- Initial impressions (clarity, structure, completeness)",
45
- "agentRole": "You are a meticulous plan analyst who ensures complete understanding before evaluation.",
33
+ "id": "step-0-ideate-strategy",
34
+ "title": "Step 0: Ideate Analysis Strategy",
35
+ "prompt": "**IDEATE ANALYSIS STRATEGY**\n\nBefore analyzing the details, look at the plan holistically.\n\n**YOUR MISSION:** Determine what *kind* of plan this is and what usually goes wrong with it.\n\n**EXECUTE:**\n1. Read the plan summary\n2. Classify the plan (e.g., \"Database Migration\", \"UI Refactor\", \"New API Endpoint\")\n3. Brainstorm common pitfalls for this category\n4. Identify key patterns that *should* be present\n\n**REFLECT:**\n- What are the \"unknown unknowns\" for this domain?\n- What is the single biggest risk?\n- Are there specific user rules for this type of work?\n\n**WORKING NOTES:**\n- Plan Classification\n- Common Pitfalls to Check\n- Critical Patterns to Verify\n- Key Risk Areas",
36
+ "agentRole": "You are a seasoned architect deciding how to review a design.",
37
+ "requireConfirmation": false,
46
38
  "guidance": [
47
- "READING STRATEGY: If plan is a file reference, use read_file. If inline, parse the text carefully",
48
- "OBJECTIVE EXTRACTION: What is the plan trying to accomplish? Be specific - not 'fix bug' but 'fix token validation bug in AuthService'",
49
- "COMPONENT IDENTIFICATION: Break plan into logical pieces - phases, modules, steps, layers",
50
- "STRATEGY ANALYSIS: What's the approach? Incremental? Big bang? Refactor then fix? Fix then refactor?",
51
- "DEPENDENCY MAPPING: What must happen before what? Are dependencies explicit or implicit?",
52
- "QUALITY INDICATORS - Clear plan: Explicit objectives, logical structure, clear dependencies, well-organized",
53
- "QUALITY INDICATORS - Unclear plan: Vague objectives, jumbled structure, hidden dependencies, hard to follow",
54
- "CONSTRAINT: Just understand - don't evaluate yet",
55
- "OUTPUT LIMIT: Summary of plan understanding (aim for 300-400 words)"
56
- ],
57
- "requireConfirmation": false
39
+ "CLASSIFICATION: Be specific (e.g., 'Async Worker Implementation')",
40
+ "PITFALLS: List 3-5 common errors for this specific domain",
41
+ "FOCUS: Decide where to spend your limited attention"
42
+ ]
58
43
  },
59
44
  {
60
- "id": "step-1-completeness-check",
61
- "title": "Step 1: Completeness Check",
62
- "prompt": "**COMPLETENESS CHECK** (10-15 min) - Verify all requirements addressed\n\n**YOUR MISSION:** Ensure every requirement is addressed by the plan.\n\n**PLAN YOUR APPROACH:**\nBased on your understanding, decide:\n- How will I map requirements to plan elements?\n- What might be missing?\n- What's implied vs explicit?\n\n**EXECUTE:**\n1. List all stated requirements\n2. For each requirement, find where it's addressed in the plan\n3. Identify requirements that are missing or partially addressed\n4. Check for implicit requirements (not stated but necessary)\n5. Verify success criteria are defined\n\n**REFLECT:**\nAs you check, ask yourself:\n- Is every requirement explicitly addressed?\n- Are any requirements only partially covered?\n- What implicit requirements exist? (testing, docs, migration, rollback)\n- How will success be measured?\n- What's missing that should be there?\n\n**WORKING NOTES:**\nCapture your analysis:\n- Requirement coverage matrix (requirement → plan element)\n- Missing requirements (stated but not addressed)\n- Partial coverage (addressed but incompletely)\n- Implicit requirements (testing, docs, migration, monitoring, rollback)\n- Success criteria (how will we know it worked?)\n- Completeness score (X/Y requirements fully addressed)",
63
- "agentRole": "You are a thorough requirements analyst who ensures nothing is overlooked.",
45
+ "id": "step-1-plan-analysis",
46
+ "title": "Step 1: Plan the Analysis",
47
+ "prompt": "**DEFINE ANALYSIS PLAN**\n\nNow define your specific checklist for this analysis.\n\n**YOUR MISSION:** Create a concrete plan to validate this document.\n\n**EXECUTE:**\n1. Select the specific **Checks** to run (Completeness, Patterns, Security, Performance)\n2. Define **Key Questions** to answer\n3. Identify **Reference Files** to check against (patterns, existing code)\n\n**DELIVERABLE:**\nCreate `analysis-strategy.md`:\n- Scope of Analysis\n- Key Questions\n- Pattern Reference List\n- Risk Focus Areas",
48
+ "agentRole": "You are a lead reviewer defining the review criteria.",
49
+ "requireConfirmation": false,
64
50
  "guidance": [
65
- "MAPPING STRATEGY: Create explicit mapping - Requirement 1 → Plan Section 2.3, Requirement 2 Plan Section 1.1 + 3.2",
66
- "MISSING DETECTION: Look for requirements with no corresponding plan element. These are gaps.",
67
- "PARTIAL COVERAGE: Requirement is mentioned but not fully addressed. Example: 'Add tests' mentioned but no test strategy",
68
- "IMPLICIT REQUIREMENTS: Always check for - Testing strategy, Documentation updates, Migration/upgrade path, Rollback plan, Monitoring/observability, Performance impact, Security considerations",
69
- "SUCCESS CRITERIA: How will we know the plan succeeded? Metrics? Tests? User validation?",
70
- "QUALITY INDICATORS - Complete plan: All requirements mapped, implicit requirements addressed, success criteria defined",
71
- "QUALITY INDICATORS - Incomplete plan: Missing requirements, no implicit requirements, no success criteria",
72
- "CONSTRAINT: Focus on what's missing, not how it's done (that's next step)",
73
- "OUTPUT LIMIT: Completeness analysis with requirement mapping and gaps (aim for 400-500 words)"
74
- ],
75
- "requireConfirmation": false
51
+ "CUSTOMIZE: Don't just use a generic checklist. Tailor it to the plan type.",
52
+ "REFERENCES: List specific files to check for pattern matching"
53
+ ]
76
54
  },
77
55
  {
78
- "id": "step-2-pattern-compliance",
79
- "title": "Step 2: Pattern Compliance Check",
80
- "prompt": "**PATTERN COMPLIANCE** (15-20 min) - Verify adherence to patterns and rules\n\n**YOUR MISSION:** Check if the plan follows established patterns, rules, and standards.\n\n**PLAN YOUR APPROACH:**\nBased on constraints provided, decide:\n- What patterns should I verify?\n- Where in the codebase are these patterns?\n- How will I check compliance?\n\n**EXECUTE:**\n1. Review all stated constraints (patterns, rules, standards)\n2. For each constraint, check if plan follows it\n3. Use codebase_search/grep to find existing patterns\n4. Compare plan approach to established patterns\n5. Identify deviations (intentional or accidental)\n6. Check against user rules (if provided)\n\n**REFLECT:**\nAs you check, ask yourself:\n- Does the plan follow established patterns?\n- Are deviations justified or accidental?\n- Does it match how similar things are done?\n- Does it follow user rules and standards?\n- Are there better patterns it should use?\n\n**WORKING NOTES:**\nCapture your analysis:\n- Pattern compliance matrix (constraint → compliance status)\n- Deviations identified (where plan differs from patterns)\n- Justification check (are deviations explained?)\n- Similar implementations (how others did this)\n- User rule compliance (follows stated rules?)\n- Recommended patterns (better approaches available?)",
81
- "agentRole": "You are a pattern expert who ensures consistency with established practices.",
56
+ "id": "step-execute-completeness",
57
+ "title": "Execution: Completeness Check",
58
+ "prompt": "**EXECUTE COMPLETENESS CHECK**\n\nVerify all requirements are addressed.\n\n**MISSION:** Ensure no requirement is left behind.\n\n**EXECUTE:**\n1. Follow `analysis-strategy.md`\n2. Map Requirements to Plan Sections\n3. identifying gaps\n4. Check for implicit requirements (Testing, Migration, Rollback)\n\n**WORKING NOTES:**\n- Requirement Matrix\n- Gaps Identified\n- Implicit Requirements Status",
59
+ "agentRole": "You are a requirements analyst ensuring full coverage.",
60
+ "requireConfirmation": false,
82
61
  "guidance": [
83
- "PATTERN DISCOVERY: Use codebase_search to find existing patterns - 'How is authentication implemented?' or grep for similar code",
84
- "COMPLIANCE CHECKING: For each constraint, verify plan follows it. Example: Constraint 'use dependency injection' → Check if plan shows DI",
85
- "DEVIATION ANALYSIS: Where does plan differ from patterns? Is it justified (with explanation) or accidental (oversight)?",
86
- "SIMILARITY SEARCH: Find similar implementations - grep 'class.*Service', codebase_search 'How are services structured?'",
87
- "USER RULE VERIFICATION: Check against provided user rules - naming conventions, architectural patterns, testing requirements",
88
- "BETTER ALTERNATIVES: Are there superior patterns the plan should use? More modern? More maintainable?",
89
- "QUALITY INDICATORS - Compliant plan: Follows patterns, deviations justified, matches similar code, follows user rules",
90
- "QUALITY INDICATORS - Non-compliant plan: Ignores patterns, unexplained deviations, inconsistent with codebase, violates user rules",
91
- "CONSTRAINT: Focus on pattern adherence, not implementation details",
92
- "OUTPUT LIMIT: Pattern compliance analysis with deviations and recommendations (aim for 500-600 words)"
93
- ],
94
- "requireConfirmation": false
62
+ "MAPPING: Create explicit mapping (Req 1 -> Section 2)",
63
+ "IMPLICIT: Don't forget testing, monitoring, docs"
64
+ ]
95
65
  },
96
66
  {
97
- "id": "step-3-risk-assessment",
98
- "title": "Step 3: Risk Assessment",
99
- "prompt": "**RISK ASSESSMENT** (10-15 min) - Identify potential issues\n\n**YOUR MISSION:** Identify risks, potential problems, and failure modes in the plan.\n\n**PLAN YOUR APPROACH:**\nBased on your analysis so far, decide:\n- What could go wrong?\n- What's risky about this approach?\n- What failure modes exist?\n\n**EXECUTE:**\n1. Identify technical risks (complexity, dependencies, unknowns)\n2. Identify execution risks (ordering, timing, coordination)\n3. Identify business risks (downtime, data loss, user impact)\n4. Check for single points of failure\n5. Assess rollback/recovery capability\n6. Consider edge cases and error scenarios\n\n**REFLECT:**\nAs you assess, ask yourself:\n- What's the riskiest part of this plan?\n- What could cause this to fail?\n- What happens if something goes wrong?\n- Are there single points of failure?\n- Can we rollback if needed?\n- What edge cases could break this?\n\n**WORKING NOTES:**\nCapture your assessment:\n- Technical risks (complexity, unknowns, dependencies)\n- Execution risks (ordering, timing, coordination)\n- Business risks (downtime, data loss, user impact)\n- Single points of failure (no redundancy or fallback)\n- Rollback capability (can we undo this?)\n- Edge cases (unusual scenarios that could break it)\n- Risk mitigation suggestions (how to reduce risks)",
100
- "agentRole": "You are a risk analyst who identifies potential problems before they occur.",
67
+ "id": "step-execute-patterns",
68
+ "title": "Execution: Pattern Compliance",
69
+ "prompt": "**EXECUTE PATTERN CHECK**\n\nVerify adherence to codebase patterns.\n\n**MISSION:** Ensure consistency with existing code.\n\n**EXECUTE:**\n1. Follow `analysis-strategy.md`\n2. Check against Reference Files\n3. Identify deviations\n4. Verify user rule compliance\n\n**WORKING NOTES:**\n- Pattern Compliance Matrix\n- Deviations (Justified/Unjustified)",
70
+ "agentRole": "You are a pattern expert ensuring consistency.",
71
+ "requireConfirmation": false,
101
72
  "guidance": [
102
- "SEVERITY LEVELS: HIGH (blocks execution, causes outages, data loss), MEDIUM (significant impact, workarounds exist), LOW (minor impact, easily mitigated)",
103
- "TECHNICAL RISK CATEGORIES: High complexity (too many moving parts), Unknown dependencies (what else does this affect?), Untested approach (never done this before), Performance impact (could slow things down), Security implications (could introduce vulnerabilities)",
104
- "EXECUTION RISK CATEGORIES: Ordering dependencies (must do A before B), Timing issues (race conditions, deadlocks), Coordination needs (multiple teams/systems), Data migration risks (could corrupt data), Deployment complexity (hard to deploy safely)",
105
- "BUSINESS RISK CATEGORIES: Downtime required (service interruption), Data loss potential (could lose data), User impact (breaks workflows), Backward compatibility (breaks existing code), Production incident risk (could cause outage)",
106
- "SINGLE POINT OF FAILURE: Where is there no redundancy? No fallback? No alternative path?",
107
- "ROLLBACK ANALYSIS: Can we undo this? How? What if rollback fails? Is there a recovery plan?",
108
- "EDGE CASE THINKING: What unusual scenarios could break this? Concurrent access? Partial failures? Network issues? Resource exhaustion?",
109
- "QUALITY INDICATORS - Low risk plan: Risks identified and mitigated, rollback possible, no single points of failure, edge cases considered",
110
- "QUALITY INDICATORS - High risk plan: Risks not addressed, no rollback plan, single points of failure, edge cases ignored",
111
- "CONSTRAINT: Identify risks, don't solve them (that's for recommendations)",
112
- "OUTPUT LIMIT: Risk assessment with categories and severity (aim for 400-500 words)"
113
- ],
114
- "requireConfirmation": false
73
+ "COMPARE: Explicitly compare plan code snippets to existing files",
74
+ "DEVIATIONS: Ask 'Why is this different?'"
75
+ ]
115
76
  },
116
77
  {
117
- "id": "step-4-synthesize-analysis",
118
- "title": "Step 4: Synthesize & Deliver Analysis",
119
- "prompt": "**SYNTHESIZE YOUR ANALYSIS**\n\nYou've completed your plan analysis. Now synthesize and structure your findings.\n\n**REFLECT ON YOUR ANALYSIS:**\n- What's the overall quality of this plan?\n- What are the biggest gaps or issues?\n- What should be addressed before execution?\n- Is this plan ready to execute?\n- What's your confidence level in this plan?\n\n**CREATE STRUCTURED DELIVERABLE:**\n\nProduce `{deliverableName}` with your structured analysis.\n\n**Key sections to include:**\n- **Executive Summary**: Overall assessment, critical issues, major strengths, next steps\n- **Completeness Analysis**: Requirement coverage, gaps, implicit requirements, success criteria\n- **Pattern Compliance**: Adherence to constraints, deviations, similar implementations, user rule compliance\n- **Risk Assessment**: Technical/execution/business risks with severity, single points of failure, rollback capability\n- **Recommendations**: Prioritized by importance (Critical / Important / Nice to have)\n- **Verdict**: Ready to execute? Confidence level (1-10)? Recommended action?\n\nOrganize these in the way that best communicates your findings. Use the structure that makes your analysis clearest.\n\n**SELF-VALIDATE:**\n- All requirements checked?\n- All constraints verified?\n- All risks identified?\n- Recommendations actionable?\n- Verdict justified?\n\nIf YES to all, deliver. If NO, revise first.",
120
- "agentRole": "You are a senior plan analyst who synthesizes findings into clear, actionable recommendations.",
78
+ "id": "step-execute-risk",
79
+ "title": "Execution: Risk Assessment",
80
+ "prompt": "**EXECUTE RISK ASSESSMENT**\n\nIdentify potential failure modes.\n\n**MISSION:** Find what could go wrong.\n\n**EXECUTE:**\n1. Follow `analysis-strategy.md`\n2. Check for Technical, Execution, and Business risks\n3. Identify Single Points of Failure\n4. Assess Rollback capability\n\n**WORKING NOTES:**\n- Risk Register (with Severity)\n- Rollback Assessment",
81
+ "agentRole": "You are a risk analyst predicting failures.",
82
+ "requireConfirmation": false,
121
83
  "guidance": [
122
- "SYNTHESIS APPROACH: Don't just list findings - assess overall quality. Is this a good plan? Ready to execute?",
123
- "STRUCTURE REFERENCE: Suggested format - Executive Summary (3-5 bullets), Completeness (requirement matrix, gaps, score), Compliance (constraint checks, deviations, similar code), Risks (categorized by severity), Recommendations (prioritized), Verdict (ready? confidence? action?). Adapt as needed.",
124
- "PRIORITIZATION: Order issues by impact - Critical (blocks execution), Important (should fix), Nice to have (consider)",
125
- "VERDICT FRAMEWORK: Ready (minor issues only), Needs Revision (significant gaps but salvageable), Not Ready (major redesign needed)",
126
- "CONFIDENCE SCORING: 1-3 (many issues), 4-6 (some concerns), 7-8 (mostly good), 9-10 (excellent plan). This adds nuance beyond the categorical verdict.",
127
- "ACTIONABLE RECOMMENDATIONS: Be specific - Not 'add tests' but 'Add unit tests for AuthService.validateToken covering edge cases: null token, expired token, malformed token'",
128
- "CONSTRUCTIVE TONE: Identify issues to improve the plan, not to criticize. Suggest solutions, not just problems",
129
- "EVIDENCE-BASED: Support assessments with specific examples from your analysis",
130
- "QUALITY INDICATORS - Strong analysis: Clear verdict, specific recommendations, evidence-based, actionable, constructive",
131
- "QUALITY INDICATORS - Weak analysis: Vague verdict, generic recommendations, no evidence, not actionable, just criticism",
132
- "SELF-VALIDATION CHECKLIST: All requirements checked? Constraints verified? Risks identified? Recommendations actionable? Verdict justified?",
133
- "DELIVERABLE CREATION: Use write tool to create {deliverableName} with your structured analysis. Don't just output in chat - create the actual file"
134
- ],
135
- "requireConfirmation": false
84
+ "SEVERITY: High/Med/Low",
85
+ "ROLLBACK: Can we undo this?"
86
+ ]
87
+ },
88
+ {
89
+ "id": "step-synthesize",
90
+ "title": "Step 5: Synthesize Analysis",
91
+ "prompt": "**SYNTHESIZE ANALYSIS**\n\nSynthesize findings into a final report.\n\n**MISSION:** Deliver clear, actionable feedback.\n\n**EXECUTE:**\n1. Review all Working Notes\n2. Assess overall quality\n3. Prioritize issues\n4. Formulate recommendations\n\n**DELIVERABLE:**\nCreate `{deliverableName}`:\n- Executive Summary\n- Completeness/Pattern/Risk Analysis\n- Recommendations\n- Final Verdict (Ready/Revise/Reject)",
92
+ "agentRole": "You are a senior reviewer delivering the final sign-off.",
93
+ "requireConfirmation": false,
94
+ "guidance": [
95
+ "VERDICT: Be clear - Ready or Not?",
96
+ "PRIORITY: Focus on Critical/High issues first"
97
+ ]
136
98
  }
137
99
  ]
138
- }
139
-
100
+ }
@@ -1,24 +1,31 @@
1
1
  {
2
2
  "id": "workflow-diagnose-environment",
3
3
  "name": "Diagnostic: Environment & Subagents",
4
- "description": "A setup wizard to detect your Agentic IDE capabilities and verify Subagent tool access.",
4
+ "version": "1.0.0",
5
+ "description": "Automated capability detection for Agentic IDEs. Probes for subagent access and generates a local configuration file.",
5
6
  "steps": [
6
7
  {
7
- "id": "check-subagent-existence",
8
- "title": "Check for Subagents",
9
- "prompt": "Do you have access to specialized Subagents (e.g., Researcher, Coder)?\n\n- If YES: Please spawn your 'Researcher' subagent now.\n- If NO: You are running in **Tier 1 (Solo Mode)**. No further configuration is needed. You can stop this workflow."
8
+ "id": "step-0-probe-capabilities",
9
+ "title": "Step 0: Probe Subagent Capabilities",
10
+ "prompt": "**INITIATING CAPABILITY PROBE**\n\nI need to determine if this environment supports subagent delegation.\n\n**YOUR MISSION:** Attempt to contact a subagent and verify its tool access.\n\n**EXECUTE:**\n1. Check for existing `.workrail/config.json`. If it exists, read it.\n2. **Active Probe:** Attempt to use the `task` tool (or equivalent) to send a message to a subagent type 'context-researcher' (or 'researcher').\n - *Prompt:* \"Please run `workflow_list` and tell me what you see.\"\n3. **Analyze Result:**\n - **Success:** Subagent replied AND saw workflows. (Tier 3)\n - **Partial:** Subagent replied but saw NO tools. (Tier 2)\n - **Failure:** Tool call failed or no subagent found. (Tier 1)\n\n**WORKING NOTES:**\n- Probe Result (Success/Partial/Fail)\n- Subagent Name (if discovered)\n- Tool Access Verified?",
11
+ "agentRole": "You are a system administrator verifying environment capabilities.",
12
+ "requireConfirmation": false,
13
+ "guidance": [
14
+ "AUTO-DISCOVERY: Try standard names like 'context-researcher', 'researcher', 'coder'.",
15
+ "TOOL CHECK: The specific test is 'Can you see WorkRail tools?'.",
16
+ "FAIL FAST: If the 'task' tool doesn't exist, you are immediately in Tier 1 (Solo)."
17
+ ]
10
18
  },
11
19
  {
12
- "id": "probe-tool-access",
13
- "title": "Probe Tool Access",
14
- "prompt": "We need to verify if your Researcher subagent can access WorkRail tools.\n\nINSTRUCTION:\nAsk your Researcher subagent to execute the tool `workflow_list`.\n\nCompare their output with your own ability to see tools.\n\n- If they SUCCEED: Your environment supports **Tier 3 (Delegation Mode)**.\n- If they FAIL (tool not found): Your environment is in **Tier 2 (Proxy Mode)**.\n\nPlease report which Tier you are in."
15
- },
16
- {
17
- "id": "save-config",
18
- "title": "Save Configuration",
19
- "prompt": "Based on the previous step, I will save your configuration preference.\n\nWrite a file to `.workrail/config.json` with the following content (adjust based on your Tier):\n\nFor Tier 3 (Delegate):\n```json\n{\n \"features\": {\n \"subagents\": true,\n \"delegation\": true\n }\n}\n```\n\nFor Tier 2 (Proxy):\n```json\n{\n \"features\": {\n \"subagents\": true,\n \"delegation\": false\n }\n}\n```\n\nThis will help me optimize future workflows for your environment.",
20
- "requireConfirmation": true
20
+ "id": "step-1-configure-environment",
21
+ "title": "Step 1: Configure Environment",
22
+ "prompt": "**CONFIGURE WORKRAIL ENVIRONMENT**\n\nBased on the probe result, configure the local workspace.\n\n**YOUR MISSION:** Create or update `.workrail/config.json` to reflect reality.\n\n**EXECUTE:**\n1. **Tier 3 (Delegation):**\n - Write config: `{\"mode\": \"delegate\", \"subagents\": {\"researcher\": \"[name]\"}}`\n - Inform user: \"Delegation enabled. Subagent '[name]' connected.\"\n2. **Tier 2 (Proxy):**\n - Write config: `{\"mode\": \"proxy\", \"subagents\": {\"researcher\": \"[name]\"}}`\n - Inform user: \"Proxy mode enabled. Subagent connected but needs tool whitelist fix.\"\n3. **Tier 1 (Solo):**\n - Write config: `{\"mode\": \"solo\"}`\n - Inform user: \"Solo mode enabled. No subagents detected.\"\n\n**DELIVERABLE:**\n- `.workrail/config.json` file created/updated.\n- Brief summary of capabilities detected.",
23
+ "agentRole": "You are a configuration manager ensuring the system is set up correctly.",
24
+ "requireConfirmation": true,
25
+ "guidance": [
26
+ "PERSISTENCE: Use 'write_file' to save the config.",
27
+ "USER INFO: Be clear about what mode is being set and why."
28
+ ]
21
29
  }
22
30
  ]
23
31
  }
24
-