Chuyển đến nội dung
Skillpedia
Lập trình chung101k · #979

code-import

Skill này làm gì

Công cụ này đọc cấu trúc của một dự án mã hiện có và lưu lại dưới dạng một “ảnh chụp” có tổ chức. Nhờ đó, AI có thể phân tích mã của bạn mà không phải “duyệt” qua tất cả các tệp mỗi lần cần.

Khi nào nên dùng

  • ✓Khi bạn muốn AI hiểu cấu trúc dự án của mình.
  • ✓Khi bạn muốn AI không phải phân tích lại mã của bạn nhiều lần.
  • ✓Khi bạn sắp nhờ AI sửa đổi hoặc đề xuất thay đổi cho mã của bạn.

Liên kết skill

https://github.com/nexu-io/open-design/blob/main/plugins/_official/atoms/code-import/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/nexu-io/open-design/blob/main/plugins/_official/atoms/code-import/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

“Nhập dự án của tôi từ '/path/to/my/project' cho bộ công nghệ [React, npm, CSS, Material UI].”

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

Cách hoạt động

AI truy cập đường dẫn dự án của bạn, phân tích các tệp và lưu một bản tóm tắt có tổ chức. Bản tóm tắt này được dùng cho các lần phân tích sau, giúp tiết kiệm thời gian.

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.

Code import

Spec §10 / §21.3.2: a code-migration / tune-collab run starts from a real repo (cloned via od project import or a path the user provided). This atom turns the raw checkout into a normalised on-disk record that subsequent atoms (design-extract, rewrite-plan, patch-edit) operate against. The point is to stop re-walking the tree on every turn — the agent reads code/index.json once and trusts the snapshot until the next explicit re-import.

Inputs

Source Required Notes
repoPath yes Absolute path to the repo's root, supplied via od project import or an upstream od.context.assets[] reference
targetStack yes { framework, packageManager, styleSystem, componentLibrary } via the matching form GenUI surface

Output

project-cwd/
└── code/
    ├── index.json         # { files: { path, size, language, imports[] }[], packageJson?, lockfileKind, framework, styleSystem }
    ├── components.json    # detected components with file path + props snapshot
    ├── routes.json        # detected routing model (next/app, react-router, vite-router, …)
    └── meta.json          # { repoPath, gitSha, walkedAt, atomDigest, walkBudgetMs }

code/index.json is the input every other Phase 7 atom reads. The walk respects the runner's budgetMs option (default 60s) so large monorepos don't burn an entire run on import.

Convergence

The atom completes when code/index.json exists and contains at least one entry. Empty repos abort with a clear error event so the user re-imports.

Anti-patterns the prompt fragment forbids

  • Walking node_modules / .git / .next / dist / build (record in code/index.json.skipped[] with reason).
  • Inferring a framework from a single file; require at least package.json's declared dep + a build-config presence (next.config.*, vite.config.*, etc.).
  • Treating commented-out imports as live edges.

Status

Implemented by the daemon runner in apps/daemon/src/plugins/atoms/code-import.ts. The walker enforces its exclusions and time budget, detects framework evidence, and writes code/index.json.

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

Điều gì xảy ra nếu dự án quá lớn?

Công cụ có giới hạn thời gian để phân tích dự án, đảm bảo quá trình không kéo dài quá lâu, ngay cả với dự án lớn.

AI có phân tích các thư mục như “node_modules” không?

Không, AI bỏ qua các thư mục phụ thuộc hoặc build như “node_modules”, “.git” hay “dist”, chỉ tập trung vào mã liên quan.

AI biết dự án của tôi dùng công nghệ gì bằng cách nào?

AI kiểm tra tệp “package.json” và các tệp cấu hình build để xác định framework, trình quản lý gói và các công nghệ khác đang dùng.

Chi tiết

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

Read an existing repository's structure into the project cwd as a normalised snapshot the agent can analyse without re-walking the tree on every turn.

repo: nexu-io/open-design

Độ phổ biến

Sao GitHub
101k
Vị trí xếp hạng
#979
Giấy phép
Apache-2.0
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ự