Back to public agent skills

Coding-agent reasoning

Reason From Experience

Turn prior coding outcomes into better next actions instead of merely retaining them as memory.

The distinction

Memory is evidence. Intuition changes the move.

Memory answers what happened. Intuition asks what those outcomes imply here, what is materially different now, and why the next move should work when a similar one did not.

Public and installable

Add it to Codex.

Inspect source first
Install prompt
Use $skill-installer to install https://github.com/Agent-Pattern-Labs/public-agent-skills/tree/main/skills/reason-from-experience

Invoke explicitly
Use $reason-from-experience to choose the next coding action from prior attempts and current evidence.

Use this when

Use this skill for stubborn debugging, trial-and-error loops, long sessions, agent handoffs, implementation choices, postmortems, or any moment when another plausible attempt risks repeating the same underlying premise.

The experience loop

  1. Define the target and observable success condition.
  2. Recover only relevant attempts, commands, test outcomes, logs, diffs, and environment facts.
  3. Fingerprint the current situation by symptom, layer, execution path, input, and state change.
  4. Compare that fingerprint with prior attempts and separate causal changes from cosmetic variations.
  5. Explain why the proposed move follows from the comparison, especially when retrying something similar.
  6. Choose the smallest action that distinguishes competing explanations and predict its result.
  7. Run the action, classify the evidence, and update the working model.
  8. Compress the outcome into a conditional lesson with an explicit boundary.

Ten transfer cases

Build intuition by mechanism, not vocabulary.

Each case shows how prior outcomes should change the next move. The full scenario library ships with the skill.

01

A test passes alone but fails in the suite

Investigate state lifetime before local logic because prior execution is the differentiating variable.

02

Longer async retries preserve flakiness

Synchronize on the causal state transition instead of elapsed time.

03

Valid configuration edits have no effect

Verify which file the process reads before changing configuration semantics again.

04

A dependency upgrade exposes a failure

Distinguish a changed contract from newly detected misuse before blaming the dependency.

05

Fresh sessions work while old sessions stay stale

Inspect retained client or edge state before repeating origin-cache changes.

06

A local optimization does not move latency

Remeasure the whole path and optimize the dominant measured component.

07

A parser gains one patch per example

Infer the missing grammar or invariant before adding another branch.

08

Logging makes a concurrency bug disappear

Treat observation as a causal variable and switch to schedule-aware evidence.

09

A migration works only on empty databases

Test representative data shape, locks, and operational conditions before changing syntax.

10

A visual UI fix breaks interaction

Reason about paint order, hit testing, focus, and scrolling as one system.