AI & Agentslow risk
code-import
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.
nexu-io/open-design·plugins/_official/atoms/code-import/SKILL.md
61/ 100推薦值
匯入這個 Skill
選擇你的 coding agent,複製專案級或個人級安裝指令。
匯入目前專案.agents/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a codex -y匯入個人環境~/.agents/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a codex -g -y匯入目前專案.claude/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a claude-code -y匯入個人環境~/.claude/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a claude-code -g -y匯入目前專案.agents/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a github-copilot -y匯入個人環境~/.copilot/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a github-copilot -g -y匯入目前專案.agents/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a cursor -y匯入個人環境~/.cursor/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a cursor -g -y匯入目前專案.agents/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a gemini-cli -y匯入個人環境~/.gemini/skills/code-import
npx skills add https://github.com/nexu-io/open-design/tree/7533db3f4342d09b27368fa5d907ebd3cdb93b75/plugins/_official/atoms/code-import -a gemini-cli -g -yNative Gemini CLI
gemini skills install https://github.com/nexu-io/open-design.git --scope workspace --path plugins/_official/atoms/code-import⚠ 安裝指令使用開源 skills CLI。執行前請檢查來源、腳本與權限。
Skill 指令
在 GitHub 查看原始檔案 ↗# 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
```text
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 a budget (`OD_CODE_IMPORT_BUDGET_MS`, 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
Reserved id, prompt-only fragment in v1. The walker + framework
detector land in spec §16 Phase 7.