Chuyển đến nội dung
Skillpedia
Agent14k · #11304

claude-code

Skill này làm gì

Skill này cho phép agent của bạn chạy công cụ dòng lệnh Claude Code để giao việc lập trình. Skill dành cho lập trình viên muốn một agent lập trình riêng làm việc trong khi họ tiếp tục công việc của mình.

Khi nào nên dùng

  • ✓Khi bạn muốn Claude Code sửa lỗi, thêm tính năng hoặc review mã trong một lần chạy.
  • ✓Khi tác vụ cần nhiều vòng chỉnh sửa, kiểm thử và review.
  • ✓Khi bạn muốn một công việc lập trình dài chạy ở nền.

Liên kết skill

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/claude-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/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/claude-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 muốn Claude Code sửa các test đang lỗi trong dự án của mình và báo lại những gì nó đã thay đổi.”

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

Cách hoạt động

Agent kiểm tra trước rằng công cụ claude đã được cài đặt và đăng nhập. Sau đó agent chọn chế độ in kết quả, phiên tương tác hoặc chạy nền tùy theo tác vụ.

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.

Claude Code Delegation

Delegate coding work to Claude Code, Anthropic's autonomous coding agent CLI.

Setup (once): npm install -g @anthropic-ai/claude-code && claude auth login · verify with claude auth status / claude doctor. CI token: claude setup-token. Full auth/install variants → references/flags.md.

Platform check (before running anything): detect the OS first. All shell examples in this skill are POSIX (bash). Linux/macOS run them as-is. On Windows, run Claude Code natively in PowerShell/Git Bash for print and background modes, but interactive tmux orchestration requires WSL. Shell-syntax translation table (quoting, env vars, piping, paths) → references/platforms.md.

Mode Selection (decide FIRST)

Task shape Mode Why
One-shot task: fix bug, add feature, review diff, extract data Print -p ← default No PTY, no dialogs, structured output
Multi-turn iterate: refactor → review → fix → test; needs slash commands Interactive tmux → references/interactive-tmux.md Full REPL, requires dialog handling
Long-running, shouldn't block; large fan-out supervision Background --bg Native supervision via claude agents
High-stakes PR review claude ultrareview [pr#] Cloud multi-agent, exit-code driven (uploads diff to cloud — never on branches with secrets)

Do NOT hand-roll tmux fan-outs for parallel work — prefer --bg + claude agents --json --all.

Print Mode (the 90% path)

terminal(command="claude -p 'Fix the auth bug in src/auth.py' \
  --allowedTools 'Read,Edit' --max-turns 10 --output-format json",
  workdir="/path/to/project", timeout=180)

Always set: workdir · --max-turns (5–10; print-mode only) · --allowedTools (least privilege: Read,Edit,Write,Bash, patterns like Bash(git *)).

JSON result fields: result (text) · session_id (for resume) · subtype (success | error_max_turns | error_budget) · total_cost_usd · num_turns · structured_output (with --json-schema).

Common variants:

git diff main... | claude -p 'Review for bugs' --max-turns 1     # pipe input, cheapest review
claude -p 'Continue: add pooling' --resume <session_id>          # resume; --continue = latest in cwd; --fork-session = branch
claude -p 'List functions' --output-format json --json-schema '<schema>' --max-turns 5   # structured extraction (needs turns to read files)
claude --bare -p 'task' --settings ci.json                       # CI: skips hooks/plugins/CLAUDE.md; auth = ANTHROPIC_API_KEY only
claude -p 'task' --max-budget-usd 0.50 --fallback-model haiku    # cost cap (min ~$0.05) + overload fallback

Streaming, stream-json events, bidirectional input, cache-reuse (--exclude-dynamic-system-prompt-sections) → references/print-mode.md.

Background Mode

claude --bg 'investigate flaky test in tests/api.test.ts'   # NOT compatible with -p
claude agents --json --all                                   # list/inspect
claude attach <id> | logs <id> | stop <id> | respawn <id> | rm <id>

Guardrails & Gotchas (violations break agents)

  1. -p auto-skips trust/permission dialogs (any non-TTY does) — only run in trusted directories.
  2. Interactive mode = tmux required (Windows: only inside WSL — never attempt tmux in PowerShell/cmd; fall back to -p or --bg); two startup dialogs, and the --dangerously-skip-permissions dialog defaults to "No, exit" (must send Down then Enter). Full patterns → references/interactive-tmux.md.
  3. Session resume is per-directory — --continue only finds sessions from the same cwd.
  4. Slash commands don't work in -p — describe the task in natural language instead.
  5. Context >70% degrades quality — in interactive sessions monitor /context, use /compact.
  6. Clean up: kill tmux sessions and claude stop/rm background sessions when done.
  7. Don't kill slow sessions — capture progress first (tmux capture-pane / claude logs).
  8. Report back: after completion, summarize what changed (use the JSON result + git diff).

References (read on demand)

File Read when
references/print-mode.md Streaming output, stream-json events, piping, schemas, session mgmt, cache reuse
references/interactive-tmux.md Any tmux/PTY session: dialogs, send-keys, monitoring, slash commands, shortcuts
references/flags.md Full CLI flag & subcommand tables, auth vari
Câu hỏi thường gặp

Nó có chạy mà không cần sự cho phép của tôi không?

Không. Skill chỉ được nạp khi bạn cho phép rõ ràng hoặc nêu tên Claude Code.

Nếu Claude Code chưa được cài đặt thì sao?

Agent dừng lại và hướng dẫn bạn cài đặt và đăng nhập.

Nó có chạy trên Windows không?

Chế độ in kết quả và chạy nền chạy trực tiếp, còn phiên tương tác cần WSL trên Windows.

Chi tiết

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

Operate Claude Code CLI (v2.1+) via the terminal. Load only when the user explicitly authorizes this skill or names Claude Code / claude-code. Before any command, confirm the `claude` binary is available; if missing, stop and give install or auth guidance. Covers print mode (-p), interactive tmux sessions, and background (--bg) orchestration.

repo: XiaomiMiMo/MiMo-Code

Độ phổ biến

Sao GitHub
14k
Vị trí xếp hạng
#11304
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ự