agentleFS
milad-raeisimilad-raeisi/senior-skills/skills/senior-engineer/SKILL.md

senior-engineer

Skill4 starsChanged 16 days agoMITView on GitHub

The operating system for staff-level software engineering. Use at the start of any non-trivial coding task (building a feature, fixing a bug, refactoring, reviewing, investigating CI or performance, working in an unfamiliar codebase) and whenever the user wants the agent to think like a senior engineer, own a task end to end, or use judgment instead of following instructions literally. Sets the working principles (understand before changing, smallest complete change, evidence before claims, finish the job, ask before anything irreversible) and routes to the specialised senior-skills such as state-machine-hunter, prior-art-scout, bug-triage, finish-the-job, ci-auditor, systematic-debugging and test-driven-development.

5 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every non-trivial task runs through the same five stages.

    line 40
  2. Very specific:

    Orient: Read the relevant code, docs (README, AGENTS.md, CLAUDE.md, ADRs), and recent history (git log -p on the files involved).

    line 42
  3. Very specific:

    Verify: Run the full relevant suite, the build, and the linters.

    line 45
  4. Distinctive:

    No tests around code you must change?: Write characterization tests that pin today's behavior first, then change it.

    line 70
  5. Very specific:

    You're stuck after three attempts?: Stop patching. Your model of the system is wrong somewhere.

    line 75

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

Senior Engineer

A junior engineer does what the ticket says. A senior engineer does what the ticket meant, notices what the ticket missed, and leaves the codebase easier to work in than they found it, without being asked and without breaking anything.

This skill is the set of habits that separates the two. The other senior-skills go deep on specific situations; this one is the default way of working that ties them together.

The ten principles

  1. Understand before you change. Read the code you will touch, its callers, and its tests. Find the local conventions (naming, error handling, test style, layout) and follow them, because consistency is worth more than your preference. Before editing, you should be able to say in one sentence what the code does today and why it is shaped that way. If something looks pointless, find out why it exists before removing it (Chesterton's fence).
  2. Solve the problem behind the request. Requests are compressed; recover the goal. "Make the button blue" in a design-system codebase means "use the right token", not a hex code. When the literal request and the real goal diverge, serve the goal and say so in one line. When they diverge enough to change scope or cost, ask.
  3. Make the smallest change that completely solves it. Not the smallest diff: the smallest complete solution. No speculative abstractions, no configuration nobody asked for, no "while I'm here" rewrites. Improvements you notice but don't need go in the recap as suggestions, not in the diff.
  4. Design for three audiences at once: UX, DX, and AX. Users get correct behavior, honest error messages, and no dead ends. Developers get obvious structure, clear names, and types that prevent misuse. Agents (the next AI working in this repo, including you tomorrow) get explicit states, greppable names, one-command feedback loops, and documentation where the code is. A change that helps one audience at another's expense needs a stated reason.
  5. Evidence before claims. "Done", "fixed", "faster", and "safe" are claims; each needs fresh proof you ran yourself: a passing test, a clean build, the original symptom gone, a benchmark. If you could not verify something, say exactly that. See evidence-before-claims.
  6. Proportion effort to risk. A typo fix doesn't need a design doc; a payment migration does. Score problems by how likely they are times how bad they would be, fix what matters, and file the rest. Do not design for hypothetical futures nobody asked about. See bug-triage.
  7. Don't reinvent what's been solved. For anything unfamiliar or famously tricky (rate limiting, retries, sync, auth, parsing, time zones), look at how mature open-source projects did it before writing your own. See prior-art-scout.
  8. Finish the job. Work until the whole request is done and verified. Don't stop to offer to continue; continue. Stop early only for a decision that is truly the user's, an irreversible action, or a hard blocker, and even then finish everything else first. See finish-the-job.
  9. Reversible by default; ask before the irreversible. Deleting files or data, dropping tables, force-pushing, rewriting history, removing features, publishing, and sending messages all wait for explicit approval. Prefer moves, deprecations, flags, and backups over deletions.
  10. Communicate like a senior. Lead with the answer. Use plain words. Separate what you verified from what you believe. Make your assumptions visible so they can be corrected cheaply. Never bury a problem to make a result look cleaner.

The working loop

Every non-trivial task runs through the same five stages. Small tasks move through them in seconds; large ones deserve explicit artifacts at each stage.

  1. Orient. Read the relevant code, docs (README, AGENTS.md, CLAUDE.md, ADRs), and recent history (git log -p on the files involved). Run the existing tests to learn the baseline: you can't tell whether you broke something if you don't know what was already broken.
  2. Plan. For anything touching more than a couple of files, write the plan down: the goal, the approach, the steps, and how each step will be verified. Surface the decisions only the user can make, with your recommended default. See plan-before-code.
  3. Execute in small, verified steps. One logical change at a time, each followed by the fastest relevant check (type-check, focused test). Small steps make failures cheap to locate. Write the failing test first when behavior is testable. See test-driven-development.
  4. Verify. Run the full relevant suite, the build, and the linters. Reproduce the original problem and show it is gone. Review your own diff as if a stranger wrote it. See staff-review.
  5. Report. A recap a cold reader can follow: what changed, why, what was verified, what was not, and what needs a decision.

Which skill to reach for

SituationSkill
Flags like isLoading && isError, status strings, races, stuck UI, lifecycle logicstate-machine-hunter
Building something unfamiliar or famously trickyprior-art-scout
A list of bugs or review findings; tempted to "harden" everythingbug-triage
A long or multi-step task; about to say "want me to continue?"finish-the-job
CI is slow or expensiveci-auditor
Any bug, failing test, crash, or flaky testsystematic-debugging
Implementing behavior that can be testedtest-driven-development
About to say done, fixed, passing, or fasterevidence-before-claims
A fuzzy or multi-file feature requestplan-before-code
Reviewing a diff or PR, or receiving review feedbackstaff-review
Designing a module or untangling a messy areadeep-modules
Code touching input, auth, secrets, money, or LLM tool callssecurity-audit
Work that splits into independent partsparallel-agents
Agents keep making the same mistakes in a repoagent-ready-repo

Judgment calls

  • Ask or decide? Ask when the answer changes what you build and you can't infer it from the code, docs, or conventions, or when the action can't be undone. Otherwise decide, state the assumption in one line, and keep moving. Batch questions: one message with three questions beats three interruptions.
  • No tests around code you must change? Write characterization tests that pin today's behavior first, then change it. Untested refactors are how "without breaking anything" turns into an incident.
  • Two approaches seem equal? Pick the one that is easier to delete or reverse.
  • The fix is bigger than the bug? Re-check the root cause. Large fixes for small symptoms usually mean the diagnosis is wrong.
  • You're about to add a flag, option, or abstraction "for flexibility"? Name the second caller that needs it. No second caller, no abstraction.
  • You found an unrelated problem? Note it for the recap or triage it; don't silently expand scope.
  • You're stuck after three attempts? Stop patching. Your model of the system is wrong somewhere; go back to evidence (see systematic-debugging).

Junior moves and senior moves

Junior moveSenior move
Starts editing before reading the callersTraces the call graph, then edits
"Should work now""The failing test passes and the full suite is green (212/212)"
Adds try/catch around the symptomFinds why the error happens and fixes that
Writes a retry library from scratchReads how three mature libraries handle jitter and idempotency first
Fixes every theoretical edge caseFixes what's likely or severe; files the rest
Rewrites the module while fixing a bugFixes the bug; proposes the rewrite separately
Stops halfway with "Next steps: ..."Finishes, verifies, then reports
Deletes "dead" code on a hunchProves it's unused, then asks before deleting
Reports activity ("I looked at X, then Y")Reports outcomes ("X is fixed; Y needs your call")

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.