agentleFS
junjunjunbongjunjunjunbong/into-the-unknown/skills/diagnose/SKILL.md

diagnose

Skill0 starsChanged 5 months agoMITView on GitHub

When a long-horizon task comes back wrong, trace which unknown caused the miss and which technique would have caught it, then set up the retry. Use when the user says "this isn't what I wanted", a big change misses the mark, or a session's result came back wrong.

126 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use zoom-out, to-issues and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Hollis36Skill

    zoom-out

    Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.

    Also in 38 projects that use this

  • ninehillsSkill

    to-issues

    Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices.

    Also in 34 projects that use this

  • Hollis36Skill

    to-prd

    Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.

    Also in 38 projects that use this

  • kayamanSkill

    edit-article

    Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.

    Also in 11 projects that use this

  • kayamanSkill

    request-refactor-plan

    Guides creating a detailed refactor plan with tiny commits via user interview, then files it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

    Also in 9 projects that use this

  • AnasX7Skill

    scaffold-exercises

    Create exercise directory structures with sections, problems, solutions, and explainers that pass linting. Use when user wants to scaffold exercises, create exercise stubs, or set up a new course section.

    Also in 13 projects that use this

  • +2 more from kayaman

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 114 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read implementation-notes.md Deviations first — misfires often live in a logged deviation where the conservative guess was still the wrong …

    line 21
  2. Very specific:

    Check .unknowns/decisions.md and the plan: was the fatal choice recorded anywhere, or was it never surfaced as a choice at all?

    line 22
  3. Distinctive:

    Write the one-line lesson in the form *"next time, {technique} before {phase}"* (e.g.

    line 46
  4. Distinctive:

    Don't rebuild from scratch reflexively — say which parts of the existing work survive the diagnosis and reuse them.

    line 56
  5. Distinctive:

    Start — always: if the file exists, read it silently.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 114 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Diagnose a Misfire

No-input gate: if invoked with no arguments and the conversation doesn't already identify what came back wrong, your entire response is one question asking for it. Do not write files, produce artifacts, or demonstrate on an invented example until it's named.

"When a long-horizon task comes back wrong, it's likely you need to spend more time defining your unknowns or creating an implementation plan that allows for the agent to improvise through them."

A wrong result is not (usually) a model failure — it's data about the gap between the map and the territory. The instinct is to patch the prompt and rerun; resist it until you know which unknown caused the miss, or the retry inherits the same gap. Each diagnosed misfire also converts an unknown into intuition — this is how the user gets better at agentic coding, which is the real long game.

Step 1 — Locate the earliest divergence

Compare three things: what was asked (the prompt/plan), what was built, and what was wanted (ask the user to describe the miss in their own words — "wrong how?").

Then find the earliest point where the work went somewhere the user didn't want:

  • Read implementation-notes.md Deviations first — misfires often live in a logged deviation where the conservative guess was still the wrong guess.
  • Check .unknowns/decisions.md and the plan: was the fatal choice recorded anywhere, or was it never surfaced as a choice at all?
  • Walk the diff / conversation backward from the wrong outcome to the first decision that presupposed it.

Name the divergence in one sentence: "At {point}, the agent assumed {X}; you wanted {Y}."

Step 2 — Classify the missed unknown

Which kind of gap was it? Each kind has a different fix:

The missDiagnosisWhat would have caught it
"It's obvious I wanted X — I just never said it"Unknown known (taste/assumption never verbalized)/brainstorm — a prototype would have triggered the reaction earlier
"Good question, I never decided that"Known unknown (open question nobody answered)/interview — it was an askable Tier-1/2 question
"Neither of us could have known — the codebase/domain surprised us"Unknown unknown (territory surprise)/blindspot up front, or a plan with wider improvisation room + /impl-notes escalation
"You did exactly what I said, and it was the wrong thing"Over-specification — instructions followed off a cliffState intent, not steps; give the plan improvisation room to pivot
"You filled the gap with generic best practice that doesn't fit here"Under-specification/reference or explicit criteria — generic-in means generic-out

Tell the user the classification plainly, including when the diagnosis is "the prompt was fine; this one's on the execution" — false self-blame teaches the wrong lesson too.

Step 3 — Bank the lesson

Before any retry:

  • Append the newly-verbalized criterion or decision to .unknowns/decisions.md — the retry must inherit it for free.
  • Write the one-line lesson in the form "next time, {technique} before {phase}" (e.g. "next time, prototype the empty state before wiring data"). If the same lesson has appeared before, say so — a repeated lesson means the pre-implementation routine has a systematic hole, not bad luck.

Step 4 — Route the retry

Scale the retry to the size of the gap:

  • Small gap (one criterion missed, structure sound) → targeted fix in this session with the banked criterion.
  • Framing gap (right problem, wrong shape) → back to /brainstorm or /interview with the diagnosis as input, then re-plan the affected part.
  • Wrong problem altogether (the miss revealed the task should be solved differently) → back to /discovery and re-scope. Going backward here is the process working, not failing.

Don't rebuild from scratch reflexively — say which parts of the existing work survive the diagnosis and reuse them.

Unknowns ledger (silent, but always updated)

.unknowns/ledger.md is the cross-session index of open unknowns. The file work is mandatory; talking about it is not.

  • Start — always: if the file exists, read it silently. Don't re-ask what's already settled; do target what's open.
  • End — always: if this pass opened or settled ANY unknown, write the delta to the file before finishing (create the file on its first real entry). This write is non-negotiable — skipping it is how continuity between sessions dies. If nothing opened or settled, leave the file alone.
  • Chat side — quiet: keep ledger details out of chat, keep file upkeep agent-owned, and never block on it. At most one plain sentence of movement ("Settled: dense tables. Still open: conflict policy — defaulting to last-write-wins."), skipped when nothing moved. Mention a U# only when it disambiguates.
  • What counts as settled: the diagnosis retroactively names the item that was missed; the banked lesson settles it. Settled means the user said or confirmed it — writing it into a report does not count.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.