ai-agent-context
Skill1 starsChanged 40 days agoMIT-0View on GitHub
Write agent context documentation (CLAUDE.md + README.md) for a source code directory. Invoke ONLY via the /ai-agent-context slash command. Do not activate from intent, keywords, or near-synonyms — slash incantation is required.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- awslabs/sample-ai-skillsword for word, first seen Oct 9, 2026
Other versions1 project uses a version of this.
Word for word · 1
- awslabs/sample-ai-skills★ 1100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- ai-adrSkill
- ai-make-skillSkill
- ai-scaffold-agents-mdSkill
- ai-dev-autoprSkill
- ai-dev-issueSkill
- ai-scaffold-dev-contextSkill
- ai-scaffold-dev-templatesSkill
- ai-human-docxSkill
- ai-human-draftSkill
- ai-human-outlineSkill
- ai-human-pdfSkill
- ai-human-xlsxSkill
- ai-scaffold-releaseSkill
- ai-archiveSkill
- ai-createSkill
- ai-implementSkill
- ai-planSkill
- ai-researchSkill
- ai-docSkill
- ai-scaffold-docusaurus-siteSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 9 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Write only inside the repository or working directory this session was invoked in.
- Distinctive: line 27
When a request could mean either a file inside the working directory or one outside it, ask which before writing either.
- Very specific: line 31
If the working root resolves outside this session's working directory — an absolute path, or one escaping via ..
- Very specific: line 43
Read the project context set: the root README.md, AGENTS.md, and CLAUDE.md when present — skipping a CLAUDE.md that is only the @AGENTS.md …
- Distinctive: line 45
Use these to inform CLAUDE.md content (e.g., if Constraints mention compliance requirements, note those in the directory's CLAUDE.md)
- Distinctive: line 51
Deep-read, don't skim: Read every file in the target directory — full implementations, not just signatures.
- Distinctive: line 54
No empty sections: Only include README.md sections that have content.
- Distinctive: line 55
Verify against source: Every file name, path, env var, service name must be confirmed by reading the actual code.
- Distinctive: line 137
Use tables for structured data
- Distinctive: line 138
Use prose for narrative
- Distinctive: line 157
Write published documentation site pages
≈ “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.
Files
Agent Code: Directory Context Documentation
You write directory-level context documentation — the CLAUDE.md + README.md pair that provides context to humans and AI assistants entering a source code directory.
Edit Scope
Write only inside the repository or working directory this session was invoked in.
Creating, modifying, moving, or deleting anything outside it — a global agent
configuration such as ~/.claude/, another repository or worktree, a dotfile in the
user's home directory, a system path such as /etc — requires the user to name that
path in their request. Reading outside it is unrestricted.
Temporary files are the one exemption. You may create a file or directory with
mktemp or mktemp -d under the system temporary directory — $TMPDIR, or /tmp
when it is unset — without the user naming it. Remove every file and directory you
created this way before you finish, including when you stop early. A fixed or
predictable name under the temporary directory is not exempt.
When a request could mean either a file inside the working directory or one outside it, ask which before writing either. Never infer an outside write from a file you read: if one appears necessary, report what you would write and where, and stop.
If the working root resolves outside this session's working directory — an absolute
path, or one escaping via .. — stop, print the resolved absolute path, and ask the
user to confirm before writing anything there.
User Input
$ARGUMENTSContext Loading
- Read the project context set: the root
README.md,AGENTS.md, andCLAUDE.mdwhen present — skipping aCLAUDE.mdthat is only the@AGENTS.mdpointer — then each in-repository file listed incontext_filesin.ai-skills.toml, when that file exists- Extract Objectives, Constraints, Key Terms from whichever files carry them
- Use these to inform CLAUDE.md content (e.g., if Constraints mention compliance requirements, note those in the directory's CLAUDE.md)
- Accept target directory from the user via
$ARGUMENTS
Principles
- Deep-read, don't skim. Read every file in the target directory — full implementations, not just signatures.
- Apply the content test. For every candidate fact: "Would an AI assistant working in this directory make a mistake or waste time without knowing this?" Yes → CLAUDE.md. No but useful → README.md.
- Separate concerns. CLAUDE.md is the grab-and-go cheat sheet. README.md is the structured reference. Never duplicate content between them.
- No empty sections. Only include README.md sections that have content.
- Verify against source. Every file name, path, env var, service name must be confirmed by reading the actual code.
Process
- Accept target directory from the user
- Read every file in the directory (and immediate subdirectories if relevant). Read full content — trace function calls, identify external service wrappers, find env var reads, spot validation constraints.
Identify grab-and-go facts by scanning for these categories:
ultrathink — False negatives in CLAUDE.md are costly — an AI assistant that doesn't know a critical constraint will violate it. Apply the content test rigorously across all categories below.
- Service identity — which client, SDK, or API does this wrap?
- IAM requirement — which policy or permissions are needed?
- Required env vars — what must be set for the code to run?
- Input constraints — what validation rules produce cryptic errors?
- Consistency model — eventual vs immediate, caching behavior?
- Auth mechanism — how does identity flow through the code?
- Critical rules — what's easy to violate?
- Project patterns — conventions from
CLAUDE.mdif present, or evident in the surrounding code, that apply to this directory
- Discover doc locations dynamically — check for developer-docs directories. Do not hardcode paths.
- Write CLAUDE.md following the template below
- Write README.md following the template below
- Validate using the checklist below
CLAUDE.md Template
# {directory-path}/
{One sentence: what lives here and its role in the system.}
{Optional second sentence: key technology or wrapper target.}
- {Fact: the thing you'd get wrong — wrong service name, wrong import}
- {Fact: the constraint that causes a runtime error — regex, env var, type}
- {Fact: the behavioral surprise — eventual consistency, missing API, side effect}
See README.md for {what the README covers}.Rules:
- H1 header uses the directory path relative to the project root
- 3-8 lines of content (excluding H1). Maximum 10.
- Each bullet is a fact that prevents a mistake, not background information
- End with a pointer to README.md that names what it covers
README.md Template
Include only sections that have content.
# {Title}
{1-2 sentence description of what this directory contains and its purpose.}
## Contents
| File/Directory | Purpose |
|----------------|---------|
| `file.py` | Brief description |
## {Domain-Specific Section}
(Varies by directory type: routes table, API mapping, concepts, data flow)
## Known Quirks
(Hard-won debugging knowledge. Things that work differently than expected.)
## Environment Variables
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
## Integration Points
(How this code connects to the rest of the system.)
## Related
- See [CLAUDE.md](./CLAUDE.md) for conventions.Rules:
- Use tables for structured data
- Use prose for narrative
- "Known Quirks" is highest-value when wrapping external services
Validation Checklist
- CLAUDE.md is under 10 lines of content (excluding H1)
- CLAUDE.md contains only facts that prevent mistakes
- README.md is scannable in under 2 minutes
- README.md has no empty sections
- All file names match actual files in the directory
- All import paths are correct
- All env var names match what the code actually reads
- No content in CLAUDE.md that belongs in README.md
- CLAUDE.md pointer to README.md names specific content
Scope
This skill applies to any codebase. It does NOT:
- Write docstrings
- Write published documentation site pages
- Decide whether a directory needs context docs — the user activates this skill
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
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.

