Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

step-03-detail-pass.md 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Step 3: Detail Pass
  2. Display: `Orientation → Walkthrough → [Detail Pass] → Testing`
  3. ## Follow Global Step Rules in SKILL.md
  4. - The detail pass surfaces what the human should **think about**, not what the code got wrong. Machine hardening already handled correctness. This activates risk awareness.
  5. - The LLM detects risk category by pattern. The human judges significance. Do not assign severity scores or numeric rankings — ordering by blast radius (below) is sequencing for readability, not a severity judgment.
  6. - If no high-risk spots exist, say so explicitly. Do not invent findings.
  7. ## IDENTIFY RISK SPOTS
  8. Scan the diff for changes touching risk-sensitive patterns. Look for 2–5 spots where a mistake would have the highest blast radius — not the most complex code, but the code where being wrong costs the most.
  9. Risk categories to detect:
  10. - `[auth]` — authentication, authorization, session, token, permission, access control
  11. - `[public API]` — new/changed endpoints, exports, public methods, interface contracts
  12. - `[schema]` — database migrations, schema changes, data model modifications, serialization
  13. - `[billing]` — payment, pricing, subscription, metering, usage tracking
  14. - `[infra]` — deployment, CI/CD, environment variables, config files, infrastructure
  15. - `[security]` — input validation, sanitization, crypto, secrets, CORS, CSP
  16. - `[config]` — feature flags, environment-dependent behavior, defaults
  17. - `[other]` — anything risk-sensitive that doesn't fit the above (e.g., concurrency, data privacy, backwards compatibility). Use a descriptive tag.
  18. Sequence spots so the highest blast radius comes first (how much breaks if this is wrong), not by diff order or file order. If more than 5 spots qualify, show the top 5 and note: "N additional spots omitted — ask if you want the full list."
  19. If the change has no spots matching these patterns, state: "No high-risk spots found in this change — the diff speaks for itself." Do not force findings.
  20. ## SURFACE MACHINE HARDENING FINDINGS
  21. Check whether the spec has a `## Spec Change Log` section with entries (populated by adversarial review loops).
  22. - **If entries exist:** Read them. Surface findings that are instructive for the human reviewer — not bugs that were already fixed, but decisions the review loop flagged that the human should be aware of. Format: brief summary of what was flagged and what was decided.
  23. - **If no entries or no spec:** Skip this section entirely. Do not mention it.
  24. ## PRESENT
  25. Output as a single message:
  26. ```
  27. Orientation → Walkthrough → [Detail Pass] → Testing
  28. ```
  29. ### Risk Spots
  30. For each spot, one line:
  31. ```
  32. - `path:line` — [tag] reason-phrase
  33. ```
  34. Example:
  35. ```
  36. - `src/auth/middleware.ts:42` — [auth] New token validation bypasses rate limiter
  37. - `migrations/003_add_index.sql:7` — [schema] Index on high-write table, check lock behavior
  38. - `api/routes/billing.ts:118` — [billing] Metering calculation changed, verify idempotency
  39. ```
  40. ### Machine Hardening (only if findings exist)
  41. ```
  42. ### Machine Hardening
  43. - Finding summary — what was flagged, what was decided
  44. - ...
  45. ```
  46. ### Closing menu
  47. End the message with:
  48. ```
  49. ---
  50. You've seen the design and the risk landscape. From here:
  51. - **"dig into [area]"** — I'll deep-dive that specific area with correctness focus
  52. - **"next"** — I'll suggest how to observe the behavior
  53. ```
  54. ## EARLY EXIT
  55. If at any point the human signals they want to make a decision about this {change_type} (e.g., "let's ship it", "this needs a rethink", "I'm done reviewing", or anything suggesting they're ready to decide), confirm their intent:
  56. - If they want to **approve and ship** → read fully and follow `./step-05-wrapup.md`
  57. - If they want to **reject and rework** → read fully and follow `./step-05-wrapup.md`
  58. - If you misread them → acknowledge and continue the current step.
  59. ## TARGETED RE-REVIEW
  60. When the human says "dig into [area]" (e.g., "dig into the auth changes", "dig into the schema migration"):
  61. 1. If the specified area does not map to any code in the diff, say so: "I don't see [area] in this change — did you mean something else?" Return to the closing menu.
  62. 2. Identify all code locations in the diff relevant to the specified area.
  63. 3. Read each location in full context (not just the diff hunk — read surrounding code).
  64. 4. Shift to **correctness mode**: trace edge cases, check boundary conditions, verify error handling, look for off-by-one errors, race conditions, resource leaks.
  65. 5. Present findings as a compact list — each finding is `path:line` + what you found + why it matters.
  66. 6. If nothing concerning is found, say so: "Looked closely at [area] — nothing concerning. The implementation is solid."
  67. 7. After presenting, show only the closing menu (not the full risk spots list again).
  68. The human can trigger multiple targeted re-reviews. Each time, present new findings and the closing menu only.
  69. ## NEXT
  70. Read fully and follow `./step-04-testing.md`