特工作者

文档 社区

技能解读

当前原文的自动摘译,尚未人工审校。

何时激活

用户要求“编写 AGENTS.md”、“创建 CLAUDE.md”或“为 AI 设置项目说明” 用户希望相同的项目文档能够在 Codex、Claude Code、Cursor 或任何遵循 AGENTS.md 约定的工具中工作 用户提到将新的 AI 工具加入现有存储库并希望捕获约定

1. 检测项目上下文(始终首先执行此操作)

读取项目根目录并确定: 项目名称 — 来自 package.json name、pyproject.toml [project].name、go.mod module、Cargo.toml [package].name,或回退到存储库目录名称 语言和运行时 — package.json(节点 + 锁定文件风格), requirements.txt / pyproject.toml (Python), go.mod (Go), Cargo.toml (Rust), pom.xml / build.gradle (JVM), *.csproj (.NET) 常用脚本 — 节点 scripts.{dev,build,test,lint,typecheck}; Python tox.ini / Makefile; Go/Rust 任务工具

2. 确定目标文件

用户想要 · 仅编写 Codex / OpenAI 工具 · AGENTS.md 仅 Claude 代码 · CLAUDE.md 两者,保持同步 · AGENTS.md + CLAUDE.md(相同内容),或 AGENTS.md 加上一行 CLAUDE.md,上面写着“参见 AGENTS.md” 单一来源(推荐)· AGENTS.md + CLAUDE.md 符号链接 → AGENTS.md

3. 撰写内容

使用此规范结构(如果需要逐个字段的基本原理或跨供应商详细信息,请加载references/agents-md-spec.md):将其保持在约 150 行以下。人工智能代理会略过——跳过或忽略冗长的文档。

4. 写入文件

使用操作系统的规范行结尾(macOS/Linux 上的 LF) 不要添加尾随摘要或“生成者”页脚 - 该文件现在是用户的 如果文件已存在,请先读取它,提出差异,并在覆盖之前询问用户

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
文档
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@tomevault-io · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
需简单配置
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux
运行环境要求
Node.js · Python
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# agents-md-author

Generate cross-vendor project instruction files: `AGENTS.md` for Codex (and most other tools), `CLAUDE.md` for Claude Code, or both kept in sync. Load `references/agents-md-spec.md` if you need the cross-vendor convention details.

## When to activate

- User asks to "write AGENTS.md", "create CLAUDE.md", or "set up project instructions for AI"
- User wants the same project doc to work in Codex, Claude Code, Cursor, or any tool that follows the AGENTS.md convention
- User mentions onboarding a new AI tool to an existing repo and wants conventions captured

## Procedure

### 1. Detect project context (always do this first)

Read the project root and determine:
- **Project name** — from `package.json` `name`, `pyproject.toml` `[project].name`, `go.mod` `module`, `Cargo.toml` `[package].name`, or fallback to repo dir name
- **Language & runtime** — `package.json` (Node + lockfile flavor), `requirements.txt` / `pyproject.toml` (Python), `go.mod` (Go), `Cargo.toml` (Rust), `pom.xml` / `build.gradle` (JVM), `*.csproj` (.NET)
- **Common scripts** — Node `scripts.{dev,build,test,lint,typecheck}`; Python `tox.ini` / `Makefile`; Go/Rust task tools
- **Test framework** — vitest, jest, pytest, go test, cargo test, etc.
- **Repo conventions** — existing `.editorconfig`, `.prettierrc`, `eslint.config.*`, `pre-commit-config.yaml`

If the user provided context (e.g., "this is a Next.js + Prisma app"), use it; otherwise infer from files. Don't ask questions you can answer from disk.

### 2. Decide the target file(s)

| User wants | Write |
|---|---|
| Codex / OpenAI tools only | `AGENTS.md` |
| Claude Code only | `CLAUDE.md` |
| Both, kept in sync | `AGENTS.md` + `CLAUDE.md` (identical content), or `AGENTS.md` plus a one-line `CLAUDE.md` that says "See AGENTS.md" |
| Single source (recommended) | `AGENTS.md` + `CLAUDE.md` symlink → `AGENTS.md` |

Default to "both, identical content" unless the user specifies — it's the lowest-risk option and works everywhere.

### 3. Compose content

Use this canonical structure (load `references/agents-md-spec.md` if you need the field-by-field rationale or cross-vendor details):

```markdown
# <Project name>

<one-sentence description>

## Tech stack

- <language + version>
- <framework + version>
- <database / runtime / deployment>

## Dev commands

- Install: `<command>`
- Dev server: `<command>`
- Build: `<command>`
- Test: `<command>` (unit) / `<command>` (e2e)
- Lint / typecheck: `<command>`

## Code conventions

- <indent + line length>
- <import style>
- <naming conventions>
- <test colocation>
- <commit style>

## Architecture notes

<2-5 bullets on layout — where routes live, where business logic lives, what's shared>

## Out of scope for AI agents

<deliberate "don't touch" list — generated files, secrets, migrations, etc.>
```

Keep it under ~150 lines. AI agents skim — verbose docs are skipped or ignored.

### 4. Write files

- Use canonical line endings for the OS (LF on macOS/Linux)
- Don't add a trailing summary or "generated by" footer — the file is now the user's
- If a file already exists, **read it first**, propose a diff, and ask the user before overwriting

### 5. Verify

- Print the relative paths written
- If both `AGENTS.md` and `CLAUDE.md` were written, confirm they're byte-identical (or show the symlink)
- Suggest the user commit the files

## References

- `references/agents-md-spec.md` — full cross-vendor convention summary (Anthropic, OpenAI, Cursor, etc.) — load on demand for spec details, vendor matrix, and the AGENTS.md ≠ SKILL.md distinction
- Anthropic Agent Skills spec: https://github.com/anthropics/skills
- OpenAI Codex AGENTS.md guide: https://developers.openai.com/codex/guides/agents-md
- agents.md cross-vendor standard: https://agents.md

---
> Source: [anton-abyzov/vskill](https://github.com/anton-abyzov/vskill) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。