From automaker-tools
This skill should be used when the user asks to "create context files", "optimize CLAUDE.md for Automaker", "set up .automaker/context", "improve AI agent context", "create context-metadata.json", or wants to optimize how AI agents understand their project in Automaker. Also use when discussing context file best practices or agent prompt customization for Automaker projects.
How this skill is triggered — by the user, by Claude, or both
Slash command
/automaker-tools:context-optimizerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create and optimize `.automaker/context/` files so Automaker's AI agents have high-quality project knowledge injected into every prompt.
Create and optimize .automaker/context/ files so Automaker's AI agents have high-quality project knowledge injected into every prompt.
Automaker's loadContextFiles() reads all .md and .txt files from .automaker/context/ and prepends them to every agent prompt — both interactive chat and auto-mode feature execution. Files are prefixed with: "You MUST follow the rules and conventions defined in these context files."
Descriptions from context-metadata.json are included alongside each file. When autoLoadClaudeMd=true in settings, the SDK also loads CLAUDE.md via settingSources — avoid duplicating content already in the project-root CLAUDE.md.
Before writing context files, gather:
package.json, requirements.txt, go.mod, Cargo.toml, etc.package.json scripts, Makefile, CI configsCreate .automaker/context/CLAUDE.md with these sections:
# Project Context
## Overview
[One paragraph: what the project does, who it's for, current state]
## Tech Stack
[Exact frameworks, versions, key dependencies]
## Directory Structure
[Key directories and their purposes — not exhaustive, focus on what agents need]
## Commands
[Build, test, lint, dev server — exact commands]
## Coding Conventions
[Import patterns, naming, file organization, error handling]
## Critical Rules
[NEVER do X, ALWAYS do Y — use imperative language]
Split concerns into focused files when CLAUDE.md exceeds 2500 words:
| File | Purpose |
|---|---|
CODE_QUALITY.md | Linting rules, formatting, type strictness |
API_CONVENTIONS.md | Route patterns, response shapes, error codes |
TESTING.md | Test framework, fixture patterns, coverage rules |
SECURITY.md | Auth patterns, input validation, secret handling |
ARCHITECTURE.md | Module boundaries, dependency rules, data flow |
Create .automaker/context/context-metadata.json:
{
"files": {
"CLAUDE.md": {
"description": "Primary project instructions, tech stack, and coding conventions"
},
"CODE_QUALITY.md": {
"description": "Code quality standards, linting rules, and formatting requirements"
}
}
}
Write descriptions that help agents understand each file's relevance before loading it.
Apply these optimization techniques:
src/lib/logger.ts), not vague referencescreateLogger() from @pkg/utils" not "You should use..."console.log — use createLogger() instead"autoLoadClaudeMd=true, do not repeat project-root CLAUDE.md contentsrc/routes/auth.ts for new endpoints"High value (always include):
Medium value (include for complex projects):
Low value (agents can discover from code):
context-metadata.json schema and description writing guide, see references/metadata-format.mdnpx claudepluginhub jbactad/claude-pluginsCreates minimal, high-signal CLAUDE.md and AGENTS.md context files for repos using empirical best practices. Triggers on /init, create/update requests, or missing context during brainstorming.
Generates optimized project-context.md files for AI agent consistency. Activates when users mention 'project context' or 'generate context'.
Optimizes AI agent context setup with rules files (CLAUDE.md), specs, source files, and hierarchy. Use for new sessions, degrading output, task switches, or project configuration.