agentleFS
MichaelTarasov02MichaelTarasov02/Trail/skills/trail-why/SKILL.md

trail-why

Skill0 starsChanged 3 months agoMITView on GitHub

Answers "why is this code like this" from the decision trail plus git — who decided it, what was rejected, which operator correction produced it, and what was assumed. Use before changing unfamiliar code, when a design looks wrong and you suspect a reason, when an idea feels obvious and may have been tried already, or when reviewing work you did not do. Reads .trail/. Триггеры — "почему так сделано", "кто это решил", "это уже пробовали", "зачем здесь так", "историю по этому файлу", "why is this like this".

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never open with how you searched.

    line 27
  2. Very specific:

    When someone describes an approach they are about to take, check REJECTED before they start:

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “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

Why

The read side of the trail. Without it the record is write-only, and a write-only record stops being written within a month.

Two questions it answers that nothing else can: whose decision was this, and has the thing you are about to propose already been rejected.

Language

Answer in the language the question was asked in. Quote entries verbatim in whatever language they were written in, and do not translate a quoted operator — the exact words are the evidence.

Answer in the conversation, not only in the file

  1. The answer — the reason, in one or two sentences
  2. Who decided it, and when — with the entry and the commit
  3. What was rejected, if anything relevant was
  4. How confident this is — see the confidence rule below

Never open with how you searched. A reader asking "why is this like this" wants the because, not the method.

Search the trail before the code, then check the code against it

grep -rln '<path or symbol>' .trail/entries/ | sort -r        # newest first
grep -rh  '^- DECIDED'  .trail/entries/ | grep -i '<term>'
grep -rh  '^- REJECTED' .trail/entries/ | grep -i '<term>'
grep -rA3 '^- CORRECTION' .trail/entries/ | grep -i -B1 -A3 '<term>'

Then git log the same path. The two disagree more often than is comfortable, and the disagreement is the finding:

Trail saysGit saysWhat it means
a decisiona matching commitanswered; cite both
a decisionthe code has since changedthe reason may be stale — say so and name the later commit
nothingcommits existthe work predates the trail, or nobody recorded it — answer from the code and say the reason is reconstructed
a rejectionsomeone did it anywaythe most valuable finding available; surface it loudly

Say how you know, every time

Three levels, and conflating them is the failure this rule prevents:

LevelMeans
Записаноan entry says this, quoted, with its anchor
Восстановленоinferred from code and commit history; nobody wrote it down
Неизвестноno record and the code does not imply a reason

Неизвестно is a real answer and the honest one for anything predating the trail. An inference presented as a record is how a trail becomes untrustworthy — after that, nobody believes the entries that are records either.

The question worth asking unprompted

When someone describes an approach they are about to take, check REJECTED before they start:

grep -rh '^- REJECTED' .trail/entries/

There are rarely many, they are short, and finding one is worth the whole tool. A rejected approach leaves no code and no commit, so it is proposed again and again until somebody records the reason.

Non-goals

  • Judging whether the decision was right — report it, with its reason.
  • Changing code. This answers questions.
  • Writing new entries: trail-record.
  • Answering from memory of this session. Read the files; a session's recollection of its own reasoning is exactly what the trail exists to replace.

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.