Skip to content

Instantly share code, notes, and snippets.

@jtemporal
Created August 30, 2026 02:31
Show Gist options
  • Select an option

  • Save jtemporal/f04a7ca7a72a0958dc87f1f6e1407c45 to your computer and use it in GitHub Desktop.

Select an option

Save jtemporal/f04a7ca7a72a0958dc87f1f6e1407c45 to your computer and use it in GitHub Desktop.

AGENTS.md

Rules for AI agents working in this repo. Read this file first.

This is a starting template. Delete what does not apply, and make every rule specific to how you actually work. Generic rules get ignored; yours will not.


What this project is

One short paragraph: what this project does and who it is for. Then a pointer to the few files worth reading first, so the agent does not try to load the whole tree.

Area Start here
Main entry point path/to/main
Core logic path/to/...
Config / constants path/to/...

Ignore unless debugging build/packaging: build/, dist/, node_modules/.


Issues are the project memory

Prefer the issue tracker over rereading the code for intent and status. The code says what exists; the issues say why, what is unfinished, and what was already decided.

  • Every feature or non-trivial fix gets an issue before work starts.
  • The issue body is a living document: summary, motivation, acceptance criteria, decisions.
  • Progress goes in comments, so anyone (or any agent) can continue from the issue alone.
  • Find work with gh issue list, not by scrolling files.

Work in a worktree, never on main

All implementation happens in a git worktree, never on main in the primary checkout.

  • Primary checkout stays on the default branch, used only for pull, status, cleanup.
  • Every feature gets its own worktree, its own branch tied to the issue, its own PR.
  • One issue, one worktree, one branch, one PR.
git fetch origin
git worktree add ../project-<slug> -b issue-<N>-<slug> origin/main
cd ../project-<slug>

Why: an agent commits wherever it happens to be standing. Keep that place off main.


Commit maturity

A commit marks a mature, tested unit of work, not "after every file" and not "only when asked."

A change is ready to commit when it:

  1. Does one clear thing (one concern, one step).
  2. Has been tested in the way that change actually calls for.
  3. Is stable, you would not immediately amend it, and debug leftovers are gone.
  4. Can be read on its own, without the next unfinished change to make sense.

Keep commits atomic, one logical change each. If the message needs "and" three times, it is really three commits. The message explains why, not which files moved.


Hard rules

The constraints that are easy to break when moving fast. Replace these with yours.

  • Never delete data destructively (drop a database, empty a table). Migrate instead.
  • No new network calls in an offline/privacy-sensitive tool.
  • If a change has a desktop and a mobile side, change both or scope one in an issue.
  • Never commit secrets. Never force-push main. Do not commit build artifacts.

How to start a task

  1. Read this file.
  2. gh issue list / gh issue view <N> to load intent and acceptance criteria.
  3. No issue yet? Create one, then proceed.
  4. Create a worktree for that issue.
  5. Implement only what the acceptance criteria require.
  6. Comment on the issue with progress, blockers, and decisions.
  7. Commit in small atomic pieces once each unit is mature; open a PR when the criteria are met.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment