Project Rules
Put standing rules in AGENTS.md so every new session already knows how your project works.
The problem this solves
Without notes, every new Grok session starts slightly lost: What test command? Which folder holds art? Are we allowed to add libraries? You end up retyping the same speech every day.
Project rules are Markdown files (human-readable text) that Grok loads automatically and treats as standing instructions for that project.
The main file: AGENTS.md
Create a file named exactly AGENTS.md in the root of your project (the top folder you cd into before running grok).
- Open your project in any editor (or ask Grok to create the file).
- Add short sections in plain English (template below).
- Save. Start a new Grok session in that folder (
/newor restartgrok). - Ask: “Summarize the project rules you are following.” Grok should reflect your file.
# AGENTS.md
## What this project is
A small browser game. Players move and fight one enemy.
## How to run it
Open index.html in a browser. Tests: run `npm test` in the project root.
## Rules for code
- Prefer simple JavaScript modules.
- Do not add new frameworks without asking me first.
- Keep combat math in js/combat-helpers.js when possible.
## Definition of done
1. Tests pass when we have them
2. Game still boots to a playable screen
3. Do not make huge unrelated refactorsGrok also notices names like CLAUDE.md for compatibility. One clear AGENTS.md is enough to start. Global defaults can live in ~/.grok/AGENTS.md for all projects.
Write a 10-line AGENTS.md for any project today. New session → ask Grok to restate how to run tests. If it is wrong, fix the file, not the chat.