con un clic
deepinit
用分层 AGENTS.md 文档对代码库做深度初始化
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
用分层 AGENTS.md 文档对代码库做深度初始化
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
oh-my-kimi 的目录入口,包含面向 Kimi CLI 的 agent、skill、hook 与 MCP 套件,衍生自 oh-my-* 谱系。
面向密钥、注入、authz/authn、不安全 IO、依赖与数据外泄风险的安全评审
证据驱动的追踪通道,在 Kimi 的 Agent 工具中编排互相竞争的 tracer 假设
LLM Wiki —— 跨会话持续累积的 markdown 知识库(Karpathy 模型)
面向作家的 agentic 记忆系统 —— 跟踪人物、关系、场景与主题
跑只读的深度仓库分析,返回一份带置信度排序的综合结论,附具体文件引用、清晰区分证据与推断。当用户说 'analyze'、'investigate'、'why does'、'what's causing',或在提任何改动方案之前需要跨文件的有据解释时使用。
| name | deepinit |
| description | 用分层 AGENTS.md 文档对代码库做深度初始化 |
| level | 4 |
跨整个代码库创建全面、分层的 AGENTS.md 文档。
AGENTS.md 文件作为 AI 可读文档,帮助 agent 理解:
每个 AGENTS.md(除根目录外)都包含一个 parent 引用标签:
<!-- Parent: ../AGENTS.md -->
这构成可导航的层级:
/AGENTS.md ← Root (no parent tag)
├── src/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
│ ├── src/components/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
│ └── src/utils/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
└── docs/AGENTS.md ← <!-- Parent: ../AGENTS.md -->
<!-- Parent: {relative_path_to_parent}/AGENTS.md -->
<!-- Generated: {timestamp} | Updated: {timestamp} -->
# {Directory Name}
## 用途
{One-paragraph description of what this directory contains and its role}
## 关键文件
{List each significant file with a one-line description}
| File | Description |
|------|-------------|
| `file.ts` | Brief description of purpose |
## 子目录
{List each subdirectory with brief purpose}
| Directory | Purpose |
|-----------|---------|
| `subdir/` | What it contains (see `subdir/AGENTS.md`) |
## 面向 AI Agents
### 在此目录工作
{Special instructions for AI agents modifying files here}
### 测试要求
{How to test changes in this directory}
### 常见模式
{Code patterns or conventions used here}
## 依赖
### 内部
{References to other parts of the codebase this depends on}
### 外部
{Key external packages/libraries used}
<!-- MANUAL: Any manually added notes below this line are preserved on regeneration -->
Agent(subagent_type="explore", model="haiku",
prompt="List all directories recursively. Exclude: node_modules, .git, dist, build, __pycache__, .venv, coverage, .next, .nuxt")
按深度层级为每个目录生成 todo 项:
Level 0: / (root)
Level 1: /src, /docs, /tests
Level 2: /src/components, /src/utils, /docs/api
...
IMPORTANT:先生成父层级再生成子层级,确保 parent 引用有效。
对每个目录:
当 AGENTS.md 已存在时:
<!-- MANUAL --> 保留)生成后跑校验:
| Check | How to Verify | Corrective Action |
|---|---|---|
| Parent references resolve | Read each AGENTS.md, check <!-- Parent: --> path exists | Fix path or remove orphan |
| No orphaned AGENTS.md | Compare AGENTS.md locations to directory structure | Delete orphaned files |
| Completeness | List all directories, check for AGENTS.md | Generate missing files |
| Timestamps current | Check <!-- Generated: --> dates | Regenerate outdated files |
校验脚本模式:
# Find all AGENTS.md files
find . -name "AGENTS.md" -type f
# Check parent references
grep -r "<!-- Parent:" --include="AGENTS.md" .
| Task | Agent |
|---|---|
| Directory mapping | explore |
| File analysis | architect |
| Content generation | writer |
| AGENTS.md writes | writer |
遇到空或近空目录时:
| Condition | Action |
|---|---|
| No files, no subdirectories | Skip - do not create AGENTS.md |
| No files, has subdirectories | Create minimal AGENTS.md with subdirectory listing only |
| Has only generated files (*.min.js, *.map) | Skip or minimal AGENTS.md |
| Has only config files | Create AGENTS.md describing configuration purpose |
仅含目录的容器的最小 AGENTS.md 示例:
<!-- Parent: ../AGENTS.md -->
# {Directory Name}
## 用途
Container directory for organizing related modules.
## 子目录
| Directory | Purpose |
|-----------|---------|
| `subdir/` | Description (see `subdir/AGENTS.md`) |
<!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
# my-project
## 用途
A web application for managing user tasks with real-time collaboration features.
## 关键文件
| File | Description |
|------|-------------|
| `package.json` | Project dependencies and scripts |
| `tsconfig.json` | TypeScript configuration |
| `.env.example` | Environment variable template |
## 子目录
| Directory | Purpose |
|-----------|---------|
| `src/` | Application source code (see `src/AGENTS.md`) |
| `docs/` | Documentation (see `docs/AGENTS.md`) |
| `tests/` | Test suites (see `tests/AGENTS.md`) |
## 面向 AI Agents
### 在此目录工作
- Always install dependencies after modifying the project manifest
- Use TypeScript strict mode
- Follow ESLint rules
### 测试要求
- Run tests before committing
- Ensure >80% coverage
### 常见模式
- Use barrel exports (index.ts)
- Prefer functional components
## 依赖
### 外部
- React 18.x - UI framework
- TypeScript 5.x - Type safety
- Vite - Build tool
<!-- MANUAL: Custom project notes can be added below -->
<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2024-01-15 | Updated: 2024-01-15 -->
# components
## 用途
Reusable React components organized by feature and complexity.
## 关键文件
| File | Description |
|------|-------------|
| `index.ts` | Barrel export for all components |
| `Button.tsx` | Primary button component |
| `Modal.tsx` | Modal dialog component |
## 子目录
| Directory | Purpose |
|-----------|---------|
| `forms/` | Form-related components (see `forms/AGENTS.md`) |
| `layout/` | Layout components (see `layout/AGENTS.md`) |
## 面向 AI Agents
### 在此目录工作
- Each component has its own file
- Use CSS modules for styling
- Export via index.ts
### 测试要求
- Unit tests in `__tests__/` subdirectory
- Use React Testing Library
### 常见模式
- Props interfaces defined above component
- Use forwardRef for DOM-exposing components
## 依赖
### 内部
- `src/hooks/` - Custom hooks used by components
- `src/utils/` - Utility functions
### 外部
- `clsx` - Conditional class names
- `lucide-react` - Icons
<!-- MANUAL: -->
在已经有 AGENTS.md 文件的代码库上运行时: