From devops-skills
Generates or updates CLAUDE.md/AGENTS.md files for AI coding agents via project scanning and interactive Q&A. Supports multiple tech stacks, preserves customizations.
npx claudepluginhub thienanblog/awesome-ai-agent-skills --plugin office-web-ui-skillsThis skill uses the workspace's default tool permissions.
This skill helps you generate comprehensive instruction files (CLAUDE.md or AGENTS.md) 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.shCreates 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.
Creates and refactors minimal AGENTS.md files using progressive disclosure. Manages CLAUDE.md symlinks, assesses bloat, and proactively activates for missing files.
Creates and maintains minimal AGENTS.md agent docs with project analysis for package managers, file-scoped commands, conventions; symlinks to CLAUDE.md.
Share bugs, ideas, or general feedback.
This skill helps you generate comprehensive instruction files (CLAUDE.md or AGENTS.md) 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.
To generate a new CLAUDE.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 or AGENTS.md in the project root1 or update; 2 or replace; 3 or cancelDetermine primary file:
CLAUDE.md as primary, AGENTS.md as symlinkGoal: 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/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)
- ~/.codex/config.toml (Codex)
- .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:
ln -s ./skills/skill-a ./skills/skill-bAsk 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)~/.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 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:
CLAUDE.md with generated contentAGENTS.md as symlink:
ln -s CLAUDE.md AGENTS.md
<!-- This file mirrors CLAUDE.md. Edit CLAUDE.md as the primary source. -->
For updates (merge mode):
## headers)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: CLAUDE.md
Secondary file: AGENTS.md
Why this approach:
This skill is part of the awesome-ai-agent-skills community library.