---
type: "auto"
tier: "2b"
description: "Before coding/modifying/debugging — analyze first, verify with real tools, never guess or trial-and-error"
alwaysApply: false
load_context:
  - contexts/communication/rules-auto/think-before-action-mechanics.md
triggers:
  - intent: "before coding"
  - intent: "before debugging"
  - intent: "before modifying"
workspaces:
  - engineering
packs:
  - engineering-base
---

# think-before-action

## The Iron Law

```
ANALYZE BEFORE CODING. VERIFY WITH REAL TOOLS. NEVER GUESS.
NO BLIND TRIAL-AND-ERROR. MAX 2 RETRIES PER APPROACH.
```

- Always analyze before coding or modifying anything.
- Never guess behavior — verify using code, data, or tools.
- Prefer targeted inspection (jq, debugger, logs) over brute-force.
- Always verify results after changes (API, UI, tests) using the concrete tool that exercises that surface — `curl` / Playwright / browser for HTTP and UI, debugger / `xdebug` for runtime frames, the project's test runner for behavior.
- When behavior can be defined → prefer test-first / TDD.
- Unclear requirements → precise clarification question, not hidden assumptions.
- Refactors must preserve behavior, validation, examples, and anti-failure guidance unless explicitly changed.
- Do NOT modify code you do not fully understand — read it, trace the flow, then change it.
- Multiple valid frameworks/patterns coexist (Tailwind + Flux, multiple form libs, competing state stores) → do NOT pick one silently — ask. See [`no blind implementation`](../../docs/guidelines/agent-infra/agent-interaction-and-decision-quality.md#2-no-blind-implementation).

## Mechanics — workflow, minimum read set, verify-with-real-tools, no blind retries

The five-step Understand → Analyze → Plan → Implement → Verify workflow, the minimum read set (symbol, callers, tests, abstractions, data), the memory-consult step, the verification matrix, the output-reduction patterns, the no-blind-retries protocol, and the "open files are context, not intent" clause all live in [`contexts/communication/rules-auto/think-before-action-mechanics.md`](../contexts/communication/rules-auto/think-before-action-mechanics.md). The rule above is the obligation surface; the mechanics file is the lookup material.

If analysis is skipped → results are unreliable.
