Skip to content
Skills Library
AI & agents · Building & coding

agent-init

/agent-init

为 Claude Code 初始化项目协作骨架。当用户希望创建或补齐 CLAUDE.md 与 .claude,并生成 rules、memory、agents、hooks 配置的起始模板时使用。Codex 仅作为 Claude Code 临时调用的任务执行工具,本 skill 不生成 AGENTS.md、.codex 或 Codex agents。

Licence
MIT
Last repository change
07.07.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
22
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 07.07.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/init_agent.py

What it does and when to use it

为 Claude Code 初始化项目协作骨架。当用户希望创建或补齐 CLAUDE.md 与 .claude,并生成 rules、memory、agents、hooks 配置的起始模板时使用。Codex 仅作为 Claude Code 临时调用的任务执行工具,本 skill 不生成 AGENTS.md、.codex 或 Codex agents。

Original author description

为 Claude Code 初始化项目协作骨架。当用户希望创建或补齐 CLAUDE.md 与 .claude,并生成 rules、memory、agents、hooks 配置的起始模板时使用。Codex 仅作为 Claude Code 临时调用的任务执行工具,本 skill 不生成 AGENTS.md、.codex 或 Codex agents。

How it works

  1. 调用前环境检查
  2. 初始化参数
  3. 初始化流程
  4. Codex 使用边界
  5. 运行目录结构
  6. 内容风格
  7. Resources
Original SKILL.md headings · 150 lines, 246 words
SKILL.md preview
---
name: agent-init
description: 为 Claude Code 初始化项目协作骨架。当用户希望创建或补齐 CLAUDE.md 与 .claude,并生成 rules、memory、agents、hooks 配置的起始模板时使用。Codex 仅作为 Claude Code 临时调用的任务执行工具,本 skill 不生成 AGENTS.md、.codex 或 Codex agents。
---

# Agent Init

用于为项目初始化轻量协作骨架。默认只初始化 **Claude Code 主工作流**。

## 调用前环境检查

使用本 skill 的第一步必须检查当前执行环境。

- 当前执行者是 Claude Code:继续执行初始化流程
- 当前执行者不是 Claude Code(例如 Codex、ChatGPT 或其他 agent):停止执行,不运行脚本,不创建或修改文件,并提示用户:

```text
agent-init 只支持在 Claude Code 中调用。当前执行环境不是 Claude Code,请切换到 Claude Code 后再执行初始化。
```

当前支持:
- `claude-code`:生成 `CLAUDE.md` 与 `.claude/`

执行初始化前,先读取对应参考文件:
- `references/claude-code.md`

## 初始化参数

期望参数:
- `init`
- `agent=claude-code`
- `root=<项目根目录>`
- `docs-profile=<none|engineering>`

## 初始化流程

1. 检查项目根目录
2. 选择目标 agent 适配器
3. 检查顶层入口文件是否存在
4. 检查运行目录是否存在
5. 创建缺失的目录与模板文件
6. 对已有文件补齐缺失部分
7. 输出复用项与新增项摘要

当 `docs-profile=engineering` 时,额外初始化:

```text
docs/
  architectures/
  plans/
  tasks/
```

并补齐顶层入口文件中的文档治理规则,但不额外生成目录级 `README.md`。

## Codex 使用边界

Codex 只作为 Claude Code 在具体任务中临时调用的执行工具,不作为项目级协作骨架初始化目标。

- 不生成 `AGENTS.md`
- 不生成 `.codex/`
- 不生成 `.codex/agents`
- 不维护独立 Codex rules/memory
- 需要 Codex 执行时,由 Claude Code 在任务提示中显式传入范围、事实源、验收标准和必要上下文

### Claude Code

- 顶层入口文件:`CLAUDE.md`
- 运行目录:`.claude/`
- 主工作流事实源

## 运行目录结构

### Claude Code 主体结构

```text
.claude/
  rules/
    task-classification.md
    document-lifecycle.md
    memory-write-policy.md
    subagent-routing.md
    review-checklist.md
  memory/
    index.md
    session-brief.md
    project-progress.md
    corrections.md
    observations.md
    learned-rules.md
  agents/
    planner.md
    executor.md
    verifier.md
```

### agents 目录

Claude Code 使用 Markdown 格式,并且每个文件必须包含 YAML frontmatter(至少 `name` 与 `description`),以便 Claude Code 正确识别子代理:

```text
.claude/agents/
  planner.md
  executor.md
  verifier.md
```

### Hook 配置

Claude Code 配置在 `.claude/settings.json`(随仓库提交共享),hook 条目使用 `hooks` 数组结构:

```text
.claude/settings.json
```

```json
{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "cat \"$(git rev-parse --show-toplevel)/.claude/memory/session-brief.md\""
          }
        ]
      }
    ]
  }
}
```

## 内容风格

- 顶层入口文件保持精简
- 执行细则下沉到运行目录
- 规则表达优先使用正向描述
- 优先采用补齐和扩展方式,而不是整体替换
- 工程文档目录只提供最小骨架,不预生成冗长 spec 文档
- 工程文档文件名优先使用稳定英文 slug,不使用年月日前缀
- 文档生命周期规则写入 `rules/document-lifecycle.md`

## Resources

### scripts/

- `scripts/init_agent.py`
  - 根据 `agent` 和 `root` 初始化对应的顶层入口文件与运行目录

### references/

- `references/claude-code.md`
  - Claude Code 的入口文件与运行目录约定
Files in this package (22)
  • SKILL.md 4 KB
  • agents/openai.yaml 1 KB
  • references/claude-code.md 2 KB
  • scripts/init_agent.py 7 KB
  • templates/claude-code/entry-append.md 2 KB
  • templates/claude-code/entry.md 2 KB
  • templates/claude-code/settings.json 1 KB
  • templates/common/docs-entry-append.md 1 KB
  • templates/common/agents/executor.md 1 KB
  • templates/common/agents/planner.md 1 KB
  • templates/common/agents/verifier.md 1 KB
  • templates/common/memory/corrections.md 1 KB
  • templates/common/memory/index.md 1 KB
  • templates/common/memory/learned-rules.md 1 KB
  • templates/common/memory/observations.md 1 KB
  • templates/common/memory/project-progress.md 1 KB
  • templates/common/memory/session-brief.md 1 KB
  • templates/common/rules/document-lifecycle.md 2 KB
  • templates/common/rules/memory-write-policy.md 1 KB
  • templates/common/rules/review-checklist.md 1 KB
  • templates/common/rules/subagent-routing.md 1 KB
  • templates/common/rules/task-classification.md 1 KB

Versions

The database has no other skills named agent-init.

Database snapshot: 13.11.2026 · package version bb7f2e745dda (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100memory-init
    在当前目录下初始化记忆系统,生成 CLAUDE.md(可选 AGENT.md 给 Cursor 用)、MEMORY.md 和 memory/ 目录。当用户说"初始化记忆"、"搭建记忆"、"memory init"、"/memory-init"时触发。
  • 100agents-md-author
    Bootstrap or update project AI-agent instruction files (AGENTS.md for Codex, CLAUDE.md for Claude Code, or both) from the current project's structure. Triggers on: write AGENTS.md, write CLAUDE.md, generate AGENTS.md, agent instructions, project conventions for AI, bootstrap…
  • 100init-agent-config
    Use if creating, auditing, or migrating CLAUDE.md/AGENTS.md/REVIEW.md instruction files.
  • 100ecc
    ECC (Everything Claude Code) is an open-source toolkit that adds agents, skills, slash commands, rules, hooks and a shared memory vault to coding agents such as Claude Code and Codex. Use it when a user asks to "install ECC", "set up ecc-universal", "add a planning, TDD and…
  • 100ctx-init
    Initialize AGENTS.md + CLAUDE.md + rules/ in a code repo (fresh mode). Triggers on "/ctx-init", "init context", "scaffold AGENTS.md", or when user asks to set up project context in a new repo.
  • 100init-agents
    Set up the .claude/agents/ system with specialized agent definitions, memory directories, routing table, and permission settings. Use when the user says "init agents", "set up agents", "add claude agents", "create agent system", "agent routing", "specialized agents", or when a…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.