From codex-next
Designs, audits, or restructures AGENTS.md hierarchies for Codex repositories. Used for writing, modifying, or auditing AGENTS.md files.
How this skill is triggered — by the user, by Claude, or both
Slash command
/codex-next:core-codex-agents-md-builderThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- 仓库还没有 AGENTS.md,要从零设计一套
不适用:CLAUDE.md / Cursor 规则 / 其他格式;仅询问"AGENTS.md 是什么"的解释类问题。
四件事讲清整个任务的前提:
AGENTS.override.md,同目录普通 AGENTS.md 会被替换,必须先暂停确认。完整加载模型、字节预算、override.md 处理、沙箱限制:见 references/loading-model.md。
只用三种,不要再细分。
| 目录类型 | 选哪个模板 | 是否必须创建 |
|---|---|---|
| 仓库根 | Root router | 是 |
| 应用、服务、共享库、有独立职责边界的业务模块 | Domain card | 有边界风险/不变量/专属验证时才创建 |
| infra / migrations / auth / payments / secrets / generated / vendor 等高风险或只读 | Guardrail card | 该目录存在且会被手动改时通常创建 |
| 纯组织层级目录、无独立规则、无专属验证 | 不创建 | 否 |
判定原则:只在有实际价值时创建。不要为了覆盖率给纯组织目录建空 AGENTS.md。
三类模板的完整结构和示例:见 references/card-templates.md。
识别六件事:技术栈、目录职责、已有 AGENTS.md/override.md、命令(test/lint/build/codegen/migration)、高风险目录、生成/只读目录。
Git 操作只允许只读命令:git status、git diff、git ls-files、git rev-parse、git log。
普通仓库探索允许使用只读文件命令,如 pwd、find、rg、sed、cat、head、wc。
完整探索清单(必查项 / 推荐命令 / 忽略目录 / 预算控制):见 references/output-format.md 的探索清单段。
在对话里输出一份简短策略,不要创建 AGENTS_PLAN.md 或类似计划文件。
必须包含:
输出后直接进入 Step 3,不等用户确认。除非命中下方"暂停条件"。
必须包含:仓库目的、Codex 启动行为、目录地图(含 Local AGENTS.md 列和 Read when 列)、按需 cat 协议、关键命令复述、全局规则、Do not、Validation 标准。
目标长度 8–16 KiB,硬上限 25 KiB。
完整模板和必含元素:见 references/card-templates.md 的 Root router 段。
Domain card 或 Guardrail card,单文件 0.5–2 KiB。
只在第 3 节"判定"通过时写。无独立价值的目录不写。
完整模板见 references/card-templates.md 的对应段。
自检清单和中文最终汇报格式:见 references/output-format.md 的自检 + 汇报段。
AGENTS.override.md,或判断需要创建 / 修改 override,停下来询问用户。git add / git commit / git reset / git checkout / git clean / git stash。只用 git status / git diff / git ls-files / git rev-parse / git log。package.json scripts、Makefile、pyproject.toml、CI 配置、官方文档中确认存在。不编造。不确定就写"不确定"并指回根命令。AGENTS.override.md,会屏蔽同目录普通 AGENTS.mdAGENTS.override.md其他情况一律继续执行,不要反复请示。
| 文件 | 何时读 |
|---|---|
references/loading-model.md | 开始前必读:Codex 加载模型、字节预算、override.md 处理、沙箱限制、与 README 的关系 |
references/card-templates.md | Step 3、4 写文件时:三类卡片完整模板、必含元素、禁止事项、最短形式示例 |
references/output-format.md | Step 1 探索时 + Step 5 汇报时:探索清单、推荐命令、忽略目录、自检项、中文最终汇报格式 |
按需读取,不要一次性全读。SKILL.md 本身的判断和约束足够覆盖大多数决策;只在写具体内容、收尾汇报、或对加载模型有疑问时才打开对应 references。
npx claudepluginhub blueskyxn/codex-is-all-you-need --plugin codex-nextGenerates hierarchical AGENTS.md structures for codebases to optimize AI agent token usage. Use for repo analysis, monorepos, JIT indexing, and token-efficient root/sub-folder docs.
Analyzes repository structure to generate or update AGENTS.md contributor guides for AI agents. Supports single-repo and monorepo layouts with update mode that preserves custom sections.
Creates, refreshes, or validates repo AGENTS.md files using evidence from files, git history, CI to keep them concise and current. Use when missing, stale, or after refactors/tooling changes.