Agent Context Files
Create concise context files that help coding agents understand a repository without flooding every session with stale or low-value instructions.
Core Principles
- Less is more: keep the always-loaded file short, ideally under 100 lines and usually under 300.
- Answer WHAT, WHY, and HOW: project purpose, structure, stack, and verification commands.
- Use progressive disclosure: link to detailed docs instead of copying them into the context file.
- Prefer pointers over snippets: reference real files and commands that stay maintained by the project.
- Avoid policy duplication: do not restate linter, formatter, or test rules that the tooling already enforces.
Workflow
Create A New Context File
- Identify the target runtime or file name from the user's request.
- Explore the repository structure and existing docs.
- Identify the tech stack, project purpose, key directories, and common commands.
- Draft the context file with only universal, durable information.
- Review against the checklist below.
Improve An Existing Context File
- Read the current context file.
- Identify issues: too long, stale, task-specific, runtime-specific without reason, duplicated tooling rules, or copied code snippets.
- Move detailed material to linked docs when useful.
- Keep or add only instructions that apply across most future agent sessions.
- Verify the result against the checklist.
File Selection
Use the file the user names. If the user does not specify a target:
AGENTS.md: preferred portable default for multi-agent repositories.
CLAUDE.md: use when the project is primarily used with Claude Code.
GEMINI.md, .cursorrules, or other runtime-specific files: use only when requested or already established in the repo.
When a repo already has an established context file, update that file instead of creating a competing one.
Structure Template
# Project Name
Brief description of what this project does.
## Tech Stack
- Language/runtime
- Key frameworks
- Package manager
## Project Structure
- `src/` - Core application code
- `tests/` - Test suite
- `docs/` - Project documentation
## Development Commands
- `make test` - Run tests
- `make lint` - Run lint checks
- `make build` - Build project
## Key Patterns
- Include only non-obvious, durable conventions.
- Link to source files or docs for details.
## Additional Documentation
- `docs/architecture.md` - System architecture
- `docs/testing.md` - Test patterns and fixtures
Checklist
Before finalizing, verify:
References
- Read references/best-practices.md for detailed context-engineering guidance.
- Read references/examples.md for good and bad examples.
Source: DeanThompson/agent-skills — distributed by TomeVault.
1---2name: agent-context-files3description: Create, review, and optimize persistent agent context files such as AGENTS.md, CLAUDE.md, .cursorrules, GEMINI.md, or repository-specific AI assistant instructions. Use when the user asks to create or improve agent instructions, project memory, coding-agent onboarding docs, or context files that should be loaded across sessions. Use when this capability is needed.4---56# Agent Context Files78Create concise context files that help coding agents understand a repository without flooding every session with stale or low-value instructions.910## Core Principles11121. **Less is more**: keep the always-loaded file short, ideally under 100 lines and usually under 300.132. **Answer WHAT, WHY, and HOW**: project purpose, structure, stack, and verification commands.143. **Use progressive disclosure**: link to detailed docs instead of copying them into the context file.154. **Prefer pointers over snippets**: reference real files and commands that stay maintained by the project.165. **Avoid policy duplication**: do not restate linter, formatter, or test rules that the tooling already enforces.1718## Workflow1920### Create A New Context File21221. Identify the target runtime or file name from the user's request.232. Explore the repository structure and existing docs.243. Identify the tech stack, project purpose, key directories, and common commands.254. Draft the context file with only universal, durable information.265. Review against the checklist below.2728### Improve An Existing Context File29301. Read the current context file.312. Identify issues: too long, stale, task-specific, runtime-specific without reason, duplicated tooling rules, or copied code snippets.323. Move detailed material to linked docs when useful.334. Keep or add only instructions that apply across most future agent sessions.345. Verify the result against the checklist.3536## File Selection3738Use the file the user names. If the user does not specify a target:3940- `AGENTS.md`: preferred portable default for multi-agent repositories.41- `CLAUDE.md`: use when the project is primarily used with Claude Code.42- `GEMINI.md`, `.cursorrules`, or other runtime-specific files: use only when requested or already established in the repo.4344When a repo already has an established context file, update that file instead of creating a competing one.4546## Structure Template4748```markdown49# Project Name5051Brief description of what this project does.5253## Tech Stack5455- Language/runtime56- Key frameworks57- Package manager5859## Project Structure6061- `src/` - Core application code62- `tests/` - Test suite63- `docs/` - Project documentation6465## Development Commands6667- `make test` - Run tests68- `make lint` - Run lint checks69- `make build` - Build project7071## Key Patterns7273- Include only non-obvious, durable conventions.74- Link to source files or docs for details.7576## Additional Documentation7778- `docs/architecture.md` - System architecture79- `docs/testing.md` - Test patterns and fixtures80```8182## Checklist8384Before finalizing, verify:8586- [ ] The file is short enough to be loaded every session.87- [ ] It covers WHAT, WHY, and HOW.88- [ ] It avoids task-specific instructions.89- [ ] It avoids copied API docs or long code snippets.90- [ ] It points to maintained source files and docs.91- [ ] It does not duplicate formatter, linter, or type-checker rules.92- [ ] It uses runtime-specific language only where needed.9394## References9596- Read [references/best-practices.md](references/best-practices.md) for detailed context-engineering guidance.97- Read [references/examples.md](references/examples.md) for good and bad examples.9899---100> Source: [DeanThompson/agent-skills](https://github.com/DeanThompson/agent-skills) — distributed by [TomeVault](https://tomevault.io).101<!-- tomevault:4.0:skill_md:2026-05-23 -->