Project Rules

Put standing rules in AGENTS.md so every new session already knows how your project works.

You have a project folder you can open in Grok

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).

  1. Open your project in any editor (or ask Grok to create the file).
  2. Add short sections in plain English (template below).
  3. Save. Start a new Grok session in that folder (/new or restart grok).
  4. 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 refactors
Other file names

Grok 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.

Lab

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.

Quick check

1. AGENTS.md is best thought of as…
2. After you change AGENTS.md, a good check is…