agentlink
AGENTS.md0 starsChanged 4 months agoApache-2.0View on GitHub
Shared instructions for every AI coding agent working on agentlink. This file is managed by agentlink itself — CLAUDE.md points here, so editing it from any agent updates all of them. agentlink gives every AI coding agent in a repository the same rules and skills without copying files. Where a tool already reads the canonical path we do nothing; where only the location differs we create a filesystem link; where linking is impossible we write a one-line include stub. Read…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- add-providerSkill
The file
We split this AGENTS.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Read docs/adr/0001-link-instead-of-generate.md before proposing architectural changes.
- Very specific: line 80
Add a dependency without a clear justification.
≈ “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.
Files
AGENTS.md
Shared instructions for every AI coding agent working on agentlink.
This file is managed by agentlink itself — CLAUDE.md points here, so editing it
from any agent updates all of them.
What this project is
agentlink gives every AI coding agent in a repository the same rules and skills without copying files. Where a tool already reads the canonical path we do nothing; where only the location differs we create a filesystem link; where linking is impossible we write a one-line include stub.
Read docs/adr/0001-link-instead-of-generate.md before proposing architectural changes. Most "obvious" alternatives were considered and rejected there for concrete reasons.
Commands
cargo test # unit + integration, ~1s
cargo clippy --all-targets # must be clean
cargo fmt # rustfmt.toml, 100 columns
cargo run -p agentlink-cli -- statusArchitecture
agentlink-cli composition root, human-facing output
↓
agentlink-domain pure domain — no std::fs anywhere
↑
agentlink-fs adapter: symlinks, junctions, privilege probingagentlink-domain never touches the filesystem. It depends on the Workspace
trait; agentlink-fs implements it for real and testing::FakeWorkspace
implements it in memory. That is why tests can simulate Windows without symlink
privileges on a Linux runner.
Planning and execution are separate. status and apply render the same plan,
so nothing happens that was not announced first.
The rule that outranks everything
Never destroy content agentlink did not create.
Any code path that removes, overwrites or relocates a file must consult the lock
file first, and must resolve every ambiguity to a Blocked outcome naming the
fix — never to a guess. If a change seems to need --force, add a diagnostic
instead.
Conventions
- Paths in the domain are
RelPath: normalised, always/-separated, and unable to escape the workspace. Never introduce a rawPathBufintoagentlink-domain. - Adding an agent must stay a single TOML file in
crates/agentlink-domain/providers/. If a change would require Rust to support a new agent, that is a design problem — see ADR 0004. #![forbid(unsafe_code)]in every crate. Windows junctions go through thejunctioncrate.- Tests are named as the sentence they prove:
a_hand_written_file_is_never_replaced, nottest_apply_3. - Conventional Commits.
feat(providers): add <agent>for new agents.
Where to be careful
crates/agentlink-domain/src/plan.rs— the capability lattice. Every new branch needs a test for the case where the user's content is at risk.crates/agentlink-fs/src/lib.rs— the only place with platform-specific code. Windows behaviour differs by privilege, not just by OS.crates/agentlink-domain/src/gitignore.rs— edits a file the user owns. It must preserve surrounding content and existing line endings exactly.
Do not
- Add a dependency without a clear justification; the surface is deliberately
small (
serde,toml,thiserror,clap,anyhow,junction,dialoguerfor the provider picker — terminal key handling is not something to hand-roll across Windows and POSIX). - Introduce hard links. See ADR 0003 — they are undetectable after the fact and silently broken by atomic saves.
- Invent configuration formats. The canonical layout is the community standard.
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
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.

