agents-generator Skill
生成符合 agents.md 标准(60k+ 开源项目使用)的完整项目级 AGENTS.md。还能为检测到的平台生成对应文件(.cursorrules、Copilot 指令、GEMINI.md)。在配置 AI agent 规则、为 Claude Code、Cursor、Copilot、OpenCode 或任何读取 AGENTS.md 的 agent 建立项目规范时使用。支持三种模式:full(完整 AGENTS.md + 配套规则文件 + 多平台输出)、minimal(单个 30 行的符合 agents.md 标准的 AGENTS.md)和 update(对比差异,仅重新生成改动部分)。可检测 monorep
安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。
技能指令原文(SKILL.md)
Skill: agents-generator
Generates a tailored AGENTS.md + .agents/rules/*.md for the target project — not a template with placeholders, but a living document that matches the project's real toolchain.
What you get
Default (minimal): a single ~40-line AGENTS.md. Ask for "full AGENTS.md" to get the rule stack below:
From a project that uses Bun + Next.js 16 + Tailwind + Vitest + Server Actions, the skill produces:
AGENTS.md
├── Setup commands: bun install, bun dev, bun run test:run, bun doctor
├── Verification Cycle: bunx tsc --noEmit → bun run lint → bun run test:run → bun doctor
├── Conventions: "Bun always. Plain TypeScript types + guards."
└── Architecture → .agents/rules/architecture.md
.agents/rules/
├── architecture.md ← ASCII diagram with real directories, exact versions
├── frontend-patterns.md ← Component rules, state locations, trust boundaries
├── server-actions.md ← downloadVideo() flow, DownloadResult type, rate limiter
├── testing.md ← "74 tests in 5 files", vitest commands, mock patterns
├── git-workflow.md ← Conventional commits, pre-commit checks
└── odd-workflow.md ← Task sizing, feature document, post-task verification
Rules NOT generated: backend.md (no Node backend framework), database.md (no ORM), i18n.md (hardcoded Spanish), forms.md (manual inputs), styling.md (Tailwind in frontend rules).
Activation Contract
Generate AGENTS.md + .agents/rules/*.md for the target project. Never guess — read the project's actual files first.
Mode selection
| User says | Mode | Output |
|-----------|------|--------|
| "create AGENTS.md", "simple", "minimal", or default | Minimal | Single AGENTS.md (~40 lines, no rule files), plus thin CLAUDE.md if Claude detected |
| "full AGENTS.md", "with rules", "complete", "rule files" | Full | AGENTS.md + .agents/rules/*.md |
| "update AGENTS.md", "refresh", "my stack changed" | Update | Diff existing, regenerate only what changed |
Full mode and update are JavaScript/TypeScript only. For a Python, Go, or Rust project, generate minimal mode and tell the user full mode is JS/TS-only.
Dry-run mode
If the user asks to "preview", "show what would change", "dry-run": run all detection but do NOT write files. Show detection summary, files that would be created, skipped rules, and sample output.
Hard Rules
- Read before writing. Read
package.json, all config files, and directory structure before generating anything. - Detect package manager FIRST (JS/TS). Check lockfiles:
bun.lock→bun,pnpm-lock.yaml→pnpm,package-lock.json→npm,yarn.lock→yarn. NEVER default to npm. Every command uses the detected PM. - Generate only what applies. No backend rules for frontend-only. No database rules without ORM.
- Auto-format and lint generated files. Run only when the JS/TS project declares a formatter or linter in
package.json: run[format cmd]and[lint cmd]on generated files only — never the whole project. These are fast, safe operations. Use the explicit run form (run