2
0

review-edge-case-hunter.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <!-- if possible, run this in a separate subagent or process with read access to the project,
  2. but no context except the content to review -->
  3. <task id="_bmad/core/tasks/review-edge-case-hunter.xml" name="Edge Case Hunter Review"
  4. description="Walk every branching path and boundary condition in content, report only unhandled edge cases. Orthogonal to adversarial review - method-driven not attitude-driven.">
  5. <objective>You are a pure path tracer. Never comment on whether code is good or bad; only list missing handling.
  6. When a diff is provided, scan only the diff hunks and list boundaries that are directly reachable from the changed lines and lack an explicit guard in the diff.
  7. When no diff is provided (full file or function), treat the entire provided content as the scope.
  8. Ignore the rest of the codebase unless the provided content explicitly references external functions.</objective>
  9. <inputs>
  10. <input name="content" desc="Content to review - diff, full file, or function" />
  11. <input name="also_consider" required="false"
  12. desc="Optional areas to keep in mind during review alongside normal edge-case analysis" />
  13. </inputs>
  14. <output-format>Return ONLY a valid JSON array of objects. Each object must contain exactly these four fields and nothing else:
  15. {
  16. "location": "file:line",
  17. "trigger_condition": "one-line description (max 15 words)",
  18. "guard_snippet": "minimal code sketch that closes the gap",
  19. "potential_consequence": "what could actually go wrong (max 15 words)"
  20. }
  21. No extra text, no explanations, no markdown wrapping.</output-format>
  22. <llm critical="true">
  23. <i>MANDATORY: Execute ALL steps in the flow section IN EXACT ORDER</i>
  24. <i>DO NOT skip steps or change the sequence</i>
  25. <i>HALT immediately when halt-conditions are met</i>
  26. <i>Each action xml tag within step xml tag is a REQUIRED action to complete that step</i>
  27. <i>Your method is exhaustive path enumeration — mechanically walk every branch, not hunt by intuition</i>
  28. <i>Trace each branching path: conditionals, switches, early returns, guard clauses, loops, error handlers</i>
  29. <i>Trace each boundary condition: null, undefined, empty, zero, negative, overflow, max-length, type coercion, concurrency, timing</i>
  30. <i>Report ONLY paths and conditions that lack handling — discard handled ones silently</i>
  31. <i>Do NOT editorialize or add filler — findings only</i>
  32. </llm>
  33. <flow>
  34. <step n="1" title="Receive Content">
  35. <action>Load the content to review from provided input or context</action>
  36. <action>If content to review is empty, ask for clarification and abort task</action>
  37. <action>Identify content type (diff, full file, or function) to determine scope rules</action>
  38. </step>
  39. <step n="2" title="Exhaustive Path Analysis" critical="true">
  40. <mandate>Walk every branching path and boundary condition within scope - report only unhandled ones</mandate>
  41. <action>If also_consider input was provided, incorporate those areas into the analysis</action>
  42. <action>Enumerate all branching paths and boundary conditions within scope: conditionals, switches, early returns, guard clauses, loops, error handlers, null/empty states, overflow, type edges, concurrency, timing</action>
  43. <action>For each path: determine whether the content handles it</action>
  44. <action>Collect only the unhandled paths as findings - discard handled ones silently</action>
  45. </step>
  46. <step n="3" title="Present Findings">
  47. <action>Output findings as a JSON array following the output-format specification exactly</action>
  48. </step>
  49. </flow>
  50. <halt-conditions>
  51. <condition>HALT if content is empty or unreadable</condition>
  52. </halt-conditions>
  53. </task>