MUST run before any code implementation task. Classifies complexity, discovers local conventions, finds reusable patterns, and prevents blind coding. Invoke this skill before writing or modifying code.
Before writing code, run a focused discovery loop. Do not load everything. Find the right files.
Classify task complexity first:
L0 (trivial): typos, renames, copy-only edits, obvious single-line fixes with no behavior change.L1 (moderate): behavior changes in one bounded area.L2 (high-risk): cross-module changes, data semantics, refactors, architecture-impacting work.Output by level:
L0: no context brief, proceed directly.L1: write a micro-brief.L2: write a full context brief.Re-evaluate level during discovery and implementation. If new evidence shows higher complexity than initially classified, upgrade the level and apply the stricter workflow.
Act like a senior engineer who asks the next useful question:
L1/L2.Ask: "What is likely missing?"
Examples:
Prioritize these in order:
Portable discovery actions:
Look for implicit rules encoded in code:
userId vs user_id) and file placement norms.Stop discovery when confidence is high enough to predict likely review feedback. If you cannot anticipate reviewer concerns yet, keep looking.
For L1, write a micro-brief:
For L2, write a full context brief:
For L1/L2, keep an internal discovery log:
new name -> analog paths -> extracted pattern).Changes should look native to the codebase:
Naming derivation rule:
If requirements conflict with discovered conventions:
After coding:
typecheck, lint/check, tests as needed).L0:
L1/L2:
L0/L1/L2) before discoveryL1/L2