agentleFS
DeanThompsonDeanThompson/agent-skills/skills/agent-context-files/SKILL.md

agent-context-files

Skill1 starsChanged 6 months agoMITView on GitHub

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.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create concise context files that help coding agents understand a repository without flooding every session with stale or low-value …

    line 12
  2. Distinctive:

    Less is more: keep the always-loaded file short, ideally under 100 lines and usually under 300.

    line 16
  3. Distinctive:

    Avoid policy duplication: do not restate linter, formatter, or test rules that the tooling already enforces.

    line 20
  4. Distinctive:

    Read the current context file.

    line 34
  5. Distinctive:

    Keep or add only instructions that apply across most future agent sessions.

    line 37
  6. Distinctive:

    Verify the result against the checklist.

    line 38
  7. Distinctive:

    Use the file the user names.

    line 42
  8. Distinctive:

    When a repo already has an established context file, update that file instead of creating a competing one.

    line 48
  9. Distinctive:

    Read references/best-practices.md for detailed context-engineering guidance.

    line 100
  10. Distinctive:

    Read references/examples.md for good and bad examples.

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Less is more: keep the always-loaded file short, ideally under 100 lines and usually under 300.
  2. Answer WHAT, WHY, and HOW: project purpose, structure, stack, and verification commands.
  3. Use progressive disclosure: link to detailed docs instead of copying them into the context file.
  4. Prefer pointers over snippets: reference real files and commands that stay maintained by the project.
  5. Avoid policy duplication: do not restate linter, formatter, or test rules that the tooling already enforces.

Workflow

Create A New Context File

  1. Identify the target runtime or file name from the user's request.
  2. Explore the repository structure and existing docs.
  3. Identify the tech stack, project purpose, key directories, and common commands.
  4. Draft the context file with only universal, durable information.
  5. Review against the checklist below.

Improve An Existing Context File

  1. Read the current context file.
  2. Identify issues: too long, stale, task-specific, runtime-specific without reason, duplicated tooling rules, or copied code snippets.
  3. Move detailed material to linked docs when useful.
  4. Keep or add only instructions that apply across most future agent sessions.
  5. 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:

  • The file is short enough to be loaded every session.
  • It covers WHAT, WHY, and HOW.
  • It avoids task-specific instructions.
  • It avoids copied API docs or long code snippets.
  • It points to maintained source files and docs.
  • It does not duplicate formatter, linter, or type-checker rules.
  • It uses runtime-specific language only where needed.

References

  • Read references/best-practices.md for detailed context-engineering guidance.
  • Read references/examples.md for good and bad examples.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.