agentleFS
lennytoolslennytools/lenny/skills/first-principles/SKILL.md

first-principles

Skill1 starsChanged 2 months agoMITView on GitHub

Use when a problem is being approached by analogy, convention, or "how it's always done," and you need the actually-correct answer rather than a copied one. The classical first-principles method - decompose the problem to its fundamental, undeniable truths, then reason UP from only those. Distinct from elon-first-principles (which deletes scope from a design) and karpathy (which measures reality); this one derives the right answer from scratch.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use second-order-thinking, inversion and 3 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.
  • itzcullSkill

    second-order-thinking

    Use second-order thinking to examine consequences beyond immediate effects. Use when evaluating decisions across time horizons, asking what happens next, or avoiding short-sighted optimization.

    Also in 3 projects that use this

  • itzcullSkill

    inversion

    Use inversion to solve problems by reasoning backward from failure, bad outcomes, or the opposite of success. Use when identifying risks, running premortems, or escaping overly idealized thinking.

    Also in 3 projects that use this

  • Ingramradical235Skill

    pre-mortem

    Pre-mortem analysis, scenario planning, future state narratives, and contingency frameworks. Use before finalizing any Strategy Kernel, when planning major initiatives, or when preparing Plan B triggers.

    Also in 3 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 3 projects that use this

The file

Files
SKILL.md

First Principles - Reason Up From What's Actually True

Most answers are inherited: we do X because that's how it's done, because a competitor does it, because the framework defaults to it, because it worked last time. First-principles thinking refuses the inheritance. You boil the problem down to the few things that are fundamentally, physically, logically true - and rebuild the answer from only those. The result is often something the analogy-followers never reach.

The method

  1. State the real goal - the outcome that actually matters, stripped of the current solution. Not "make the cron job faster" but "the user needs fresh data within N seconds." The current implementation is not the goal.
  2. List the fundamental truths. What is actually constrained - by physics, math, the protocol, the money, the data that exists? These are the things that remain true no matter who's solving it or how. Separate them ruthlessly from assumptions ("we've always…", "everyone uses…", "the library wants…") which are NOT truths - they're conventions, and conventions are negotiable.
  3. Challenge every "requirement" until it's a truth or it's gone. For each constraint someone hands you, ask: is this physically/logically necessary, or is it just convention/habit/someone's preference? Attach a name and a reason to each. If it can't survive that, it's not a constraint - drop it from the foundation.
  4. Rebuild from the truths only. Construct the solution using only what survived step 2–3. Ignore how it's normally done. The point is to derive what the fundamentals permit, which is frequently far better (cheaper, simpler, faster) than the inherited approach.
  5. Then sanity-check against reality (hand to karpathy: go measure) and strip to the minimum (hand to elon-first-principles: delete what the goal doesn't need).

The discipline

  • Reasoning by analogy ("X is like Y, so do what Y does") is the default failure mode - fast, comfortable, and often wrong. First principles is slower and derives the answer instead of copying it.
  • The phrase "because that's how it's done" is a flag that you've stopped at a convention, not a truth. Push through it.
  • A "constraint" with no physical/logical/economic reason behind it is an assumption wearing a costume. Take the costume off.

The finish

Done = you can trace the solution back to a small set of things that are actually true, with every inherited assumption either justified as a real constraint or discarded. If a step rests on "that's just how it's done," you haven't finished reasoning.

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.