agentleFS
simonsysunsimonsysun/seeklink/AGENTS.md

seeklink

AGENTS.md11 starsChanged 7 months agoMITView on GitHub

The source of truth is the repository and git history. Sessions, chat context, local notes, and worktrees are convenience layers only. Important state must be recoverable from repo files or git history. Keep this file short. Add rules only when they affect agent behavior or prevent repeated mistakes. Before editing: Do not rely on chat history as project memory. Use docs/current_focus.md for current work state only. Keep it under 30 lines. It should contain: - current task; - branch; -…

  • Reads credentials
  • Commits and pushes
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,691 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 repository2 other files it gives its agents.

The file

Show its rules and text

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

43 rules. About 0 are common, 34 are distinctive, and 9 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈34

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Keep this file short. Add rules only when they affect agent behavior or prevent repeated mistakes.

    line 10
  2. Very specific:

    Read docs/current_focus.md if it exists.

    line 17
  3. Distinctive:

    Check branch and git status.

    line 18
  4. Distinctive:

    Do not rely on chat history as project memory.

    line 22
  5. Very specific:

    Use docs/current_focus.md for current work state only.

    line 26
  6. Distinctive:

    Do not create changelog, backlog, task tracker, memory, or per-agent state files unless explicitly requested.

    line 46
  7. Distinctive:

    Commit messages are the primary history layer.

    line 51
  8. Distinctive:

    Use commit bodies to explain why non-trivial changes were made.

    line 53
  9. Very specific:

    Use docs/decisions.md only for decisions that remain active constraints on future work.

    line 55
  10. Distinctive:

    Do not mirror every commit into decision docs.

    line 64
  11. Very specific:

    If docs/decisions.md grows beyond roughly 10 active decisions, propose moving to docs/decisions/YYYY-MM-DD-<slug>.md ADR files.

    line 69
  12. Distinctive:

    When you need to understand why code is shaped a certain way:

    line 74
  13. Very specific:

    Read docs/decisions.md if present.

    line 77
  14. Distinctive:

    Do not infer historical intent from code alone when relevant git history exists.

    line 83
  15. Distinctive:

    Use one logical change per commit when practical.

    line 87
  16. Distinctive:

    Do not use commit bodies as file-by-file summaries.

    line 97
  17. Distinctive:

    use the current session unless the task truly branches.

    line 117
  18. Distinctive:

    Use a worktree only when both are true:

    line 119
  19. Distinctive:

    When parallel work is needed:

    line 123
  20. Distinctive:

    use consistent names for branch, worktree, and main session when practical.

    line 125
  21. Distinctive:

    If the current task should be isolated in a new worktree, stop before editing and tell the human:

    line 129
  22. Very specific:

    Do not create a generic worktree for a role such as codex-review.

    line 136
  23. Distinctive:

    Do not reuse a long-running reviewer session across unrelated tasks.

    line 148
  24. Distinctive:

    If review fixes require editing, use the primary implementation session or create a task-specific branch/worktree.

    line 154
  25. Very specific:

    Never merge to main unless docs/current_focus.md contains a human-written marker:

    line 159
  26. Distinctive:

    When feature branch work is complete:

    line 166
  27. Distinctive:

    Commit and push the feature branch.

    line 169
  28. Very specific:

    Update docs/current_focus.md with a handoff marked ready for review.

    line 170
  29. Distinctive:

    When the approval marker is present, use the standard merge sequence unless repo state makes it unsafe:

    line 173
  30. Distinctive:

    Do not rebase, squash, or choose a different merge strategy unless the human explicitly says so.

    line 179
  31. Very specific:

    If there are merge conflicts, stop, list conflict files in docs/current_focus.md, and wait for the human.

    line 182
  32. Distinctive:

    Do not reuse a stale approval marker for a later merge.

    line 185
  33. Distinctive:

    Do not modify unless explicitly required:

    line 194
  34. Distinctive:

    If a protected file must change, explain why before changing it.

    line 200
  35. Distinctive:

    Before claiming work is done, run the relevant project checks.

    line 204
  36. Distinctive:

    If verification commands are missing or unclear, discover them before asking the human:

    line 206
  37. Distinctive:

    read README and project docs.

    line 208
  38. Distinctive:

    Do not ask the human to name test commands before inspecting the project.

    line 213
  39. Distinctive:

    When commands are discovered and proven useful, propose updating this section with:

    line 215
  40. Distinctive:

    If checks cannot run, report the exact reason and what was verified instead.

    line 227
  41. Distinctive:

    Do not make broad refactors while fixing a narrow bug.

    line 234
  42. Distinctive:

    Ask before adding production dependencies.

    line 235
  43. Distinctive:

    If corrected twice on the same issue in one session, stop and reassess the approach.

    line 236

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 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

Project conventions for AI coding agents

Core model

The source of truth is the repository and git history.

Sessions, chat context, local notes, and worktrees are convenience layers only. Important state must be recoverable from repo files or git history.

Keep this file short. Add rules only when they affect agent behavior or prevent repeated mistakes.

Start of session

Before editing:

  1. Read docs/current_focus.md if it exists.
  2. Check branch and git status.
  3. Identify relevant verification commands.
  4. For non-trivial changes, state the approach before writing code.

Do not rely on chat history as project memory.

Current focus

Use docs/current_focus.md for current work state only. Keep it under 30 lines.

It should contain:

  • current task;
  • branch;
  • next concrete step;
  • open questions;
  • verification commands;
  • at most the latest two handoff notes.

Rewrite stale content instead of appending indefinitely.

Handoff format:

Handoff (YYYY-MM-DD, Agent, branch)

Done: <completed work> Open: <unresolved items> Next: <next concrete step> Status: <in progress / blocked / ready for review>

Do not create changelog, backlog, task tracker, memory, or per-agent state files unless explicitly requested.

History and decisions

Commit messages are the primary history layer.

Use commit bodies to explain why non-trivial changes were made.

Use docs/decisions.md only for decisions that remain active constraints on future work. Do not create it by default.

Decision docs are appropriate when a decision:

  • spans multiple commits or subsystems;
  • involves external context not visible in code;
  • prevents a recurring wrong choice;
  • affects public API, data model, deployment, security, or product behavior.

Do not mirror every commit into decision docs.

Agents may propose decision entries, but must not create or update long-lived decision records unless the human approves the decision text.

If docs/decisions.md grows beyond roughly 10 active decisions, propose moving to docs/decisions/YYYY-MM-DD-<slug>.md ADR files.

History lookup

When you need to understand why code is shaped a certain way:

  1. Read docs/current_focus.md.
  2. Read docs/decisions.md if present.
  3. Use git history:
    • git log --oneline -- <path>
    • git show <commit>
    • git blame <path>

Do not infer historical intent from code alone when relevant git history exists.

Commits

Use one logical change per commit when practical.

Small obvious commits may use only a subject line.

For non-trivial commits, include a body with:

  • Why: reason this change exists
  • Decision: design choice made, if any
  • Rejected: alternatives considered, if useful
  • Verification: checks run

Do not use commit bodies as file-by-file summaries.

Example:

refactor(auth): move token parsing into middleware

Why: upcoming API routes need consistent auth behavior, and handler-level parsing was causing inconsistent error responses.

Decision: middleware is the single enforcement point for request auth.

Rejected: a shared helper would reduce duplication but still rely on each route remembering to call it.

Verification: pnpm test auth, pnpm typecheck

Branches, sessions, and worktrees

Default:

  • one task = one branch;
  • use the current session unless the task truly branches.

Use a worktree only when both are true:

  • files will be modified; and
  • another branch, task, or agent may need to modify files at the same time.

When parallel work is needed:

  • one task = one branch = one worktree = one primary session;
  • use consistent names for branch, worktree, and main session when practical.

Agents must not silently create new worktrees or assume a new session exists.

If the current task should be isolated in a new worktree, stop before editing and tell the human:

  • why a worktree is needed;
  • proposed branch name;
  • proposed worktree path;
  • command to create it.

Do not create a generic worktree for a role such as codex-review. Worktrees are task/branch containers, not reviewer containers.

Second review

A second-review agent is read-only by default.

For Claude-triggered Codex reviews, prefer a fresh ephemeral non-interactive run per branch, commit, or diff:

codex exec --ephemeral --sandbox read-only "<review prompt>"

Do not reuse a long-running reviewer session across unrelated tasks.

A reviewer may inspect files and report findings, but must not modify files, commit, push, or update docs/current_focus.md unless the human explicitly asks for a patch.

If review fixes require editing, use the primary implementation session or create a task-specific branch/worktree.

Merge protocol

Never merge to main unless docs/current_focus.md contains a human-written marker:

APPROVED FOR MERGE: <branch-name>

The marker is single-use and applies only to the named branch.

When feature branch work is complete:

  1. Run required verification.
  2. Commit and push the feature branch.
  3. Update docs/current_focus.md with a handoff marked ready for review.
  4. Stop.

When the approval marker is present, use the standard merge sequence unless repo state makes it unsafe:

git switch main && git pull && git merge --no-ff <branch> && git push git worktree remove <path> && git branch -d <branch>

Do not rebase, squash, or choose a different merge strategy unless the human explicitly says so.

If there are merge conflicts, stop, list conflict files in docs/current_focus.md, and wait for the human.

Do not reuse a stale approval marker for a later merge.

Boundaries

Do not modify:

  • .env, .env.*
  • secrets, credentials, private keys
  • generated output directories such as dist/, build/, .next/, coverage/

Do not modify unless explicitly required:

  • lockfiles
  • applied migrations
  • vendored dependencies
  • generated client code

If a protected file must change, explain why before changing it.

Verification

Before claiming work is done, run the relevant project checks.

If verification commands are missing or unclear, discover them before asking the human:

  • read README and project docs;
  • inspect package scripts and build files;
  • identify the smallest useful smoke check;
  • identify full test, lint, typecheck, and build commands when available.

Do not ask the human to name test commands before inspecting the project.

When commands are discovered and proven useful, propose updating this section with:

Smoke:

  • <command>

Full:

  • <command>

Lint/typecheck/build:

  • <command>

If checks cannot run, report the exact reason and what was verified instead.

Done means verified, not merely implemented.

Working style

Prefer small diffs. Do not make broad refactors while fixing a narrow bug. Ask before adding production dependencies. If corrected twice on the same issue in one session, stop and reassess the approach.

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.