agentleFS
littlebearappslittlebearapps/contextdocs/.claude/skills/ai-context/SKILL.md

ai-context

Skill5 starsChanged 6 months agoMITView on GitHub

Generates, updates, and audits AGENTS-first AI IDE context files. Builds canonical AGENTS.md plus thin bridges for Claude Code, Cursor (modern .cursor/rules/*.mdc), Copilot, Cline (.clinerules/ directory), Windsurf, Gemini CLI, Codex CLI, and OpenCode. Use for creating, regenerating, fixing, or promoting context files — not just checking them.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. meteor/meteor★ 45ksame name

    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 repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check version accuracy, command accuracy, stale paths, bridge contradictions against AGENTS.md, new untracked conventions, MEMORY.md drift, …

    line 91
  2. Very specific:

    Standalone verification: Run bin/context-verify.sh on any platform for 0-100 health scoring without a plugin system.

    line 109

≈ “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

AI Context File Generator

The Signal Gate

Research shows auto-generated context files reduce AI task success by ~3% and increase token costs by 20% (ETH Zurich, Feb 2026). Less is more.

The test for every line: Would removing this cause the AI to make a mistake? If not, cut it.

Include (Non-Discoverable)

  • Non-obvious conventions (import order, naming deviations, spelling locale)
  • Hard constraints ("never use any", "always use direnv exec")
  • Key commands (test, build, deploy, lint)
  • Security rules and environment quirks

Exclude (Discoverable)

Directory listings, dependency lists, architecture overviews, framework conventions, API patterns visible in source, key file tables — agents discover all of these by reading the codebase.

Describe the end state you want, not step-by-step instructions. Consider fixing root causes rather than documenting workarounds (Osmani, 2026).

Line Budgets

FileTargetHard Max
AGENTS.mdUnder 120 lines160 lines
CLAUDE.md bridge10-20 lines80 lines
Other bridge files10-20 lines60 lines

Supported Context Files

FileRolePurpose
AGENTS.mdCanonicalShared identity, commands, conventions, constraints, security notes, monorepo guidance
CLAUDE.mdThin bridgeClaude-specific rules + @AGENTS.md import
.cursor/rules/agents.mdcModern Cursor (default)Frontmatter description, globs, alwaysApply; body imports AGENTS.md
.cursorrulesLegacy CursorOnly emitted if already present; ignored by current Cursor in Agent mode
.github/copilot-instructions.mdOptionalCopilot loads AGENTS.md natively (Aug 2025); only emit for tool-specific scoping
.windsurfrulesCompatibilityWindsurf rule activation/metadata only
.clinerules/agents.mdModern Cline (default)Directory mode; supports paths: frontmatter for path-scoped rules
.clinerulesLegacy ClineFlat-file fallback when already present
GEMINI.mdCompatibilityGemini-specific discovery or extension notes only

Format details and frontmatter examples live in SKILL-reference.md.

Context file vs memory: Context files contain instructions for the agent (shared via git). Memory files (MEMORY.md, agent-memory/) are notes by the agent (local only). Promote recurring memory insights to the appropriate context file.

Generation Workflow

  1. Detect project profile — scan manifests for language, framework, test runner, linter, CI/CD
  2. Extract non-discoverable conventions — import order, naming patterns, commands, security rules, environment quirks
  3. Generate AGENTS.md first — all shared commands, conventions, rules, and security notes in one canonical file (~120 lines; omit Project Structure, architecture, dependency dumps, key-file tables)
  4. Generate bridge files — apply the Signal Gate again. CLAUDE.md uses @AGENTS.md plus Claude-specific additions (.claude/rules/ references, key file pointers, path-scoped guidance). Other bridges reference or subset AGENTS.md and add only tool-specific fields. Cline may add a ## Before Committing checklist. .windsurfrules and GEMINI.md are compatibility bridges — keep them especially lean.

Modes

init — Bootstrap new project

Scan codebase, generate AGENTS.md plus bridges that don't already exist: CLAUDE.md (uses @AGENTS.md), .cursor/rules/agents.mdc (modern Cursor), .windsurfrules, .clinerules/agents.md (directory mode), GEMINI.md. Copilot bridge optional (Copilot loads AGENTS.md natively). Skip files that already exist. Offer Context Guard hooks (Claude Code only), run audit pass, report summary.

Optional flag — --scaffold=six-section: Generate AGENTS.md using the GitHub Blog Apr 2026 six-section template (commands · testing · project structure · code style · git workflow · boundaries). Opt-in only — existing files are not migrated.

update — Incremental drift patching

Compare context file commits vs source commits. Classify changes (scripts → Commands, configs → Conventions, renames → paths). Update AGENTS.md first, then only the bridge files whose tool-specific sections or references changed. Apply surgical edits using Edit — preserve human customisations.

audit — Staleness check

Check version accuracy, command accuracy, stale paths, bridge contradictions against AGENTS.md, new untracked conventions, MEMORY.md drift, Context Guard health.

promote — MEMORY.md → CLAUDE.md

Find convention-like patterns in MEMORY.md ("Always", "Never", "Use", "Prefer"). Cross-reference against CLAUDE.md. Present candidates. Append promoted insights using Edit.

AGENTS.md Spec & Anti-Patterns

Tracks agents.md spec v1.0 via upstream-versions.json; check-upstream Action flags drift. Don't implement draft v1.1 until stable. Don't include discoverable content (trees, deps, architecture), framework docs, secrets, or session-specific state. Always curate auto-generated files.

Platform Notes

AGENTS.md auto-load: Codex CLI, OpenCode, Cursor, Windsurf, Cline, and Copilot load AGENTS.md natively. Claude Code requires @AGENTS.md in CLAUDE.md. Gemini CLI is configurable via context.fileName in settings.json.

Modern Cursor / Cline / Copilot (2026): Cursor uses .cursor/rules/*.mdc with frontmatter; flat .cursorrules is ignored in Agent mode. Cline uses the .clinerules/ directory with optional path-scoped frontmatter. Copilot's coding agent loads AGENTS.md natively (Aug 2025), so the Copilot bridge is optional. Format details and frontmatter examples live in SKILL-reference.md.

Hooks: Context Guard hooks are available on Claude Code (12 events), Gemini CLI (11), Copilot (8, preview), Cursor (4+), Cline (3), and Codex CLI (2, experimental). See the context-guard skill for per-platform setup.

Standalone verification: Run bin/context-verify.sh on any platform for 0-100 health scoring without a plugin system.

Advanced Reference (Claude Code)

For agent/skill frontmatter fields, variable substitution, dynamic context injection, bundled resources, CLAUDE.md advanced features (@import, directory walking, claudeMdExcludes, managed policy), rules system (path-scoped rules, recursive discovery, symlinks), and plugin system (installation scopes, output styles, plugin settings), load the companion reference: SKILL-reference.md

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.