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

c4-code

Skill này làm gì

Công cụ này phân tích các thư mục mã để tạo tài liệu chi tiết về cách các hàm và lớp được tổ chức, chúng dùng dữ liệu gì và kết nối với nhau như thế nào. Nó giúp hiểu cấu trúc bên trong của một chương trình.

Khi nào nên dùng

  • ✓Khi bắt đầu làm việc với một phần mới của mã.
  • ✓Khi bạn cần hiểu cách một phần mã cụ thể hoạt động.
  • ✓Khi tài liệu hóa một dự án cho các lập trình viên khác.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/c4-code/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/c4-code/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

“Tài liệu hóa thư mục 'utils' của dự án, hiển thị các hàm, tham số và phụ thuộc của chúng.”

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

Cách hoạt động

Công cụ kiểm tra các tệp mã trong thư mục được chỉ định. Nó xác định hàm, lớp, tham số, giá trị trả về và các phần khác của mã mà chúng sử dụng. Sau đó, nó sắp xếp thông tin này một cách rõ ràng.

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.

C4 Code Level: [Directory Name]

Use this skill when

  • Working on c4 code level: [directory name] tasks or workflows
  • Needing guidance, best practices, or checklists for c4 code level: [directory name]

Do not use this skill when

  • The task is unrelated to c4 code level: [directory name]
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.

Overview

  • Name: [Descriptive name for this code directory]
  • Description: [Short description of what this code does]
  • Location: [Link to actual directory path]
  • Language: [Primary programming language(s)]
  • Purpose: [What this code accomplishes]

Code Elements

Functions/Methods

  • functionName(param1: Type, param2: Type): ReturnType
    • Description: [What this function does]
    • Location: [file path:line number]
    • Dependencies: [what this function depends on]

Classes/Modules

  • ClassName
    • Description: [What this class does]
    • Location: [file path]
    • Methods: [list of methods]
    • Dependencies: [what this class depends on]

Dependencies

Internal Dependencies

  • [List of internal code dependencies]

External Dependencies

  • [List of external libraries, frameworks, services]

Relationships

Optional Mermaid diagrams for complex code structures. Choose the diagram type based on the programming paradigm. Code diagrams show the internal structure of a single component.

Object-Oriented Code (Classes, Interfaces)

Use classDiagram for OOP code with classes, interfaces, and inheritance:

---
title: Code Diagram for [Component Name]
---
classDiagram
    namespace ComponentName {
        class Class1 {
            +attribute1 Type
            +method1() ReturnType
        }
        class Class2 {
            -privateAttr Type
            +publicMethod() void
        }
        class Interface1 {
            <<interface>>
            +requiredMethod() ReturnType
        }
    }

    Class1 ..|> Interface1 : implements
    Class1 --> Class2 : uses

### Functional/Procedural Code (Modules, Functions)

For functional or procedural code, you have two options:

**Option A: Module Structure Diagram** - Use `classDiagram` to show modules and their exported functions:

```mermaid
---
title: Module Structure for [Component Name]
---
classDiagram
    namespace DataProcessing {
        class validators {
            <<module>>
            +validateInput(data) Result~Data, Error~
            +validateSchema(schema, data) bool
            +sanitize(input) string
        }
        class transformers {
            <<module>>
            +parseJSON(raw) Record
            +normalize(data) NormalizedData
            +aggregate(items) Summary
        }
        class io {
            <<module>>
            +readFile(path) string
            +writeFile(path, content) void
        }
    }

    transformers --> validators : uses
    transformers --> io : reads from
```

**Option B: Data Flow Diagram** - Use `flowchart` to show function pipelines and data transformations:

```mermaid
---
title: Data Pipeline for [Component Name]
---
flowchart LR
    subgraph Input
        A[readFile]
    end
    subgraph Transform
        B[parseJSON]
        C[validateInput]
        D[normalize]
        E[aggregate]
    end
    subgraph Output
        F[writeFile]
    end

    A -->|raw string| B
    B -->|parsed data| C
    C -->|valid data| D
    D -->|normalized| E
    E -->|summary| F
```

**Option C: Function Dependency Graph** - Use `flowchart` to show which functions call which:

```mermaid
---
title: Function Dependencies for [Component Name]
---
flowchart TB
    subgraph Public API
        processData[processData]
        exportReport[exportReport]
    end
    subgraph Internal Functions
        validate[validate]
        transform[transform]
        format[format]
        cache[memoize]
    end
    subgraph Pure Utilities
        compose[compose]
        pipe[pipe]
        curry[curry]
    end

    processData --> validate
    processData --> transform
    processData --> cache
    transform --> compose
    transform --> pipe
    exportReport --> format
    exportReport --> processData
```

### Choosing the Right Diagram


…
Câu hỏi thường gặp

“C4 Code-level” là gì?

Đó là cách tài liệu hóa mã bằng cách tập trung vào các chi tiết nội bộ như hàm và lớp, để giúp hiểu cấu trúc của một thành phần cụ thể.

Công cụ có thể tạo loại sơ đồ nào?

Nó có thể tạo sơ đồ lớp cho mã hướng đối tượng, hoặc sơ đồ luồng và cấu trúc module cho mã theo hàm và thủ tục, tùy theo kiểu viết mã.

Tôi có cần biết về mô hình C4 để dùng công cụ này không?

Không nhất thiết. Công cụ tập trung vào chi tiết mã, là một cấp độ của mô hình C4, nhưng bạn không cần là chuyên gia về mô hình này để dùng nó.

Chi tiết

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

Expert C4 Code-level documentation specialist. Analyzes code directories to create comprehensive C4 code-level documentation including function signatures, arguments, dependencies, and code structure.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#4098
Giấy phép
MIT
Cập nhật
15/10/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ự