agentleFS
niksavisniksavis/basicly/.github/copilot-instructions.md

basicly

Copilot instructions0 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 copilot-instructions.md into the rules it gives an agent

39 rules. About 0 are common, 30 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈30

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 9

    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. Distinctive:

    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:

    Do not add copies under .github/instructions/, because Copilot then loads the same rule twice.

    line 118
  30. Very specific:

    Prefer a skill to a prompt file.

    line 119
  31. Very specific:

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

    line 123
  32. Distinctive:

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

    line 124
  33. Distinctive:

    Run these commands as written.

    line 128
  34. Distinctive:

    Test, whole suite then one file:

    line 137
  35. Distinctive:

    Run git commit as its own command.

    line 164
  36. Distinctive:

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

    line 166
  37. Distinctive:

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

    line 170
  38. Very specific:

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

    line 172
  39. Distinctive:

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

    line 173

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions 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
copilot-instructions.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.

Copilot Notes

  • .claude/skills/ is generated. Edit its catalog sources.
  • Do not add copies under .github/instructions/, because Copilot then loads the same rule twice.
  • Prefer a skill to a prompt file. Put a custom agent in .github/agents/*.agent.md.

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.

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.