Help us improve
Share bugs, ideas, or general feedback.
From devops-skills
Generates or updates AGENTS.md/CLAUDE.md files for AI coding agents by auto-scanning project files combined with interactive Q&A. Supports multiple tech stacks and preserves customizations when updating.
npx claudepluginhub thienanblog/awesome-ai-agent-skills --plugin project-development-skillsHow this skill is triggered — by the user, by Claude, or both
Slash command
/devops-skills:agents-md-generatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill helps you generate comprehensive instruction files (AGENTS.md with optional CLAUDE.md compatibility) that teach AI coding agents how to work effectively in your project. It combines automatic project scanning with interactive questions to create tailored guidelines.
PROGRESS.mdROADMAP.mdassets/templates/generic.mdassets/templates/laravel-backend.mdassets/templates/laravel-fullstack.mdassets/templates/node-backend.mdassets/templates/python-backend.mdassets/templates/react-frontend.mdassets/templates/vue-frontend.mdreferences/merge-strategy.mdreferences/section-templates.mdreferences/tech-stack-detection.mdscripts/archive-roadmap-progressscripts/archive-roadmap-progress.cmdscripts/archive-roadmap-progress.ps1scripts/archive-roadmap-progress.shscripts/detect-agent-contextscripts/detect-agent-context.cmdscripts/detect-agent-context.ps1scripts/detect-agent-context.shGenerates AGENTS.md files in repo folders (root, src/tests/api, monorepos) with build commands, testing, code style, structure, boundaries for coding agents. Only if missing.
Creates 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 and maintains AGENTS.md files for AI agent onboarding and codebase documentation, with scripts to detect project structure, extract build commands, CI rules, and verify freshness.
Share bugs, ideas, or general feedback.
This skill helps you generate comprehensive instruction files (AGENTS.md with optional CLAUDE.md compatibility) that teach AI coding agents how to work effectively in your project. It combines automatic project scanning with interactive questions to create tailored guidelines.
When to use this skill:
Do not duplicate specialized skills. If a request falls into a specialized domain (e.g., Design System), delegate to the specialized skill when available.
Use AGENTS.md as the shared project manual. AGENTS.md is plain Markdown with no required fields. Cover the details an agent needs to work effectively: project overview, build and test commands, code style, testing expectations, security notes, PR/commit rules, and deployment gotchas.
Handle AGENTS.override.md as a Codex-specific override, not the default. Codex checks AGENTS.override.md before AGENTS.md at both global and project-directory scopes, and includes at most one instruction file per directory. If both files exist in the same directory, Codex uses AGENTS.override.md and ignores that directory's AGENTS.md. Create or update AGENTS.override.md only when the user explicitly wants a Codex-specific or nested-directory override.
Respect Codex instruction discovery. Codex builds its instruction chain once per run/session: global instructions first, then project files from repository root down to the current working directory. The global Codex directory defaults to ~/.codex and can be changed with CODEX_HOME. Files closer to the current directory appear later and override earlier guidance. Codex skips empty files and stops adding files when the combined size reaches project_doc_max_bytes (32 KiB by default). If ~/.codex/config.toml defines project_doc_fallback_filenames, Codex checks those names after AGENTS.override.md and AGENTS.md.
Use CLAUDE.md only as Claude Code compatibility by default. Claude Code reads CLAUDE.md, not AGENTS.md directly, so a shared setup needs a CLAUDE.md file that imports AGENTS.md.
To generate a new AGENTS.md file:
When this skill asks numbered questions with lettered options, users can answer in any style:
1a 2b 3c1a 2b 3c 4b (also scan packages/*) 5dShort form is never required; it is only provided for convenience.
Interactive Mode (Default):
Quick Mode:
Check for existing files:
CLAUDE.md, AGENTS.md, and AGENTS.override.md in the project root.AGENTS.md exists, ask user: "I found an existing AGENTS.md. Would you like to:"
1 or update; 2 or replace; 3 or cancelCLAUDE.md exists but AGENTS.md does not, ask user before changing it:
AGENTS.md as the primary file and replace CLAUDE.md with a compatibility reference to AGENTS.mdCLAUDE.md and AGENTS.md side by side with separate instructions for different AI agents1 or migrate; 2 or keep both; 3 or cancelAGENTS.md and CLAUDE.md exist, ask whether AGENTS.md should become the single source of truth with CLAUDE.md referencing it, or whether the user intentionally wants both files to remain independent.AGENTS.override.md exists, explain that Codex gives it priority over AGENTS.md in that directory. Ask whether to update the override, merge it back into AGENTS.md, or leave it as a Codex-specific override.Determine primary file:
AGENTS.md as primary source of truth.AGENTS.override.md is not the primary file. Use it only for Codex-specific overrides, temporary overrides, or nested directory rules that should supersede broader AGENTS.md guidance for Codex.CLAUDE.md is a secondary compatibility file for Claude Code, because Claude Code reads CLAUDE.md rather than AGENTS.md directly. Do not use symbolic links; some AI agents may read both files and duplicate context.CLAUDE.md a normal text file whose first line is:
@AGENTS.md
CLAUDE.md, ask the user before replacing it. The user may prefer to keep both files with different guidance for different AI tools.Goal: Detect AI tool instruction files, global system prompts, and MCP configs using scripts (not AI scanning) to save tokens and avoid missing overrides.
Run the detection script (best effort):
bash skills/agents-md-generator/scripts/detect-agent-context --root .skills\agents-md-generator\scripts\detect-agent-context.cmd --root .The script should report:
~/.claude/CLAUDE.md, ~/.codex/AGENTS.override.md, ~/.codex/AGENTS.md, ~/.codex/config.toml, ~/.roo/rules/, ~/.kilocode/rules/).mcp.json, .roo/mcp.json, mcp_settings.json, plus any --mcp-path entries)If script is unavailable:
references/tech-stack-detection.md under AI Agent Tooling Detection.Warn the user about overrides:
~/.claude/CLAUDE.md or other global instruction files exist, explicitly warn that they can override project prompts.Ask the user to confirm tool usage:
I detected these AI tool instruction sources:
- .github/copilot-instructions.md (GitHub Copilot)
- .cursorrules (Cursor)
- .clinerules or .clinerules/ (Cline)
- .kilocoderules / .kilo/ / .kilocodemodes (Kilo Code)
- .roo/rules/ / .roo/rules-* / .roorules* (Roo Code)
- opencode.jsonc (OpenCode)
- AGENTS.override.md / AGENTS.md (Codex project instructions)
- ~/.codex/AGENTS.override.md / ~/.codex/AGENTS.md / ~/.codex/config.toml (Codex global instructions and config)
- .claude/CLAUDE.md or ~/.claude/CLAUDE.md (Claude Code)
Which of these do you actively use for this project, and should we align or ignore any of them?
If MCP servers are detected:
If a skills/ folder exists, run the duplicate scan script to avoid copy-pasted skills:
bash skills/agents-md-generator/scripts/scan-skill-duplicates --skills-dir skillsskills\agents-md-generator\scripts\scan-skill-duplicates.cmd --skills-dir skillsIf duplicates are detected:
skills/ and merging any unique content into it.plugins/<plugin-name>/skills/, treat it as a generated package copy. Edit the source under skills/ and run npm run sync.Ask the user:
What scan depth should I use to analyze your project?
1. Quick (approximately 30 seconds)
Scans: package.json, composer.json, docker-compose.yml, pyproject.toml,
Gemfile, go.mod, Cargo.toml, and other root config files
Best for: When you know your stack well and want fast generation
2. Medium (approximately 1-2 minutes) [RECOMMENDED]
Scans: Root configs + src/, app/, lib/, config/, routes/, components/,
pages/, views/, controllers/, models/, services/
Best for: Most projects - good balance of accuracy and speed
3. Deep (approximately 3-5 minutes)
Scans: Entire project tree including tests/, docs/, scripts/, all
subdirectories, hidden configs, and build artifacts
Best for: Complex projects, monorepos, or unfamiliar codebases
Reply examples:
- Short: `2` (or `1` / `3`)
- With extra notes: `2 (also scan packages/*)`
Scan actions per depth:
| Depth | Files Scanned | Directories Explored |
|---|---|---|
| Quick | Root configs only | None (root level) |
| Medium | Configs + source headers | src/, app/, lib/, config/, routes/ |
| Deep | All files | Full tree traversal |
Ask the user:
What development environment does this project use?
1. Docker Compose
- Commands run via: docker compose exec <service> <command>
- Example: docker compose exec app php artisan migrate
2. Laravel Sail
- Commands run via: ./vendor/bin/sail <command>
- Example: ./vendor/bin/sail artisan migrate
3. Native/Host Machine
- Commands run directly on your machine
- Example: php artisan migrate
4. Dev Containers / Codespaces
- Commands run inside the container environment
5. Other (please describe)
- Specify your custom environment setup
Reply examples:
- Short: `1` (or `2` / `3` / `4` / `5`)
- Detailed: `1; main service is app; node runs in node service`
Follow-up questions based on selection:
Scan the project based on selected depth and detect:
Backend Framework:
Frontend Framework:
Package Manager:
Testing Framework:
Code Style/Linting:
Database:
AI Agent Tooling (scripted detection):
.github/copilot-instructions.md).cursorrules).clinerules or .clinerules/).kilocoderules, .kilo/, .kilocodemodes, .kilocode/config.json).roo/rules/, .roo/rules-*, .roorules*, .roo/mcp.json, mcp_settings.json)opencode.jsonc, OPENCODE_CONFIG)AGENTS.override.md, AGENTS.md, ~/.codex/AGENTS.override.md, ~/.codex/AGENTS.md, ~/.codex/config.toml).claude/CLAUDE.md, ~/.claude/CLAUDE.md, .mcp.json)Present findings to user:
I detected the following tech stack:
Backend:
- Laravel 11 (high confidence)
- PHP 8.3 (from composer.json)
Frontend:
- Vue.js 3 with Composition API (high confidence)
- TailwindCSS v3 (from package.json)
Testing:
- Pest PHP (from composer.json)
- Vitest (from package.json)
Code Style:
- Laravel Pint (pint.json found)
- ESLint + Prettier (configs found)
Environment:
- Docker Compose detected (docker-compose.yml)
- Services: app, mysql, redis
Is this correct? Would you like to add or modify anything?
Ask the user about optional sections:
Would you like to include any of these optional sections?
1. CI/CD Configuration
- Detect: GitHub Actions, GitLab CI, CircleCI, Jenkins
- Include: Pipeline commands, deployment notes
2. Git Workflow Guidelines
- Include: Branch naming, commit message format, PR guidelines
- Detect: .github/PULL_REQUEST_TEMPLATE.md, commitlint config
3. Security Guidelines
- Include: Env file handling, secrets management, input validation
- Best practices for the detected stack
4. API Documentation
- Detect: OpenAPI/Swagger specs, Postman collections
- Include: Documentation conventions and tooling
5. Mobile App Guidelines (if detected)
- React Native / Flutter specific patterns
- Platform-specific considerations
6. Monorepo Guidelines (if detected)
- Nx / Turborepo / Lerna workspace patterns
- Package management and dependencies
7. System Prompt Alignment (if detected)
- Document global or editor-level prompts that can override project rules
- Remind contributors to review and align prompts
8. MCP Servers & Tooling (if detected)
- List MCP servers and when to use them
- Include required environment variables or access notes
9. Project Progress Memory (PROGRESS.md)
- Ask if the team wants `PROGRESS.md` for continuity across tasks
- Require an `Original Prompt` section so future runs can compare intent vs current status
Select the sections you need (comma-separated numbers, or 'none' to skip):
Reply examples:
- Short: `none`
- Multiple: `1,3,4`
- With extra notes: `2,3,7 (also include branch naming rules)`
Note: In Quick Mode, these optional sections are skipped unless auto-detected with high confidence.
Generate the following sections based on detected stack and user input:
# AI Agent Guidelines & Repository Manual
**Role:** You are an expert Senior [DETECTED_ROLE] and Technical Lead.
You are responsible for the entire lifecycle of a task: understanding,
planning, [STACK_SPECIFIC_RESPONSIBILITIES].
Role detection rules:
Generate the 6-step workflow cycle:
Each step includes stack-specific instructions from templates.
List paths to important documentation:
## Documentation & Knowledge Base
You are expected to read and adhere to these single sources of truth:
* **[Doc Type]**: `[path/to/doc.md]` ([Brief description])
Auto-detect common paths:
docs/, documentation/README.md, CONTRIBUTING.mddocs/api/, docs/architecture/CLAUDE.md or AGENTS.md in this section. These files are already loaded by AI tools, and self-references waste context.Map the folder structure with purposes:
## Project Structure & Architecture
* **`[folder/]`**: [Purpose description]
Common patterns to detect:
Based on Phase 3 selection:
## Development Environment
### Container Commands (if Docker)
* App container: `docker compose exec [service] <command>`
### Host Commands
* Git, file operations, IDE commands
### Key Commands
* Format: `[detected formatter command]`
* Test: `[detected test command]`
* Build: `[detected build command]`
Based on detected stack:
## Coding Standards (The "Gold Standard")
* **Language**: [Language] [Version]
* **Framework**: [Framework] [Version]
* **Code Style**: [Style guide/tool]
* **Strictness**: [Type hints, strict mode, etc.]
Include anti-patterns section if applicable:
### Critical Anti-Patterns
- [Stack-specific anti-patterns to avoid]
If the project has specific domain rules detected:
## Domain Specifics & Non-Negotiables
* **[Rule Category]**: [Rule description]
Common domain patterns:
If user selected or auto-detected:
## CI/CD & Deployment
### Detected Pipelines
* **GitHub Actions**: `.github/workflows/`
* **GitLab CI**: `.gitlab-ci.yml`
### Pipeline Commands
* Run tests: `[detected command]`
* Build: `[detected command]`
* Deploy: `[detected command]`
### Deployment Notes
* [Environment-specific notes]
If user selected:
## Git Workflow
### Branch Naming
* Feature: `feature/<ticket>-<description>`
* Bugfix: `fix/<ticket>-<description>`
* Hotfix: `hotfix/<description>`
### Commit Message Format
type(scope): description
[optional body]
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore`
### Pull Request Guidelines
* Reference ticket/issue in description
* Ensure tests pass before requesting review
* Keep PRs focused and reasonably sized
If user selected:
## Security Guidelines
### Environment Variables
* Never commit `.env` files (only `.env.example`)
* Use secrets management for production
* Rotate credentials regularly
### Input Validation
* Validate all user input at boundaries
* Sanitize data before database queries
* Use parameterized queries (ORM handles this)
### Authentication & Authorization
* [Stack-specific auth patterns]
* Always verify permissions before actions
If detected or user selected:
## API Documentation
### Documentation Location
* OpenAPI Spec: `[path/to/openapi.yaml]`
* Postman Collection: `[path/to/collection.json]`
### Documentation Standards
* Keep API docs in sync with implementation
* Document all endpoints, request/response schemas
* Include example requests and responses
If React Native or Flutter detected:
## Mobile Development
### Platform Considerations
* Test on both iOS and Android
* Handle platform-specific UI patterns
* Consider offline functionality
### Build Commands
* iOS: `[build command]`
* Android: `[build command]`
If monorepo detected:
## Monorepo Structure
### Workspace Management
* Package manager: [pnpm/yarn/npm workspaces]
* Build tool: [Nx/Turborepo/Lerna]
### Package Dependencies
* Use workspace protocol for internal packages
* Keep shared dependencies at root level
### Commands
* Build all: `[command]`
* Build affected: `[command]`
* Test affected: `[command]`
If global or editor-level prompts were detected or the user requests it:
## System Prompt Alignment
These prompts can override project instructions. Review and align them with this file:
* **Claude Code Global Prompt**: `~/.claude/CLAUDE.md` (review for conflicts)
* **GitHub Copilot**: `.github/copilot-instructions.md` (project scope)
* **Cursor Rules**: `.cursorrules`
* **Cline Rules**: `.clinerules` or `.clinerules/`
* **Kilo Code Rules**: `.kilocoderules` / `.kilo/` / `.kilocodemodes`
* **Roo Code Rules**: `.roo/rules/` / `.roo/rules-*` / `.roorules*`
* **OpenCode Config**: `opencode.jsonc`
* **Codex Project Instructions**: `AGENTS.override.md` / `AGENTS.md`
* **Codex Global Instructions**: `~/.codex/AGENTS.override.md` / `~/.codex/AGENTS.md`
* **Codex Config**: `~/.codex/config.toml`
If any of these conflict with this file, update the global/system prompts first.
### Local AI Tool Folders & Git Hygiene
Remind contributors to keep local AI tool data out of Git:
* Add local folders like `.codex/` and `.claude/` to `.gitignore` because they may contain sensitive prompts, logs, or secrets.
* Put shareable skill packs in `.agents/skills/` so teams can version and share them safely.
If MCP servers are detected and user opts in:
## MCP Servers & Tooling
Use these MCP servers when the task matches their capability:
* **[server-name]**: [Purpose, when to use it, required env vars]
If a server is not needed for this project, disable it in the MCP config.
If the user wants project progress tracking:
## Project Progress Tracking
Use one lightweight progress file that all agents can continue from:
* **Progress**: `PROGRESS.md` (current focus + recent completions)
* **Required field**: `Original Prompt` (copy exact user request that started the task)
At the start of every task, read `PROGRESS.md` first, compare with the active request, and continue unfinished work before starting unrelated changes.
If a memory MCP server is used instead, keep `PROGRESS.md` minimal or omit it.
For new files:
AGENTS.md with generated content.CLAUDE.md as a normal text file for Claude Code compatibility. The first line must be:
@AGENTS.md
CLAUDE.md and AGENTS.md. Claude Code supports symlinks, but this skill intentionally uses the @AGENTS.md import to avoid duplicate-context behavior in other agents.@AGENTS.md import under a ## Claude Code heading.AGENTS.override.md by default. Create it only when the user asks for Codex-specific override behavior.If AGENTS.override.md exists or is requested:
AGENTS.md in the same directory.AGENTS.md, warn that Codex ignores that directory's AGENTS.md and reads the override instead.AGENTS.override.md as close as possible to the files it should govern.AGENTS.md.project_doc_fallback_filenames, mention that fallback files are checked only after AGENTS.override.md and AGENTS.md.If an existing CLAUDE.md is present without AGENTS.md:
CLAUDE.md.AGENTS.md.CLAUDE.md with a normal text file starting with @AGENTS.md.AGENTS.md and CLAUDE.md as intentionally separate instruction files.For updates (merge mode):
AGENTS.md by default) into sections (split by ## headers)AGENTS.md content does not instruct the agent to read CLAUDE.md or AGENTS.md, since those files are already loaded by AI tools.This skill is intentionally not a full Design System engine. When the user requests any of the following:
Then this skill must:
design-system-generator skill is available:DESIGN_SYSTEM.md to design-system-generatorAGENTS.md/CLAUDE.md to reference DESIGN_SYSTEM.md with this block:## Design System
All UI components and pages must follow `DESIGN_SYSTEM.md`:
- Use design tokens (no hardcoded colors/sizes).
- Implement component states (hover/focus/disabled/loading/error).
- Meet accessibility and performance requirements.
design-system-generator is NOT available:design-system-generator from:
AGENTS.md/CLAUDE.md patch referencing DESIGN_SYSTEM.mdDESIGN_SYSTEM.md (no deep recommendations)If the user still wants a file now, generate ONLY this scaffold:
# DESIGN_SYSTEM.md (Scaffold)
## Scope
Defines UI consistency rules for this project.
## Tokens (TBD)
- Colors: CSS variables
- Typography: scale + line-height
- Spacing: spacing scale
- Radius/Shadows: scales
## Components
Define component patterns and required states:
- hover, focus, disabled, loading, error
## Production assets
Use hashed filenames + a manifest mapping to avoid cache issues.
Minify CSS/JS and optimize images/fonts.
Do not pick Tailwind/MUI/shadcn/etc. in the scaffold unless the project already uses it.
Never implement the full Design System logic inside agents-md-generator.
See references/tech-stack-detection.md for complete detection patterns.
See references/section-templates.md for complete section templates per stack.
See references/merge-strategy.md for detailed merge logic.
When discussing or implementing new ideas/features for this skill, use PROGRESS.md as the single continuity file.
Required PROGRESS.md sections:
Original Prompt (verbatim user request that initiated the task)Current Status (what is done, in progress, blocked)Next Steps (clear continuation checklist)Maintainer workflow:
PROGRESS.md before starting any task.Original Prompt and Current Status against the new request.Current Status and Next Steps before ending the task.Archiving rule: keep PROGRESS.md readable (about 200-300 lines max). Move old completed entries to docs/archives/PROGRESS-YYYY-MM.md when needed.
Primary file: AGENTS.md
project_doc_max_bytes, 32 KiB by default)AGENTS.md files for subprojects when closer-directory guidance should override broader guidanceCodex override file: AGENTS.override.md
AGENTS.md for Codex in the same directorySecondary file: CLAUDE.md
@AGENTS.md@AGENTS.md when loading CLAUDE.mdWhy this approach:
AGENTS.md through a lightweight file referenceThis skill is part of the awesome-ai-agent-skills community library.