agentleFS
lutzleonhardtlutzleonhardt/casefile/skills/why/SKILL.md

why

Skill4 starsChanged 59 days agoMITView on GitHub

Answer why a line of code is the way it is.

112 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use addskill, apply-firmware 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.
  • ryanportfolioSkill

    addskill

    Create, import, update, or install repo or personal skills: runtime ownership, resources, discovery checks.

    Also in 6 projects that use this

  • ryanportfolioSkill

    apply-firmware

    Bring current folder (plain folder, existing repo, old or partial firmware copy) up to full Harness Firmware in place. Mirror external repo → adopt-repo.

    Also in 6 projects that use this

  • +10 more from ryanportfolio

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 106 edited versions we read keep these.

  • 1

    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:

    Never re-implement the blame → note → log chain by hand.

    line 34
  2. Distinctive:

    If the linked log is a squash summary and does not answer the question, select the relevant source log from its index.

    line 42
  3. Very specific:

    Mechanical blame hit?: If the blamed commit is clearly formatting, a rename, or a sweep, the reason lives deeper: git log …

    line 49

“Common” is measured: kept by at least 6 in 10 of the 106 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

Why (/why FILE:LINE)

The user points at code and asks why it is the way it is. Do not speculate from the code — pull the case file.

Input — $ARGUMENTS

  • FILE:LINE — the primary form (e.g. /why src/auth.ts:120).
  • A bare FILE plus a quoted snippet or symbol: locate the line first (rg -n), then proceed. If the location stays ambiguous, ask instead of guessing.

Workflow

  1. Run the CLI to retrieve the linked log:

    casefile why FILE:LINE

    It blames the line, resolves the commit, and prints the linked task log — via git note in casefile mode; in home mode via the co-committed log or, for a later commit of a task that landed as a series (/commit-split), via the task-N: subject and the log in that commit's tree. Use --head N only when the log is very long. Never re-implement the blame → note → log chain by hand; if casefile is not on PATH, stop and point at the kit's installer.

  2. Read what it printed. The answer usually lives in ### Key Decisions (what was decided, why, and what was rejected), ### Root Cause (fix-lane logs), or the one-line ### Task summary.

    If the linked log is a squash summary and does not answer the question, select the relevant source log from its index. Resolve relative links from the summary's directory and read only the logs needed for this question. Cite the additional hop: FILE:LINE → squash → summary → source log, including the source section. If the source is missing or inconclusive, state that limit.

  3. Mechanical blame hit? If the blamed commit is clearly formatting, a rename, or a sweep, the reason lives deeper: git log -L<LINE>,<LINE>:<FILE> walks the line's history and shows each commit's note (tasklog: pointer) inline — follow the first substantive commit's log instead.
  4. No linked log (no note and no co-committed task log): fall back honestly — git log -1 <sha> for the commit message, casefile search '<term>' for related logs in casefile mode. Say explicitly that no log is linked; do not dress a guess up as provenance.

Output shape

Keep it compact:

  • Answer: 1–3 sentences — the reason, sourced from the log or commit, not inferred from the code.
  • Evidence: the chain FILE:LINE → <sha> (<subject>) → <log path>, plus the log section(s) the answer rests on.
  • Caveat — only when needed: the line changed after the log was written, the log contradicts the current code, or no log exists.

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.