Chuyển đến nội dung
Skillpedia
Tài liệu kỹ thuật41k · #7000

deepinit

Skill này làm gì

Skill này để agent viết một bộ tệp tài liệu trong một dự án mã. Skill dành cho các nhóm muốn trợ lý AI hiểu bố cục và quy tắc của dự án ngay từ đầu.

Khi nào nên dùng

  • ✓Khi bạn muốn trợ lý AI hiểu nhanh một codebase mới hoặc chưa quen.
  • ✓Khi một dự án lớn chưa có ghi chú giải thích mỗi thư mục dùng để làm gì.
  • ✓Khi bạn muốn các tệp tài liệu được đặt trong mỗi phần quan trọng của dự án.

Liên kết skill

https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/deepinit/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/deepinit/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy thiết lập các ghi chú AGENTS.md khắp codebase của chúng tôi để các trợ lý AI sau này hiểu từng thư mục.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent đọc cấu trúc dự án và viết một ghi chú ngắn trong mỗi thư mục quan trọng, liên kết với thư mục cha. Mỗi ghi chú liệt kê thư mục chứa gì, các phần kết nối với nhau thế nào, và mọi quy tắc đặc biệt.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Deep Init Skill

Creates comprehensive, hierarchical AGENTS.md documentation across the entire codebase.

Core Concept

AGENTS.md files serve as AI-readable documentation that helps agents understand:

  • What each directory contains
  • How components relate to each other
  • Special instructions for working in that area
  • Dependencies and relationships

Hierarchical Tagging System

Every AGENTS.md (except root) includes a parent reference line:

**Parent context:** `../AGENTS.md`

This MUST be visible prose, never an HTML comment. Claude Code strips HTML comments before a memory file reaches the model, so <!-- Parent: ... -->, <!-- Generated: ... --> and a commented MANUAL boundary are invisible to the agent that is supposed to act on them.

This creates a navigable hierarchy:

/AGENTS.md                          ← Root (no parent line)
├── src/AGENTS.md                   ← **Parent context:** `../AGENTS.md`
│   ├── src/components/AGENTS.md    ← **Parent context:** `../AGENTS.md`
│   └── src/utils/AGENTS.md         ← **Parent context:** `../AGENTS.md`
└── docs/AGENTS.md                  ← **Parent context:** `../AGENTS.md`

Loading Model

Stock Claude Code discovers nested CLAUDE.md by basename and never loads a nested AGENTS.md; a root @AGENTS.md import does not reach subdirectories either. The nested files generated here are delivered by OMC's PostToolUse directory-context injector, which walks up from each accessed file and injects the nearest AGENTS.md/README.md once per session.

That means the hierarchy requires OMC's hooks to be active. When OMC hooks are disabled (DISABLE_OMC=1, OMC_SKIP_HOOKS=post-tool-use) or the plugin is not registered, add a root-level CLAUDE.md symlink or @AGENTS.md import for the root file and expect nested files to stay unread.

AGENTS.md Template

# {Directory Name}

**Parent context:** `{relative_path_to_parent}/AGENTS.md`
**Generated:** {timestamp} · **Updated:** {timestamp}

## Purpose
{One-paragraph description of what this directory contains and its role}

## Key Files
{List each significant file with a one-line description}

| File | Description |
|------|-------------|
| `file.ts` | Brief description of purpose |

## Subdirectories
{List each subdirectory with brief purpose}

| Directory | Purpose |
|-----------|---------|
| `subdir/` | What it contains (see `subdir/AGENTS.md`) |

## For AI Agents

### Working In This Directory
{Special instructions for AI agents modifying files here}

### Testing Requirements
{How to test changes in this directory}

### Common Patterns
{Code patterns or conventions used here}

## Dependencies

### Internal
{References to other parts of the codebase this depends on}

### External
{Key external packages/libraries used}

## Manual Notes

Notes under this heading are written by humans and preserved on regeneration.

Execution Workflow

Step 1: Map Directory Structure

Task(subagent_type="explore", model="haiku",
  prompt="List all directories recursively. Exclude: node_modules, .git, dist, build, __pycache__, .venv, coverage, .next, .nuxt")

Step 2: Create Work Plan

Generate todo items for each directory, organized by depth level:

Level 0: / (root)
Level 1: /src, /docs, /tests
Level 2: /src/components, /src/utils, /docs/api
...

Step 3: Generate Level by Level

IMPORTANT: Generate parent levels before child levels to ensure parent references are valid.

For each directory:

  1. Read all files in the directory
  2. Analyze purpose and relationships
  3. Generate AGENTS.md content
  4. Write file with proper parent reference

Step 4: Compare and Update (if exists)

When AGENTS.md already exists:

  1. Read existing content
  2. Identify sections:
    • Auto-generated sections (can be updated)
    • Manual sections (the ## Manual Notes heading and everything under it are preserved)
  3. Compare:
    • New files added?
    • Files removed?
    • Structure changed?
  4. Merge:
    • Update auto-generated content
    • Preserve manual annotations
    • Update timestamp

Step 5: Validate Hierarchy

After generation, run validation checks:

Check How to Verify Corrective Action
Parent references resolve Read each AGENTS.md, check the **Parent context:** path exists Fix path or remove orphan
No orphaned AGENTS.md Compare AGENTS.md locations to directory structure Delete orpha
Câu hỏi thường gặp

Các ghi chú có được viết dưới dạng ẩn không?

Không. Liên kết cha là văn bản thường, vì chú thích ẩn sẽ không đến được AI.

Nó có thay đổi mã của tôi không?

Mục đích của nó là viết tệp tài liệu, nên các ghi chú được thêm cạnh mã.

Claude Code có tự động tải các tệp này không?

Claude Code chuẩn không tự tải các tệp AGENTS.md lồng nhau, nên skill được xây dựng quanh cách chúng đến được AI.

Chi tiết

Mô tả gốc của tác giả

Deep codebase initialization with hierarchical AGENTS.md documentation

repo: Yeachan-Heo/oh-my-claudecode

Độ phổ biến

Sao GitHub
41k
Vị trí xếp hạng
#7000
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự