agentleFS
ragnarwestadragnarwestad/aide/core/AGENTS.md

aide / core

AGENTS.md2 starsChanged 25 days agoMITView on GitHub

Instructions for AI-assisted development focused on: - Specs with a 4-file documentation structure - Test-Driven Development (TDD: RED → GREEN → VERIFY) - Automated codebase analysis with file:line references - API impact analysis (frontend ↔ backend) Rules for how the AI assistant presents text in the conversation with the user. Write ordinary, everyday Norwegian. This is the single most repeated piece of feedback the user has given — across projects and across many sessions — and it keeps happening, so…

  • Commits and pushes

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

44 rules. About 0 are common, 40 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈40

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Test-Driven Development (TDD: RED → GREEN → VERIFY)

    line 5
  2. Distinctive:

    Write ordinary, everyday Norwegian.

    line 28
  3. Distinctive:

    Every sentence must stand alone: No phrases that assume the reader followed your reasoning ("husets egen regel", "telleren er på plass — så …

    line 47
  4. Distinctive:

    When the user asks "har vi noe utestående?", "utestående aksjoner?" or any variation, the answer is a numbered list of concrete outstanding …

    line 60
  5. Distinctive:

    If there is genuinely nothing outstanding, say that in one sentence — do not fill the space with a recap.

    line 98
  6. Distinctive:

    Every proposed fix says, in its first sentence, which of the two it is.

    line 111
  7. Distinctive:

    Never blur the two. A fix described half in dashboard terms and half in git terms leaves the user unsure whether he is being handed a task …

    line 124
  8. Distinctive:

    If the pull brings in changes to files you are about to touch, read what changed before proceeding.

    line 181
  9. Distinctive:

    If a later git push is still rejected despite this — a push arrived in the gap between your pull and your push — rebase onto the new …

    line 183
  10. Distinctive:

    Add new files you have created yourself, by explicit name, as soon as you create them.

    line 193
  11. Distinctive:

    When you create new files (documentation, code, tests), run git add for them automatically.

    line 195
  12. Distinctive:

    Add only files you wrote or created yourself.

    line 200
  13. Distinctive:

    Use git mv to rename or convert a file, so its history carries over — git mv country.js country.ts first, then the conversion, then the …

    line 207
  14. Very specific:

    Write commit messages in English, in the imperative mood: "Add unit tests for country.ts", not "Added unit tests" or "La til enhetstester".

    line 220
  15. Very specific:

    Do not add Co-Authored-By lines to commit messages, for any variant (Claude, Copilot, GPT, etc.).

    line 225
  16. Distinctive:

    Keep the changes on a working branch and run only the tests covering the change, plus relevant type, lint or documentation checks.

    line 259
  17. Distinctive:

    Commit and push that working branch to origin.

    line 263
  18. Very specific:

    Run aide merge <project> <branch>.

    line 264
  19. Distinctive:

    Do not merge into the default branch or push it directly from the session in a board-backed project.

    line 269
  20. Distinctive:

    If a simpler approach exists, say so.

    line 317
  21. Distinctive:

    If something is unclear, stop.

    line 318
  22. Distinctive:

    When modifying existing code:

    line 326
  23. Distinctive:

    Leave adjacent code, comments, and formatting as they are.

    line 328
  24. Distinctive:

    Leave working code alone rather than refactoring it.

    line 329
  25. Distinctive:

    Follow the existing style, even if you would have done it differently.

    line 330
  26. Distinctive:

    Leave unrelated dead code in place, and mention it.

    line 331
  27. Distinctive:

    When your changes leave orphaned code behind:

    line 333
  28. Distinctive:

    Remove imports, variables, and functions that *your* changes made unused.

    line 335
  29. Distinctive:

    Leave dead code that was already there, unless asked to remove it.

    line 336
  30. Distinctive:

    Never write "spec N did X because Y" or "on DATE, Z happened" as the justification for a rule inside a living doc.

    line 348
  31. Distinctive:

    Run a test as soon as you create or modify it, and verify it passes before moving on.

    line 459
  32. Distinctive:

    Run the new or changed test immediately.

    line 465
  33. Distinctive:

    Verify that it passes (green ✅).

    line 466
  34. Distinctive:

    Run in the foreground only fast, narrow test files that cover the exact change.

    line 479
  35. Distinctive:

    Run anything slow in the background, announced with what it is and roughly how long, while the job and the conversation continue.

    line 481
  36. Distinctive:

    When the user is waiting to see something, deploy or show it first and verify in the background.

    line 485
  37. Distinctive:

    When it comes back red, list the failing files from that run's own output.

    line 491
  38. Distinctive:

    When every file on the list is green, submit a new Merge for a board-backed session.

    line 493
  39. Distinctive:

    Run it when a change touched interaction behaviour, not as routine after every edit.

    line 529
  40. Distinctive:

    Don't let it run unbounded: if a run overshoots what you told the user it would take, kill it, say so, and hand the suite back rather than …

    line 532
  41. Distinctive:

    Don't use the html reporter — it spawns a server that will not exit.

    line 534
  42. Distinctive:

    Don't list an e2e run as an "outstanding action": the user runs the suite on their own initiative too, and reports when it goes red.

    line 535
  43. Distinctive:

    Run the old code on representative inputs and keep its outputs.

    line 550
  44. Very specific:

    Run tests so the process exits when they are done: vitest --run, not vitest, and the same for any runner with a watch or interactive mode …

    line 562

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
AGENTS.md

Aide — Shared instructions

Instructions for AI-assisted development focused on:

  • Specs with a 4-file documentation structure
  • Test-Driven Development (TDD: RED → GREEN → VERIFY)
  • Automated codebase analysis with file:line references
  • API impact analysis (frontend ↔ backend)

Communication rules

Rules for how the AI assistant presents text in the conversation with the user.

Table of contents

  • Plain Norwegian — no invented or stilted words
  • Answering "do we have anything outstanding?"
  • Lead with the outcome
  • Who fixes it: the dashboard, or me
  • Handing over a spec
  • Suggested text the user will copy out

Plain Norwegian — no invented or stilted words

Write ordinary, everyday Norwegian. This is the single most repeated piece of feedback the user has given — across projects and across many sessions — and it keeps happening, so treat it as a hard rule and re-read your own reply before sending it.

The test: would a Norwegian colleague say this out loud in a conversation? If not, rewrite it.

The three failure types:

  1. Process jargon — "paritet", "skive", "fase", "gate/gated", "lekkasje" (say "frafall"), "trakt", "chrome" (about UI), "bøtte" (bucket), "røret" (pipeline), "maskiner" (say "AI-assistenter").
  2. Anglicisms with Norwegian endings — "scopet", "trigge", "pushe" (outside the git command).
  3. Stilted words where an everyday one exists — "setet" for "hovedstaden", "senteret", and other "finer" synonyms. This one sneaks in when SUMMARISING work that was explained plainly a moment earlier.

One word per thing, all the way through. Having written "hovedstad" in the explanation, write "hovedstad" in the summary too — not a variation. The same goes for the user's own words: if he wrote "FB reels", write "FB reels", never an abstraction over it ("kortvideo-formatet").

Every sentence must stand alone. No phrases that assume the reader followed your reasoning ("husets egen regel", "telleren er på plass — så tallet er ekte"). Spell references out: "regelen i docs/X sier at …".

Don't comment on the user's time or state ("dette kan vente til i morgen", "med friske øyne"). He runs his own evening.

Applies to the chat. English code comments and commit messages stay English.


Answering "do we have anything outstanding?"

When the user asks "har vi noe utestående?", "utestående aksjoner?" or any variation, the answer is a numbered list of concrete outstanding actions — nothing else. Number the points (1., 2., 3. …) so the user can refer to them by number in the reply.

Each point must be:

  • A specific action that is still to be done, described so it can be picked up without more context
  • Something we have actually discussed but not prioritised, or a known bug or gap
  • Followed by a proposed solution — not just the problem. Say what you would do about it.

When the point has several possible solutions the user must choose between, list them as sub-bullets under the point, one per option, each with its advantages, disadvantages and consequences. Consequences means what the choice drags along with it: what else has to change, what it costs, what it locks in. Say which one you would pick and why.

Letter the options a, b, c … under the point's number, so the user can name one as "3c". Write the letter at the start of the sub-bullet — - **a.** Dynamiske tagger. — and keep the lettering restarting at a under every point. The user's reply may then be nothing but a reference like "ta 3c"; treat that as choosing that option and get on with it.

Never include:

  • What has been done, what was committed, or any other status — with one exception: commits not yet pushed. Run git log origin/main..main --oneline in the same reply, and when it lists any, end the list with a point saying they are ready to push, so finished work is not forgotten. In a board-backed session that ends with the branch pushed and aide merge, not with Deploy
  • What is done or followed on the board: a Deploy after a Merge, a Merge waiting in the queue, jobs that are running, or a branch the user has asked to hold until he says so. The board is where the user follows those
  • Whether the working tree is clean, tests are green, or the build passes
  • Backlog headings without content ("see docs/SPEC.md") — write out the actual points
  • Preamble, summary or closing remarks around the list
  • Missing content in the user's own data — an exercise without an illustration, a routine without a description, a record with an empty field. That is the user filling in his own data, not work on the software. It does not belong in the action list, and it does not belong in the project's backlog either. Note it where the data lives (an assets README or similar) if it is worth writing down at all.

If there is genuinely nothing outstanding, say that in one sentence — do not fill the space with a recap.


Lead with the outcome

Lead a reply with the outcome, and leave out detail that would not change what the reader does next.


Who fixes it: the dashboard, or me

Every proposed fix says, in its first sentence, which of the two it is.

It can be done in the dashboard. Describe it in the dashboard's own words — the page, the row, the tab, the button — and stop there. No file paths, no function names, no git. The user does it, and wants to; an explanation loaded with implementation detail takes that away by making a button press look like an operation.

It cannot be done in the dashboard. Say so plainly, say why in one line, and state that this one is mine to do. Then the details belong in the answer, because they describe work the user is not being asked to perform.

Never blur the two. A fix described half in dashboard terms and half in git terms leaves the user unsure whether he is being handed a task or told what happened.


Handing over a spec

A spec agreed in the conversation is handed over as text, and it ends there. The user creates it from the dashboard. Create it only when the user asks, and then with the aide command, which queues it on the board as the New spec form does: aide create <project> "<title>" with the description on standard input, and --depends-on for each dependency. Where aide answers that the project has no board, say so: a spec is created only on a board. Never write, commit or push anything in the specs repo on your own initiative. The format the text is handed over in is the spec-handover skill: load it before writing the text.


Suggested text the user will copy out

Never prefix text the user will paste elsewhere with > (a Slack message, a PR comment, a commit message, an email): the > comes along when copied. Mark it with --- above and below, or a lead-in line. Text whose markdown must arrive intact — a spec, a file's content — goes in a fenced code block instead, since rendered text loses its headings, backticks and bold when copied.


Git rules for AI-assisted development

Table of contents

  • Pulling before new work
  • Staging new files
  • File renaming and conversion
  • Commit messages
    • Format
    • No Co-Authored-By lines
    • No tool in a project's history
    • Structure
  • Pushing and push status

Pulling before new work

Pull the specific repo before creating anything new in it — a file, a spec, a branch — right before writing the first new file, not once at the start of the session. Another session, another machine, or an automated job (an analyze step queued on the board, another person's IDE, a CI step) committing to the same repo while you work is the normal case, not an edge case — specs repos especially, since the dashboard, other sessions and the user's own IDE all write to them continuously.

  1. git pull --ff-only (or git fetch + inspect, when a merge is in question) the specific repo you are about to add something to.
  2. If the pull brings in changes to files you are about to touch, read what changed before proceeding.
  3. If a later git push is still rejected despite this — a push arrived in the gap between your pull and your push — rebase onto the new commits and push again; do not force.

Why: a pull that arrives between your read and your write turns into a rejected push and an avoidable rebase.


Staging new files

Add new files you have created yourself, by explicit name, as soon as you create them.

  1. When you create new files (documentation, code, tests), run git add for them automatically.
  2. Name them explicitly — git add specs/<NN>-PROJ-7890-slug/description.md — rather than git add . or git add -A, both of which sweep in generated files, dependencies (node_modules, vendor), IDE files (.idea/, *.swp) and other unwanted output along with the ones you meant to add.
  3. Add only files you wrote or created yourself. Modified files that are already tracked don't need git add — the user handles committing those in their IDE.

File renaming and conversion

Use git mv to rename or convert a file, so its history carries over — git mv country.js country.ts first, then the conversion, then the commit.

Why: git mv tells git it's the same file under a new name, so git blame, git log, and the history shown in the IDE and on GitHub keep working. Deleting the old file and creating a new one in its place loses that history.


Commit messages

Format

Write commit messages in English, in the imperative mood: "Add unit tests for country.ts", not "Added unit tests" or "La til enhetstester".

No Co-Authored-By lines

Do not add Co-Authored-By lines to commit messages, for any variant (Claude, Copilot, GPT, etc.).

No tool in a project's history

A commit message and a pull request's title and description describe the change, as a developer on the project would. They name no tool: not Aide, not the AI assistant or its model, not a spec, a workflow step or a slash command. The project may have nothing to do with any of them.

The one exception is a repository whose own rules say otherwise — its CLAUDE.md, AGENTS.md, CONTRIBUTING.md or the like. The specs repository is such a place: there the Run /aide-<step> for <spec-folder> subject is how a step is recorded, and the skills say when to write it.

Structure

A subject line saying what the change does, then, when it helps, a blank line and a body saying why, with the context a reader needs.


Pushing and push status

Push only when the user has asked for it in the conversation. One go-ahead is enough: once the user has said "commit and push" (or "put it on the board", "merge it"), later finished work of the same kind in that conversation is committed, pushed and sent on as it is done, without asking again. An agreed clean-up job is finished the same way, its commit and push included. Work with red tests or an open question stays where it is, and the user is told. An action of a new kind — deleting data, touching another repository, starting specs on a board — is still asked about. The user pushes from the IDE otherwise.

Session code changes in a project with an Aide board reach the default branch through Merge. A request to merge or push to main authorizes this sequence:

  1. Keep the changes on a working branch and run only the tests covering the change, plus relevant type, lint or documentation checks. Merge verifies the merged result with the project's configured tests. Base the branch on origin's default branch, never on a branch still waiting in the Merge queue: Merge puts each branch on the default branch as one new commit, and refuses a branch built on one.
  2. Commit and push that working branch to origin.
  3. Run aide merge <project> <branch>. The board tests the merged result, pushes the default branch only when the tests pass, and deletes the source branch.
  4. Report whether the board accepted the job. The board takes the merge from there and reports its outcome. A server change takes effect after Merge and Deploy.

Do not merge into the default branch or push it directly from the session in a board-backed project. Do not bypass Merge because local tests passed, another Merge is running, or the command was refused. Report the refusal and keep the working branch. Projects without a board keep their own merge and test process. The spec-creation exception below still applies to its specs repo.

When a job you committed is done, say so, and say it is ready to push. Run git log origin/main..main --oneline in that same reply and end the report with what it shows: the commits waiting for a push. For board-backed work also report whether the working branch has reached main through Merge; a server change takes effect only after Merge and Deploy. Work that is finished but never pushed gets forgotten; this line is what stops that.

Otherwise, don't report repository state from memory, in any phrasing — "N commits ahead of origin", "tre commits ligger klare", or a count of commits recalled from earlier in the conversation. The same holds for uncommitted changes, what another session or person has or hasn't merged, ahead/behind, staged content. When the user asks, run git status -sb and git log origin/main..main --oneline in the same reply and report the actual result.

Why: the user pushes continuously from the IDE and other sessions commit to the same repo, so any claim about repo state is stale unless it comes from a command run in that same reply.


LLM coding discipline

Behavioral rules that guard against two common LLM failures: silent assumptions and scope creep. Inspired by Andrej Karpathy's observations on where language models fall short when writing code.

Trade-off: These rules favor caution over speed. On trivial tasks, use judgment.

Table of contents

  • Think before you code
  • Surgical changes
  • Documentation describes now, not history
  • See also

Think before you code

State assumptions explicitly and surface trade-offs.

Before implementing:

  • State your assumptions explicitly. If you are unsure, ask.
  • Lay out multiple interpretations when they exist, rather than silently picking one.
  • If a simpler approach exists, say so. Push back when there is reason to.
  • If something is unclear, stop. Put the confusion into words. Ask.

Surgical changes

Touch only what the task requires. Clean up only your own mess.

When modifying existing code:

  • Leave adjacent code, comments, and formatting as they are.
  • Leave working code alone rather than refactoring it.
  • Follow the existing style, even if you would have done it differently.
  • Leave unrelated dead code in place, and mention it.

When your changes leave orphaned code behind:

  • Remove imports, variables, and functions that your changes made unused.
  • Leave dead code that was already there, unless asked to remove it.

Rule of thumb: every line you change should be directly traceable to what the user asked for.


Documentation describes now, not history

A README, a CLAUDE.md, or any other living doc says how the system works TODAY — never a chronicle of how it got there.

  • Never write "spec N did X because Y" or "on DATE, Z happened" as the justification for a rule inside a living doc. Git history, blame and commit messages are where that belongs — a reader of the doc wants the current behavior, not its excavation.
  • State the rule and, if a reason genuinely helps, the ONE-LINE invariant it protects — not the story of the incident that found it.
  • This applies whenever a change happens to touch documentation, not only to a spec whose job is documentation — an implement step that updates a README is bound by this exactly as a dedicated doc spec is.
  • Code comments and test names follow the same rule: they say what the code does and why, and never name the spec, requirement or acceptance criterion that brought it. git log and git blame keep that link.
  • A doc that keeps growing because every change appends its own paragraph of justification is the failure mode this guards against: size should track what the system does, not how many changes it took to get there.

See also

Related principles covered elsewhere, or stated here once:

  • Simplicity first — choose the smallest change that solves the problem asked for, with no speculative abstraction
  • Goal-driven execution (verifiable success criteria, RED → GREEN → REFACTOR) — testing.md and /tdd-coach
  • Never hand-write a spec's files — the spec-structure rule/skill, "Templates"

Testing rules for AI-assisted development

Table of contents

  • Every change ships with its test
  • Replaced behaviour takes its tests with it
  • Core rule
  • Test commands
    • Unit tests
    • E2E tests (Playwright)
  • Red, green, refactor
  • Single-run mode, never watch mode

Every change ships with its test

Fix a bug or add functionality → write the test in the same job. Never as a suggestion afterwards, never as an item on a list of outstanding work.

The user has to ask for this far too often. The pattern to stop: deliver the code, then offer tests as a separate follow-up, or list "this has no test coverage" as an outstanding action. Tests are part of the delivery, like the code compiling.

What to test

  • The rule, not the rendering. What would break silently, in a way nobody sees for weeks. Not the markup — a test that restates the HTML raises a number and catches nothing.
  • A bug fix gets a test for the bug. The failure that was reported is the test case.
  • One place per rule. A rule is proven where it lives — the store, the parser, the helper. A route or page test proves only that it is wired to that rule, once, not every case again.
  • No layout tests. A test does not check how a page looks or where a component sits: no markup, no CSS, no class names, no element order, no widths or positions, in unit tests or browser tests alike. What a page computes — which state a row is in, which action it offers — is logic, and is tested on the function that decides it, not on the HTML it renders. A browser test is for behaviour that only a browser has: a click that starts an action, a live update that arrives.
  • No wording pins. A test does not assert a sentence of a rule, skill, doc or help text. It asserts what code depends on: a name a script calls, a format a parser reads, a copy that must equal its source.
  • One language proves the catalogue. A test that the page reads a translated word needs one language, not one per language.

Prove the test is worth having

Revert the fix temporarily and confirm that exactly that test goes red. A test that passes both with and without the fix is decoration. This takes thirty seconds and is not optional for a bug fix.

When a unit test genuinely cannot reach it

Some things only exist in a browser: shadow-DOM internals, anything that depends on where the camera is pointing, real rendering. Say so plainly, put it in the Playwright suite instead, and say which spec — but never leave the change with nothing at all.


Replaced behaviour takes its tests with it

A change that replaces behaviour deletes the tests for the behaviour it replaced, in the same job. A suite only grows if nothing ever leaves it, and what is left behind is worse than noise: a test named for a control that no longer exists tells the next reader that the control is still a concern.

What goes:

  • A test whose subject is gone — the removed heading, the replaced field, the deleted page.
  • A check that something removed is still absent, once the thing that replaced it is checked in the same test. expect(html).not.toContain('<h3>Config</h3>') beside an assertion on the tab that replaced the heading proves nothing the positive one does not.
  • The comment that only dates the removal. Git says when; the test says what holds now.

What stays: a check where the absence IS the rule, with nothing having replaced it — no colour literal outside the token block, no confirm field on a form that asks in a sentence, no English label on a Norwegian page.

A test left red by the change is not covered by this: fix it or delete it deliberately, and say which in the summary.


Core rule

Run a test as soon as you create or modify it, and verify it passes before moving on.

E2E tests (Playwright) have their own rules — see E2E tests (Playwright); run them only in projects on the quick-suite list kept there, and ask the user elsewhere. Everything below about running tests applies to unit tests.

  1. Run the new or changed test immediately.
  2. Verify that it passes (green ✅). If it fails (red ❌), analyze the error message, fix the problem — either the test or the code — and re-run until it passes.
  3. In a session for a project with an Aide board, run only the tests covering the change and the relevant type, lint or documentation checks. Do not run the full unit or browser suite before commit, push or Merge, including after a rebase or merge. Merge runs the project's configured tests on the merged result before it updates the default branch. See the git rules for aide merge. Without a board, run the full suite before committing as the project requires.

Slow tests never block the session

The job itself often takes seconds; verification must not turn that into a long wait while the user does nothing else.

  • Run in the foreground only fast, narrow test files that cover the exact change. Learn which files in a repo are slow before running anything broad.
  • Run anything slow in the background, announced with what it is and roughly how long, while the job and the conversation continue. Report the result when it arrives.
  • For a project without a board, run the full suite once per job in the background before commit. For a board-backed session, Merge verifies the merged result.
  • When the user is waiting to see something, deploy or show it first and verify in the background.

A red full run is fixed file by file

The full run finds what broke; it does not confirm each fix.

  1. When it comes back red, list the failing files from that run's own output.
  2. Fix them running only the file at hand (bun test <file>, pytest <file>) until each is green.
  3. When every file on the list is green, submit a new Merge for a board-backed session. Otherwise run the full suite again once — never between fixes.

A test that fails in the full run and passes on its own is the machine's load, not a fault: name it, and do not run the full suite again for it.


Test commands

Unit tests

The full-suite command is AIDE_TEST_CMD in .aide/project.yaml (see "Project commands" in the tools-and-scripts rules). Merge uses this command when the project has no configured test selection. A session uses AIDE_TEST_FILES_CMD for named files when configured, or the project's documented file-specific command. Without a configured or documented command, say so rather than guessing one. Always run in single-run mode.

E2E tests (Playwright)

Run the e2e suite where the project's own run is quick and reliable. Keep that list explicit — on this machine it is currently Atlasaurus (since 3 August 2026), PaceUp and Aide (since 27 September 2026). Elsewhere, ask the user to run it.

In a session for a project with a board, run only the browser test files covering the changed interaction. Do not run the full e2e suite before commit or push: Merge runs the configured tests before main is updated. For an Aide change to markdown files only, run scripts/check-docs; no browser test reads them.

The list stays short on purpose: a suite that hangs blocks the session for minutes with nothing to show for it. Where a project's suite is fast, that risk is gone; where it still crawls, ask the user to run it there instead.

Where it is allowed:

  • Say what you are starting and roughly what it costs before launching it — the same courtesy as any open-ended job.
  • Run it when a change touched interaction behaviour, not as routine after every edit; the project's ordinary check command stays the gate.
  • Report the result plainly, failures included, with the output.
  • Don't let it run unbounded: if a run overshoots what you told the user it would take, kill it, say so, and hand the suite back rather than sitting on it.
  • Don't use the html reporter — it spawns a server that will not exit.
  • Don't list an e2e run as an "outstanding action": the user runs the suite on their own initiative too, and reports when it goes red.

Red, green, refactor

New functionality is written test first: a test that fails because the behaviour is missing (red), then the least code that makes it pass (green), then refactoring with the relevant tests and checks. In a board-backed session Merge verifies the merged result. Without a board, follow the project's full-suite requirement.

A rewrite that is meant to keep behaviour, such as a port to another language or a module replaced whole, starts by recording what the old code does:

  1. Run the old code on representative inputs and keep its outputs.
  2. Rewrite one part at a time, and compare each part with those recordings before starting the next.

The recordings prove only that the behaviour stayed the same. A behaviour the rewrite is meant to change gets an ordinary test, with its expected value worked out from the requirement, not from the old output.


Single-run mode, never watch mode

Run tests so the process exits when they are done: vitest --run, not vitest, and the same for any runner with a watch or interactive mode (Jest, gradle --continuous, cargo watch, …). An AI assistant cannot answer a watch mode, so the process stays open, has to be killed by hand, and nobody can tell when the tests finished.

Kill only test processes you started yourself: find them with ps aux | grep "[v]itest" (or the runner's own name) and kill <PID> — never pkill -f node or pkill -f vitest, which take every matching process with them.

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.