Egor Urvanov

AGENTS.md and CLAUDE.md, specs, rules and skillsWhat an agent should know about a project and where to keep it

Four kinds of persistent context for AI (AGENTS.md, CLAUDE.md, skills): the task spec, the project bible, rules and skills. What goes into each, when it enters the context, and what ChatGPT and Claude offer. Based on Anthropic, OpenAI, GitHub, Cursor and Cline docs.

· 5 min · · Specs and context

Specwhat to build in one taskfor one task
Biblewhat the product isat task start
Ruleshow to work in the projectevery session
Skillhow to run a procedureon call

A model does not remember a project between sessions. Four kinds of files give that context back.

Four layers of context

LayerWhat goes inWhen in contextFiles
Specrequirements, plan, steps of one taskfor one taskspec.md · plan.md · tasks.md
Bibleproduct goal, users, decisionsat task startprojectbrief.md · productContext.md
Rulescommands, style, prohibitionsevery sessionCLAUDE.md · AGENTS.md · .cursor/rules
Skillprocedure with examples and scriptsdescription always, body on callSKILL.md
Takeaway
In this exampleThe layers differ in lifetime and in when they enter the context.
In generalRules load into every session, so they are kept short: Anthropic recommends under 200 lines per file. Long and rarely used content moves into skills, whose body loads only on call.
Next stepGo through your instructions file: keep facts in the rules, move procedures into skills and the product description into the bible.

Spec: one task before the code

A spec describes the task before work starts: first what and why, then how.

1Principlesonce per project
→
2Specwhat and why
→
3Planhow
→
4Taskssteps
→
5Implementcode step by step

Main steps of GitHub Spec Kit. How to split a large spec into parts: Specs by aggregates

Takeaway
In this exampleSpec Kit takes a task from project principles through the spec and plan to steps and code.
In generalRequirements are written before the code, and the review checks the result against that text. How a spec fits into the harness is covered in HDD and specs.
Next stepFor a task longer than a day, write a spec: what, why and how you will know it is done.

Project bible: what the product is

The bible is a standing description of the product: why it exists, who it serves, how it works and what has been decided. The term comes from practice; the closest documented analogue is Cline’s Memory Bank.

projectbrief.mdgoals and requirements
productContext.mdwhy it exists, what it solves
systemPatterns.mdarchitecture and patterns
techContext.mdstack and constraints
activeContext.mdcurrent focus and next steps
progress.mdwhat works, what is left
Takeaway
In this exampleSix Memory Bank files: from the product goal to current progress.
In generalThe bible answers the questions otherwise asked in every new chat: what the product is, which decisions were made, what is in progress. The current-context file changes most often.
Next stepStart with one file: product goal, users, key terms and recent decisions with dates.

Rules: in every session

Rules are instructions the harness puts at the start of every session.

CLAUDE.md
Claude Code, path-scoped rules in .claude/rules/
AGENTS.md
“A README for agents”: Codex, Cursor, Gemini CLI, Copilot and others
.cursor/rules
Cursor, four ways to apply
When a rule enters the context · Cursor
Alwaysevery chat
By descriptionthe agent decides
By filespath pattern matches
Manually@rule
≤ 200lines per CLAUDE.md file
Takeaway
In this exampleThree formats of one idea: an instructions file the harness reads at the start.
In generalRules stay context, and the model can break them; an action that must never happen is blocked with a hook. The more specific and concise a rule, the more consistently it is followed.
Next stepCreate AGENTS.md or CLAUDE.md: build and test commands, code style, prohibitions. Move folder-specific rules into path-scoped rules.

Skills: a procedure on call

A skill is a folder with a SKILL.md instruction, examples and scripts for a recurring procedure.

Session start
reportPR reviewreleaseclient email
name + description
↓ the agent picked “PR review”
On call
SKILL.mdinstructions, examples, scripts
full body
Takeaway
In this exampleDescriptions of all skills are always in context; the body loads once one is picked.
In generalSo a long reference inside a skill costs almost nothing until it is used. A skill is worth creating when the same instruction or checklist keeps being pasted into chat, or when a section of the rules has grown into a procedure.
Next stepFind a section of your rules that describes a procedure and move it into a skill with a precise description of when to use it.

The same in a chat: projects and skills

Project instructions ≈ rules
Role and format once, for every chat in the project
Project files ≈ bible
Sample replies, policies and templates live in the project
Skills = skills
A repeatable workflow with instructions and examples
Takeaway
In this exampleThree places where a prompt outlives a single chat: instructions, files and skills.
In generalA role, examples and format moved into a project work in every new chat without copying. A shared project gives the whole team one set of examples.
Next stepCreate a project for your most frequent weekly task and move the role and format from your best prompt into its instructions.

What goes where

If it is…Where
a command, style or prohibition needed in every taskRules
a multi-step procedure needed now and thenSkill
requirements for one taskSpec
product knowledge and decisions madeBible
an agent error that keeps coming backrule or check · HDD
Takeaway
In this exampleFive situations and five places.
In generalFrequency and lifetime decide the place. What is always needed is kept short; what is rarely needed can be detailed.
Next stepReview the rules once a week: move procedures into skills and decisions into the bible with a date.

Further reading

Based on Anthropic, OpenAI, GitHub, Cursor and Cline docs; the source is behind the icon next to each claim. “Project bible” is a practitioner term; paraphrases are marked in the source tooltip.
  • AI
  • Claude Code
  • CLAUDE.md
  • harness
  • specs
  • skills
© 2026 Egor Urvanov