agentleFS
niksavisniksavis/basicly/AGENTS.md

basicly

AGENTS.md0 starsChanged 55 days agoMITView on GitHub

Make a wrong use impossible, or stop it at once with the fix (poka-yoke). A refusal in the code acts before the damage. A warning in a document acts after it.

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

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

51 rules. About 1 is common, 36 are distinctive, and 14 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈36

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before non-trivial work, read the repository context: the README, the architecture document and the local overlay.

    line 4
  2. Distinctive:

    When repository evidence and general practice disagree, follow the repository.

    line 5
  3. Distinctive:

    Put the fact that a comment would carry where it stays true: a name, a test name, the tracker record or a README.

    line 12
  4. Distinctive:

    Leave no dead code and no debug output.

    line 26
  5. Distinctive:

    Keep tests deterministic. A bug fix ships with a regression test.

    line 27
  6. Distinctive:

    Keep each rule in one place, and call it from every side.

    line 36
  7. Distinctive:

    When a mistake can happen again, add a gate or a test that refuses it.

    line 37
  8. Common:

    Keep secrets in environment variables or a secret manager, out of the repository and the logs.

    line 43
  9. Distinctive:

    Commit no machine path, user name or host name.

    line 45
  10. Distinctive:

    Stop and ask when a fact is missing, when sources conflict, or when an assumption you cannot check would change the result.

    line 50
  11. Distinctive:

    When rules conflict, follow the safety and security rule.

    line 51
  12. Distinctive:

    When the same approach fails twice, report the pattern and propose another approach.

    line 52
  13. Very specific:

    Do not answer from memory about a third-party interface.

    line 56
  14. Distinctive:

    When two causes predict the same result, say so and change the probe until they differ.

    line 60
  15. Distinctive:

    Ask the user before you:

    line 64
  16. Very specific:

    read or write a .env* file.

    line 67
  17. Distinctive:

    delete files, branches or data outside the task.

    line 68
  18. Distinctive:

    add, remove or upgrade a dependency.

    line 70
  19. Distinctive:

    When a defect, a refusal or a report shows a gap, fix the cause.

    line 81
  20. Distinctive:

    Follow the current practice of the vendors and of community experts, unless it makes install, use or upgrade less safe for a person who …

    line 82
  21. Very specific:

    Start a session with basicly session start.

    line 94
  22. Distinctive:

    Run the repository checks on what you touched, after the last edit.

    line 103
  23. Distinctive:

    Read the pass or fail summary line.

    line 104
  24. Distinctive:

    When you claim that a check covers every item, name the list that the code reads.

    line 106
  25. Distinctive:

    Check a claim against the code before it goes into a plan, a design document, a README or a release note.

    line 107
  26. Distinctive:

    Before you retire a source system, list its files one by one and account for each.

    line 108
  27. Very specific:

    Write catalog sources as YAML, never as a discoverable .md file.

    line 112
  28. Very specific:

    Start a source with basicly catalog new skill or basicly catalog new fragment, and follow the catalog-authoring skill.

    line 113
  29. Very specific:

    Before you end a session, follow the session-finish skill.

    line 117
  30. Distinctive:

    After a refused change or a mistake the user corrected, name the root cause.

    line 118
  31. Distinctive:

    Run these commands as written.

    line 122
  32. Distinctive:

    Test, whole suite then one file:

    line 131
  33. Distinctive:

    Run git commit as its own command.

    line 158
  34. Distinctive:

    When a hook refuses a commit, fix the cause it names and commit again.

    line 160
  35. Distinctive:

    Prefer a cross-platform command to shell-specific behaviour.

    line 164
  36. Very specific:

    Never loop over an unquoted variable (for x in $LIST).

    line 166
  37. Distinctive:

    Before a scripted replace across many sites, state the expected count, and compare it after.

    line 167
  38. Distinctive:

    Before a research or design document recommends a third-party project:

    line 171
  39. Very specific:

    Treat its README as a claim.

    line 173
  40. Distinctive:

    Test an absolute claim by trying to break it.

    line 174
  41. Very specific:

    Read every licence file first, NOTICE included, and check each directory.

    line 175
  42. Distinctive:

    Ask what the author sells.

    line 176
  43. Distinctive:

    Check whether the argument assumes away a control this repository already runs.

    line 177
  44. Very specific:

    Use low only for work whose wrong answer a check catches and a rerun fixes cheaply.

    line 184
  45. Distinctive:

    Check each acceptance criterion against the picture.

    line 197
  46. Very specific:

    Run the overflow check and read both of its signals, render-overflow and render-overlap.

    line 199
  47. Distinctive:

    Write it in the same change.

    line 210
  48. Very specific:

    Test a path rule with both PureWindowsPath and PurePosixPath.

    line 216
  49. Very specific:

    Do not use select or selectors on a pipe, because on Windows they accept only sockets.

    line 218
  50. Distinctive:

    Wait for a condition, not a duration.

    line 219
  51. Very specific:

    Use skipif only when the behaviour cannot exist on the other platform.

    line 220

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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
<!-- Generated by basicly v0.20.2. Do not edit manually. -->

Knowledge Priming

  • Before non-trivial work, read the repository context: the README, the architecture document and the local overlay.
  • When repository evidence and general practice disagree, follow the repository. Say so; do not override it in silence.
  • An instruction from the user in the current task overrides this file. A path-scoped instruction overrides it for the files it matches.

Code Is Authoritative

  • A code file carries no prose: no comment and no docstring. The code is the only source of truth, so a change cannot leave a stale claim beside it.
  • A directive that a tool reads stays: noqa, nosec, type: ignore, pragma: no cover, a shebang, fmt: off, a licence header.
  • Put the fact that a comment would carry where it stays true: a name, a test name, the tracker record or a README. When code needs prose to say what it does, fix the code.
  • The no-comments hook refuses the commit. This command removes the comments:
python3 .basicly/core/kit/comments/cli.py fix <path>

Core Rules

  • Make the smallest diff that meets the requirement. An unrelated change hides which change failed.
  • Build only what the task asks for. A speculative abstraction or an unrequested option is a guess that stays in the code.
  • Reuse before you build. Prove that a capability is absent by reading the code that would use it, not the documentation or --help.
  • Fix the root cause. Check every other call site before you call a fix complete.
  • Match the style and the names of the file you edit.
  • Leave no dead code and no debug output. Never swallow an error: it becomes a wrong answer.
  • Keep tests deterministic. A bug fix ships with a regression test.
  • Back every claim with evidence: the file you read, the command you ran, the test that passed.

Mistake Proofing

Make a wrong use impossible, or stop it at once with the fix (poka-yoke). A refusal in the code acts before the damage. A warning in a document acts after it.

  • Refuse a wrong input by name. Never answer it with a default or an empty result, because both read as success. Say what is wrong and give the correct command.
  • Make the safe behaviour the default. A mode that can damage shared state needs an explicit flag.
  • Keep each rule in one place, and call it from every side. Two copies drift and give two answers.
  • When a mistake can happen again, add a gate or a test that refuses it. A note does not stop it.

Secure Coding

  • Validate external input at the trust boundary. Code past the boundary assumes the input is safe.
  • Pass shell arguments and query values as parameters. Concatenated input runs as syntax.
  • Keep secrets in environment variables or a secret manager, out of the repository and the logs. A commit outlives the fix.
  • Log the internal detail and return a generic message. A stack trace or a path maps the system.
  • Commit no machine path, user name or host name. It breaks the next clone. The tracker's holder field is the one exception: it records the name you choose with git config basicly.holder.

Decision Protocol

  • Decide yourself when the choice rests on code you read, is small, can be undone, and is not on the confirmation list.
  • Stop and ask when a fact is missing, when sources conflict, or when an assumption you cannot check would change the result. Name what is missing and the answer that unblocks you. Offer only options you would take.
  • When rules conflict, follow the safety and security rule.
  • When the same approach fails twice, report the pattern and propose another approach.

External Facts

  • Do not answer from memory about a third-party interface. A flag, field, model id, price, limit or version can change. Read our own adapter first, then the vendor's current documentation. The interface-facts skill gives the steps.
  • An empty search result does not prove absence. Before you report a zero, run a positive control: a search that must match a case you have seen. When the control is also empty, the search is wrong. When it matches, check that the count of examined items moved. If the count did not move, the search never read the control.
  • A capability is absent only when its action is absent, not its name. Before you report that a tool cannot do something, search for what it does, not only for the name you expected.
  • Derive a number twice, by two paths that share no step. When they disagree, suspect the instrument first.
  • When two causes predict the same result, say so and change the probe until they differ.

Require Explicit Confirmation

Ask the user before you:

  • force-push, rewrite history, or discard uncommitted work: git reset --hard, git checkout -- <path>, git restore, git stash, git clean, rm -rf;
  • read or write a .env* file;
  • delete files, branches or data outside the task;
  • edit CI/CD, deployment, infrastructure, ignore or secrets files;
  • add, remove or upgrade a dependency;
  • make a network call outside the task.

The deny-list blocks only some of these, and it differs per agent. A command that runs unblocked still needs confirmation. To undo your own edit, restore the file from a copy you made first.

IMPORTANT: never defeat a gate to make it pass. Do not skip or weaken a test, a lint or a type check, and do not bypass a hook (--no-verify, --no-gpg-sign). Fix the cause.

Ownership

  • You own basicly. You are responsible for the harness and for the process that develops it.
  • Improve both continuously: during development, and after each report from a user or a consumer.
  • When a defect, a refusal or a report shows a gap, fix the cause. Then add the gate, the test or the rule that stops it from happening again.
  • Follow the current practice of the vendors and of community experts, unless it makes install, use or upgrade less safe for a person who makes a mistake.

Project Overview

  • basicly distributes a harness for coding agents. One YAML catalog is projected into agent instruction files, skills and git hooks. Other repositories install it with basicly install.
  • Stack: Python 3.14 or later, managed with uv. The version lives only in src/basicly/__init__.py. Platforms: Linux, tested in CI; macOS and Windows run but CI no longer tests them.
  • The basicly CLI is src/basicly/cli.py. This repository authors the catalog in .basicly/core/; its own overrides are in .basicly-local/. Scripts and CI helpers are in .scripts/.
  • docs/architecture/architecture.md is the authoritative design reference.
  • A change under .basicly/core/kit/ must work for a consumer with no engine. Name where that consumer gets the capability.

Harness Loop

  • Start a session with basicly session start. End it with a note tagged [session handover <date>] on the root record.
  • The tracker ledger is the source of truth for the work.
  • Drive non-trivial work through the harness loop. The harness-loop skill describes the phases, the commands and the checkpoints.

Quality Gate

  • The person pays for two things: time and tokens. Choose the cheapest check that proves the step. Run the tests of what you touched while you iterate, and the whole suite once, before the commit.
  • In a long run, report the elapsed time, the tokens spent where the host shows them, and the items left.
  • Review the diff. Then run the change the way a consumer runs it, and read the output. Passing tests do not prove a working feature.
  • Run the repository checks on what you touched, after the last edit. A later edit can break what passed.
  • Read the pass or fail summary line. Truncated output hides failures.
  • Report only what you ran, and say what you did not run. Do not turn "expected to work" into "works".
  • When you claim that a check covers every item, name the list that the code reads. A general mechanism does not prove which items it covers.
  • Check a claim against the code before it goes into a plan, a design document, a README or a release note. Mark a part that rests on code you did not read as an assumption.
  • Before you retire a source system, list its files one by one and account for each. A check of what the import carried cannot see a file that the import never read.

Catalog Authoring

  • Write catalog sources as YAML, never as a discoverable .md file. In a repository that installs basicly, put your sources in .basicly-local/, because basicly install overwrites .basicly/core/.
  • Start a source with basicly catalog new skill or basicly catalog new fragment, and follow the catalog-authoring skill. basicly catalog lint checks the format.

Session Completion

  • Before you end a session, follow the session-finish skill. Leave the repository clean, with no partial edits and no stray files. Report what changed, what you verified and what is still open.
  • After a refused change or a mistake the user corrected, name the root cause. Propose the fragment, skill or hook change that would have refused it. A note to "be careful" changes nothing.

Commands

Run these commands as written.

Setup:

uv sync --group dev
uv run pre-commit install --install-hooks -t pre-commit -t commit-msg -t pre-push

Test, whole suite then one file:

uv run pytest -q
uv run pytest tests/test_cli.py -q

Lint / format:

uv run ruff check
uv run ruff format --check

Projection gates (after editing catalog sources):

uv run basicly check
uv run basicly skills-check
uv run basicly styles-check
uv run basicly agents-check
uv run basicly hooks-check
uv run basicly permissions-check

Git Discipline

  • Run git commit as its own command. Do not chain git push, a tag or a tracker update after it, because a refused commit leaves the chain half done.
  • The commit-msg hooks require a Conventional Commits subject and a trailing record id. The conventional-commits skill writes the message, and the work-tracker skill claims the record first.
  • When a hook refuses a commit, fix the cause it names and commit again.

Non-Interactive Shell

  • Prefer a cross-platform command to shell-specific behaviour.
  • Pass a non-interactive flag to a command that can wait for an answer: cp -f, mv -f, rm -f, -y, ssh -o BatchMode=yes. Some shells alias these commands to interactive mode.
  • Never loop over an unquoted variable (for x in $LIST). zsh does not split it, so the loop runs once and looks like success. Use an array ("${arr[@]}"), an inline list or one batch command, and check that the count changed.
  • Before a scripted replace across many sites, state the expected count, and compare it after. A different count is a stop.

External Review

Before a research or design document recommends a third-party project:

  • Treat its README as a claim. Find the call sites and cite file:line. A symbol with no non-test caller does not ship.
  • Test an absolute claim by trying to break it. A feature can exist and still be described too strongly.
  • Read every licence file first, NOTICE included, and check each directory. A licence restricts copying the code, not learning a fact from it.
  • Ask what the author sells. A recommended control that is the author's own product needs independent evidence.
  • Check whether the argument assumes away a control this repository already runs.
  • Say whether you established the mechanism or only a correlation.

Model Tier Routing

  • A dispatch declares a tier: low, medium, high or maximum. It never names a provider model id; the tier kit's model map resolves the tier.
  • Choose the tier by the cost per landed correct change: tokens, time and human interventions. A weak model's mistakes return as rework on the same change.
  • Use low only for work whose wrong answer a check catches and a rerun fixes cheaply. Start implementation from prose, decomposition, design and costly judgements at high.
  • A dispatch with no tier is a bug. It inherits the session's own model.

Rendered Surfaces

A rendered page is an image. A page can pass every check and still be unreadable, so look at the picture:

  • Render the page and open the screenshot before you call it done. On WSL, drive Windows Chrome over a UNC path:
chrome.exe --headless=new --disable-gpu --window-size=1920,1080 --screenshot=<win-path> "file://\\\\wsl.localhost\\<distro>\\<path>"
  • Check each acceptance criterion against the picture.
  • Render from real data as well as the fixture. A fixture with fewer rows hides an overflow.
  • Run the overflow check and read both of its signals, render-overflow and render-overlap. A clipped box shows no scrollbar.
uv run python .scripts/check_render_overflow.py <page.html>
  • Shoot every viewport width the layout claims.

Release Fragments

  • A change a consumer can see writes changelog.d/<record-id>.<category>.md before its record closes: one bullet line, under 400 characters.
  • Write it in the same change. The release reads the tagged commit, and a closed record with a shipped scope and no fragment blocks the next commit on main.

Platform-Hermetic Tests

The local gate runs on one OS, and CI runs the others only after the push. So make the platform an input to the test:

  • Test a path rule with both PureWindowsPath and PurePosixPath. Path takes the form of the host.
  • Compare paths as Path objects, or render both sides with the same as_posix().
  • Do not use select or selectors on a pipe, because on Windows they accept only sockets. Read in a thread and bound the read with join(timeout=...).
  • Wait for a condition, not a duration. Measure time with a monotonic clock.
  • Use skipif only when the behaviour cannot exist on the other platform.

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.