用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill agents-md命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
基于 SOC 职业分类
正在显示 SKILL.md
| name | agents-md |
| description | > Use when this capability is needed. |
AGENTS.md (a.k.a. CLAUDE.md, .github/copilot-instructions.md) is the project-specific layer between the agent's system prompt and your task prompt. It only earns its place in the context window if every rule passes one question: could the agent know this without this file? If yes, the rule is noise. If no, it belongs.
This skill writes AGENTS.md as the canonical file, with thin import shims for Claude Code (CLAUDE.md → @AGENTS.md) and optionally Copilot (.github/copilot-instructions.md → references AGENTS.md). Each proposed rule must be anchored in a real source from the project (docs/, lessons, incidents, product-spec constraints) — generic best-practice copy is rejected.
The skill is anti-duplication: it greps ~/.claude/rules/ for the rules ai-devkit already auto-activates by file type. Anything covered there does not enter AGENTS.md.
Use when:
AGENTS.md / CLAUDE.md and the agent keeps drifting from local conventions.<area>/AGENTS.md.Skip when:
unknown over any, Go error wrapping, Python typing) — ai-devkit's ~/.claude/rules/ already covers it. Adding it to AGENTS.md is redundant.docs/ and no decisions worth anchoring rules in. Run /discover + /product-spec first, or just leave AGENTS.md minimal./init and then /rule-review to clean up; this skill is for the test-of-inclusion-first path./rule-review — downstream auditor. Audits the file this skill writes (or any existing one) across 7 dimensions. Run after any meaningful edit./setup — workspace bootstrap. If docs/ is missing, this skill delegates to /setup first./discover + /product-spec — content source. The product-spec's user persona, business logic, and access-control sections become rule anchors. If docs/product-spec.md is missing, the skill warns but still proceeds (less anchored content available).~/.claude/rules/*.md — auto-active language layer. This skill reads these to know what NOT to propose. It never modifies them./init — alternative entry point. /init analyzes the codebase and proposes everything; this skill goes the opposite way (propose nothing unless anchored). They're complementary — /init first, this skill second with /rule-review audit.AGENTS.md, the CLAUDE.md shim, and the optional .github/copilot-instructions.md are written in English, regardless of the user's chat language. This matches the global policy in ~/.claude/CLAUDE.md §13. The interactive dialogue during authoring may use the user's working language; the file content on disk is always English so the rules survive team handover and tool changes.
Three files (the second and third are opt-in):
AGENTS.md at the target scope (repo root by default; <area>/AGENTS.md if scoped). Canonical source of truth. Holds all the actual rules.CLAUDE.md at the same scope, one line: This file provides guidance to Claude Code when working with code in this repository: @AGENTS.md. Only written if not already present..github/copilot-instructions.md (opt-in): brief shim that references AGENTS.md. Copilot lacks native @ imports — the shim either re-links to AGENTS.md or copies its content (user picks at write time).When invoked:
/agents-md src/api): target scope is that directory. Jump to Step 1.Print: Target scope: <path>. Canonical file will be <path>/AGENTS.md.
test -d docs
If missing, ask whether to delegate to /setup. The skill will continue without docs/, but content anchoring becomes much weaker.
If target/AGENTS.md already exists, ask:
/rule-review, then return.AGENTS.md.bak-YYYYMMDD-HHMMSS.Print what ~/.claude/rules/ already enforces by file type. This is the "free knowledge" you don't pay context for in AGENTS.md:
ls ~/.claude/rules/*.md 2>/dev/null
For each rule file, print one line: ~/.claude/rules/typescript.md → unknown over any, Zod validation, error narrowing, ... (read the ## When this rule activates and key bullet points). The user sees the "do not duplicate" list.
If ~/.claude/rules/ doesn't exist (user installed only the copilot side): print "ai-devkit's auto-active rules layer is not installed at ~/.claude/rules/. Without it, you may need MORE rules in AGENTS.md than usual. Continue?"
For the target scope, read in this order, capturing snippets / paths for later citation:
| Source | What to extract |
|---|---|
docs/product-spec.md | ## User & Persona, ## Access control, ## Business logic, ## Non-goals. These constrain agent decisions (e.g. "only the trainer can mutate attendance"). |
docs/architecture/*.md | Section headings + key decisions. Each decision is a candidate rule anchor. |
docs/reference/lessons.md | If present, each ## <Rule> block is a pre-made rule with a Why: already attached. |
docs/analyzes/*.md | The ## Decision line of each research doc. Constraints arising from research belong in AGENTS.md. |
Existing root-level config files (tsconfig.json, pyproject.toml, pom.xml, .eslintrc*) | What's ALREADY enforced. Anything enforced here is candidate for "don't add to AGENTS.md". |
README.md of the project | Commands (build, test, lint). If present, AGENTS.md should reference (not duplicate) these. |
Print a summary table:
Source Items found Will use for anchors
docs/product-spec.md 4 sections access-control, business-rule, non-goals
docs/architecture/auth.md 3 decisions JWT-only, no-cookie-fallback
docs/reference/lessons.md 2 entries no-lodash, utc-dates
docs/analyzes/db-choice.md 1 decision postgres-not-mongo
.eslintrc.json enforces (skip — already covered)
README.md build cmds reference only, don't duplicate
For each anchorable item from Step 2, propose a rule using the test of inclusion:
Could the agent know this without AGENTS.md, given
~/.claude/rules/is active and the public docs in the codebase are readable?
If the answer is "yes", drop the rule. If the answer is "no" and the user can explain why, keep it.
Ask the user item by item — interactive AskUserQuestion per candidate, with the source citation visible:
Candidate rule #2:
> Mutating attendance requires trainer-of-record check (not any authenticated user).
Anchor: docs/product-spec.md § Access control.
Could the agent infer this from the codebase or public docs alone?
- No, keep this rule (Recommended)
- Yes, drop it — the auth middleware code already enforces it visibly
- Reword it
- Skip — I'm not sure yet
Items the user keeps go into the working draft. Items dropped do not appear later.
Layout — top to bottom — leverages U-shaped attention (Liu et al., "Lost in the Middle"):
# <Project name> — Agent Rules
<2–3 line summary: what this project is and what it expects from an agent.>
## Critical (highest priority)
<3–5 rules. The non-negotiables. Access control, data integrity,
destructive-operation gates, anything where a wrong decision is hard to
recover from.>
## Conventions (project-specific)
<Rules that aren't critical but enforce local idioms the agent wouldn't
otherwise infer. File naming, import paths, error formats, etc. Group by
topic.>
## Workflow
<How work flows through this repo: branch naming, commit conventions,
PR template, where lessons go (docs/reference/lessons.md), what / 10x / or
>
Each rule is one to three sentences, imperative voice. Cite anchors inline as > Source: docs/architecture/auth.md § JWT. Group related rules — never write a 30-rule wall of one-liners.
After drafting, count lines:
wc -l <draft>
| Lines | Action |
|---|---|
| ≤ 150 | Healthy. Proceed. |
| 151 – 200 | At the edge. Print: "AGENTS.md is at lines. Recommended ceiling is ~200 to keep the high-attention top of context budgeted." Proceed. |
| 201 – 250 | Over. Print which sections are largest. Offer to split an area-specific section out into <area>/AGENTS.md (granular file, loaded only when the agent works in that area). |
| > 250 | Strong push to split. Default action: split, not save. User can override. |
When splitting, write the area-specific file and replace the section in root AGENTS.md with a one-liner: > Rules for src/api/: see src/api/AGENTS.md (Claude Code follows this organically via its directory walk; Codex too).
After AGENTS.md is approved:
CLAUDE.md (if not present):
This file provides guidance to Claude Code when working with code in this repository: @AGENTS.md
Or as symlink: ln -s AGENTS.md CLAUDE.md — offer the user the choice. Default: the one-line file (works on Windows, survives rm of either side).
.github/copilot-instructions.md (opt-in):
AskUserQuestion:
- question: "Also write .github/copilot-instructions.md for Copilot users?"
header: "Copilot shim?"
options:
- label: "Yes — link-only shim"
description: "One-line file pointing to AGENTS.md. Copilot users open AGENTS.md manually."
- label: "Yes — copy content"
description: "Copies AGENTS.md content (will drift over time)."
- label: "No"
description: "Skip Copilot. Add later if needed."
multiSelect: false
.gitattributes (optional) — if a symlinked CLAUDE.md was chosen and the repo is shared across OSes, suggest adding CLAUDE.md text to avoid CRLF issues.
Print:
Authored: <path>/AGENTS.md (<N> lines), CLAUDE.md shim, [copilot shim?].
This file is a living artifact. When the agent makes the same mistake twice
in a row, append a new entry to docs/reference/lessons.md and bring the
new rule into AGENTS.md the next time you /rule-review it.
Next step: /rule-review <path>/AGENTS.md
STOP.
AGENTS.md containing only the workflow section." User picks.backend/AGENTS.md, frontend/AGENTS.md). Root file holds only the cross-cutting concerns./rule-review first to identify what's actually load-bearing, then re-running this skill to rebuild from anchors.~/.claude/rules/ installed: the anti-duplication step is skipped; the skill prints a warning so the user knows AGENTS.md may end up longer than usual. The user can later install ai-devkit's rules layer and prune./rule-review to identify drift, then re-run."Source: bpawlakj/ai-devkit — distributed by TomeVault.