.github/skills/context-files/SKILL.md
Create or validate project context files (AGENTS.md, CLAUDE.md, GEMINI.md). Use when bootstrapping a new project, initializing agent configuration, writing a context file, or when asked to create, review, audit, or validate an existing context file. Handles codebase archaeology, user interviews, golden-rule validation, and platform-specific formatting. Do NOT use for creating Agent Skills (use creating-agent-skills instead) or .instructions.md files (use agent-customization instead).
npx skillsauth add sergeyklay/groster context-filesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Your job is to dig up the knowledge that is NOT in the code — the traps a new developer hits on day one. Agents waste tokens rediscovering what the team already knows. This skill prevents that.
Before writing any line, ask:
"Can an agent discover this on its own by reading the codebase?"
If yes, delete the line. Agents read package.json, tsconfig.json, directory trees, linter configs, and README files. They know every popular framework. Restating this wastes tokens and dilutes the instructions that matter.
If unclear, ask the user which mode they need.
Ask the user which file they need, or infer from their project:
| File | Platform | Notes |
|------|----------|-------|
| AGENTS.md | Universal (Codex, Cursor, Copilot) | Preferred for multi-platform teams |
| CLAUDE.md | Claude Code | Supports @import syntax |
| GEMINI.md | Gemini CLI | Configurable name via settings.json |
If the project uses multiple platforms, recommend AGENTS.md as the canonical file with bridge files for others. See references/platform-formats.md for platform-specific details.
Scan the codebase for non-discoverable knowledge. Your value is finding what agents miss.
Skip the surface layer (agents already read these):
package.json, composer.json, go.mod, requirements.txt, pyproject.tomltsconfig.json, .eslintrc, .prettierrc, linter configsREADME.md, directory structureDig into the deep layer using references/archaeological-checklist.md:
Build and test traps. Scan Makefile, Justfile, Taskfile.yml, scripts/, package.json scripts, CI configs. Find test commands that differ from the obvious one, build steps with side effects, CI-only steps that must be replicated locally.
Environment traps. Scan .nvmrc, .node-version, .tool-versions, .env.example, docker-compose.yml. Find required runtime versions, environment variables needed to start the app, Docker quirks.
Git and workflow traps. Scan .husky/, .pre-commit-config.yaml, CONTRIBUTING.md. Find pre-commit hooks, branch naming conventions, commit message formats enforced by hooks.
Monorepo structure. Scan pnpm-workspace.yaml, lerna.json, nx.json, turbo.json. Find build order constraints, shared configs that must not be overridden.
Code archaeology. Search for HACK, FIXME, XXX, WORKAROUND, DO NOT, NEVER, WARNING, DEPRECATED in comments. Find off-limits areas, intentional workarounds that look wrong.
Architecture traps. Read source code in key directories. Find custom middleware that resembles standard patterns, database wrappers, auth deviations, API response wrappers, shared cache prefixes or queue names that couple services.
Configuration traps. Scan .npmrc, .yarnrc.yml, composer.json config, .editorconfig. Find private registry URLs, resolution overrides, patched dependencies.
Collect findings silently. Do not output analysis results yet.
Present findings from Phase 1 as context. Ask these questions and stop to wait for the user's response:
Question 1: Landmines. "What breaks if an agent does the obvious thing? What traps does a new developer hit on day one?" Provide 3-5 suspected traps from your analysis.
Question 2: Sacred areas. "What files, directories, or patterns must an agent NEVER touch without permission?" Provide candidates from your analysis (generated code dirs, migration files, shared configs).
Question 3: Non-obvious commands. "Which commands differ from what an agent would guess? (test, build, lint, deploy, migrate)" Provide candidates found in build scripts and CI configs.
Question 4: Unwritten conventions. "What team conventions exist that no linter enforces and no documentation captures?" Give 2-3 examples of what you mean: naming conventions, PR processes, module ownership, error handling philosophy.
Question 5: Refactoring strategy. "When an agent touches legacy code, what should it do?" Options: Strict (enforce current standards on new code, contain old code), Consistent (follow existing patterns), Rewrite (aggressively refactor everything touched).
Synthesize analysis and user answers. Use the template from the Output template section below.
Hard constraints:
For CLAUDE.md or GEMINI.md, adapt the template following the platform-specific conventions in references/platform-formats.md.
Before presenting the file, review every line against the golden rule checklist:
package.json, config files, or the directory tree? → Delete it.Count the remaining lines. If the file exceeds 100 lines, split reference material into separate docs and link from the "Reference docs" section.
Run the validation script on the generated file:
python3 scripts/validate_context_file.py <path-to-generated-file>
If the script is unavailable, use the manual checklist below.
If the user needs multi-platform support, generate bridge files:
@AGENTS.mdRefer to [AGENTS.MD](../AGENTS.md) in .github/copilot-instructions.mdcontext.fileName to ["AGENTS.md", "GEMINI.md"] in .gemini/settings.jsonDo not duplicate content across platform files. One source of truth, references everywhere else.
When the user asks to review an existing context file:
Read the context file and the project's codebase (package.json, config files, README, directory structure).
python3 scripts/validate_context_file.py <path-to-context-file>
If the script is unavailable, proceed with manual review.
For each line in the file, check:
Check against the quality checklist:
Present findings grouped by severity:
Use the template in assets/context-file-template.md. Omit any section that has nothing non-discoverable to say.
For CLAUDE.md or GEMINI.md, adapt the template following the conventions in references/platform-formats.md.
These constraints apply to you, the generator agent:
.github/instructions/ files or Agent Skills. If you find yourself writing code, stop.development
Transform raw feature descriptions, bug reports, or ideas into structured task documents with YAML frontmatter and standardized sections. Use when asked to 'create a task', 'write a task file', 'structure this feature', 'turn this into a task', 'make a ticket', or when a .tasks/ directory exists and the user provides an unstructured feature description. Also use when refining or reformatting existing task files. Do NOT use for Jira ticket creation, spec writing, or implementation planning.
development
Use when asked to commit, save, or persist changes to Git. Handles atomic commits, branch safety, Conventional Commits format, and project style matching. Do NOT use for pushing, creating PRs, or branch management beyond safety checks.
research
Use when asked to create a pull request, open a PR, or submit changes for review. Handles branch verification, change analysis, title and description generation, and gh pr create. Do NOT use for committing (use git-commit), pushing without PR, or reviewing existing PRs.
development
Fetch commit history between package versions from GitHub when changelog is unavailable. Use this skill when (1) changelog analysis failed to provide sufficient information, (2) changelog exists but breaking changes are unclear, (3) evaluating packages without public release notes. Works with both npm/yarn (Node.js) and Composer (PHP) packages. Requires the package repository to be publicly accessible on GitHub.