agentleFS
MasihMoafiMasihMoafi/skills/first-principles/SKILL.md

first-principles

Skill7 starsChanged 4 months agoMITView on GitHub

Executable first-principles engineering method for AI agents. Run this on every task to question requirements, delete components, simplify/optimize, accelerate cycle time, and automate.

14 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 13 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the request has multiple plausible meanings, surface the interpretations instead of silently choosing one.

    line 25
  2. Distinctive:

    Ask when ambiguity makes the change risky or likely wrong.

    line 26
  3. Distinctive:

    Stop and name confusion immediately when code, runtime behavior, or requirements disagree.

    line 28
  4. Distinctive:

    Goal: Delete parts or processes until forced to add back at least 5% later.

    line 31
  5. Distinctive:

    Run regression tests to verify functionality remains intact.

    line 36
  6. Distinctive:

    Keep deleting until the boundary of failure is reached, then restore the minimum required to pass.

    line 37
  7. Distinctive:

    Goal: Keep the remaining codebase lean, boring, and readable.

    line 40
  8. Distinctive:

    Write the absolute minimum code that solves the verified problem.

    line 42
  9. Distinctive:

    Do not add speculative features, configurations, abstractions, or shared helpers for single-use logic.

    line 43
  10. Distinctive:

    Avoid error handling for impossible states unless surrounding code explicitly does it.

    line 44
  11. Distinctive:

    Run the cheapest relevant regression checks to ensure speed-ups do not introduce flakes.

    line 55
  12. Distinctive:

    Write automation scripts (Bash) or CI configurations (GitHub Actions, GitLab CI/CD) to run the pipeline.

    line 61
  13. Distinctive:

    Verify that the automation runs end-to-end cleanly without human intervention.

    line 62

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

First-Principles Engineering Method

Intro - What is it?

This skill translates first-principles engineering into a structured, 5-step agent execution protocol. It forces the agent to verify the correctness of the problem trajectory, aggressively trim code, minimize abstractions, and benchmark speed before writing any automation.

Core Stance

  • Correct Trajectory First: The most rigorous phase is requirement checking. Finding the right problem to solve prevents wasting cycles on things that shouldn't exist.
  • Strict Ordering: Question -> Delete -> Simplify/Optimize -> Accelerate -> Automate. Never skip a step or optimize a process that should be deleted.
  • Sovereign Execution: Human steers, agent executes. State assumptions and halt at critical design junctions.

The 5-Step Protocol

1. Question the Requirements (Finding the Trajectory)

  • Goal: Get the requirements as least wrong as possible. Do not solve a problem that shouldn't exist.
  • Procedure:
    • Assume every requirement in the issue or prompt is wrong or sub-optimal.
    • State all assumptions before proposing changes.
    • If the request has multiple plausible meanings, surface the interpretations instead of silently choosing one.
    • Ask when ambiguity makes the change risky or likely wrong.
    • Push back if a simpler or safer approach better serves the core objective.
    • Stop and name confusion immediately when code, runtime behavior, or requirements disagree.

2. Delete the Process (Aggressive Trimming)

  • Goal: Delete parts or processes until forced to add back at least 5% later.
  • Procedure:
    • Review the code or features implemented for the task.
    • Identify parts, configs, or dependencies that can be removed without breaking core functionality.
    • Trim at least 5% of the codebase/features.
    • Run regression tests to verify functionality remains intact.
    • Keep deleting until the boundary of failure is reached, then restore the minimum required to pass.

3. Simplify and Optimize (Surgical Coding)

  • Goal: Keep the remaining codebase lean, boring, and readable.
  • Procedure:
    • Write the absolute minimum code that solves the verified problem.
    • Do not add speculative features, configurations, abstractions, or shared helpers for single-use logic.
    • Avoid error handling for impossible states unless surrounding code explicitly does it.
    • Touch only the lines needed for the request. Do not perform drive-by formatting or adjacent refactors.
    • Match the local repository style exactly.

4. Accelerate Cycle Time (Performance & Speed)

  • Goal: Accelerate execution speed and cycle time without sacrificing performance.
  • Procedure:
    • Instrument and measure execution speed.
    • Locate the slowest paths (bottlenecks).
    • Restructure loops, cache computations, or parallelize tasks.
    • Maintain a short plan with a verification check attached to each acceleration step.
    • Run the cheapest relevant regression checks to ensure speed-ups do not introduce flakes.

5. Automate the Process (CI & Scripting)

  • Goal: Automate the final, optimized state. Never automate a process that has not been optimized.
  • Procedure:
    • Take the simplified, optimized, fast process.
    • Write automation scripts (Bash) or CI configurations (GitHub Actions, GitLab CI/CD) to run the pipeline.
    • Verify that the automation runs end-to-end cleanly without human intervention.

Verification Checklist

  1. Were the requirements questioned and the trajectory approved before writing code?
  2. Was at least 5% of the unnecessary process/code deleted?
  3. Is the code surgical, matching local style, with no speculative abstractions?
  4. Was execution speed measured and optimized?
  5. Does the automation (CI/Bash) run cleanly without human intervention?

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.