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

codex

Skill này làm gì

Skill này chạy OpenAI Codex CLI như một worker cho các tác vụ lập trình tự động. Skill dành cho lập trình viên muốn viết tập lệnh hoặc tự động hóa việc thay đổi và kiểm tra mã.

Khi nào nên dùng

  • ✓Khi bạn muốn một tác vụ lập trình chạy ở nền mà không có cửa sổ chat.
  • ✓Khi bạn cần thiết lập Codex trong một tập lệnh, công việc CI hoặc máy chủ.
  • ✓Khi bạn muốn phân tích chỉ đọc một kho mã mà không thay đổi tệp nào.

Liên kết skill

https://github.com/XiaomiMiMo/MiMo-Code/blob/main/packages/cli/src/skill/builtin/.bundle/codex/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/codex/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 Codex review kho mã của mình ở chế độ chỉ đọc và liệt kê các phần rủi ro mà không thay đổi tệp nào.”

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

Cách hoạt động

Agent dùng lệnh codex exec với cài đặt sandbox an toàn, truyền tác vụ như một prompt và trả về kết quả. Agent xác nhận công cụ đã được cài đặt trước khi chạy bất cứ thứ gì.

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.

Codex CLI

Use Codex CLI as a deterministic, non-interactive worker suitable for automation and agent orchestration.

Operating Rules

  1. Use codex exec, not the interactive codex TUI.
  2. Pass the task as the positional PROMPT argument. Do not use -p for the prompt; -p selects a profile.
  3. For ordinary unattended code changes, prefer:
codex exec \
  -C /path/to/repo \
  --sandbox workspace-write \
  --ask-for-approval never \
  "<TASK>"
  1. Use --yolo only inside an externally hardened and disposable runner. It disables Codex approvals and sandboxing.
  2. For harnesses and CI, prefer --json plus --output-last-message.
  3. Do not make the run depend on a human answering questions. Resolve ambiguity using repository evidence and conservative defaults.
  4. Treat credentials as secrets. Inject CODEX_API_KEY only into the single codex exec process when possible.
  5. Before giving version-sensitive advice, inspect codex exec --help or current official Codex documentation if available.
  6. On Windows, choose one execution environment per task: native PowerShell for Windows toolchains or WSL2 for Linux toolchains. Do not casually mix paths, installations, or authentication across them.

Choose the Execution Mode

Read-only analysis

Use when the task must not modify files:

codex exec \
  -C /path/to/repo \
  --sandbox read-only \
  --ask-for-approval never \
  "Analyze the repository and report risks. Do not modify files."

Workspace-scoped implementation

Use as the default for autonomous repository work:

codex exec \
  -C /path/to/repo \
  --sandbox workspace-write \
  --ask-for-approval never \
  "Implement the task, run relevant tests, and report unresolved blockers."

Externally isolated unrestricted execution

Use only when the enclosing container, VM, or sandbox enforces the real security boundary:

codex exec \
  -C /workspace/repo \
  --yolo \
  "Implement the task and validate the result."

Never recommend --yolo on a normal developer machine or a runner containing unrelated secrets, host mounts, SSH keys, cloud credentials, or a Docker socket.

Construct an Autonomous Prompt

When headless execution could encounter choices, prepend these instructions:

Work fully autonomously.

Do not ask the user questions and do not request interactive input.
Inspect the repository and available context before making assumptions.
When several valid approaches exist, choose the option that:
1. minimizes unrelated changes,
2. preserves backward compatibility,
3. introduces the fewest new dependencies,
4. avoids destructive or irreversible actions.

Continue until the task is complete or a concrete blocking error is reached.
Record assumptions, validation performed, and unresolved blockers in the final response.

Do not simulate "always select the first option." Option ordering is not a safety or quality policy. Apply the explicit decision rules above instead.

Handle request_user_input Failures

When Codex reports that request_user_input is unavailable in Default mode or non-interactive mode:

  1. Confirm the invocation uses codex exec and is intentionally headless.
  2. Add the autonomous prompt policy above.
  3. Supply missing decisions in the task prompt or AGENTS.md when they are known in advance.
  4. Replace open-ended requests such as "ask me which approach" with deterministic selection criteria.
  5. If the choice is safety-critical, destructive, or impossible to infer, make the run fail clearly rather than selecting randomly.
  6. Do not attempt to emulate terminal keystrokes unless the subprocess itself, rather than Codex, requires input and the workflow explicitly defines the safe answer.

Pass Prompts and Context

Use a direct positional prompt:

codex exec "Summarize the repository structure."

Read the prompt from stdin:

codex exec - < prompt.md

Pipe dynamic context while retaining an explicit task:

npm test 2>&1 | codex exec "Analyze this test output and fix the repository."

Use --skip-git-repo-check only for intentional one-off directories outside Git:

codex exec \
  --skip-git-repo-check \
  -C /tmp/task \
  "Analyze the files in this directory."

Produce Harness-Friendly Output

Capture only the final message

codex exec \
  -C /workspace/repo \
  --output-last-message /output/final.md \
  "Review the codebase."

Stream JSONL ev

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

Nó có hỏi tôi câu nào trong lúc chạy không?

Skill được thiết kế cho các lần chạy không cần người trông, nên nó tự xử lý những điểm chưa rõ từ kho mã và các mặc định an toàn.

API key của tôi có an toàn không?

Skill nói hãy coi thông tin đăng nhập là bí mật và chỉ truyền key cho tiến trình cần nó.

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

Có. Skill bao gồm PowerShell gốc và WSL2, và nói nên chọn một môi trường cho mỗi tác vụ.

Chi tiết

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

Operate OpenAI Codex CLI in non-interactive headless environments. Load only when the user explicitly authorizes this skill or names Codex / codex. Before any command, confirm the `codex` binary is available; if missing, stop and give install or auth guidance. Covers `codex exec` automation in Bash or PowerShell, native Windows or WSL2, scripts, CI/CD, Docker, Kubernetes, remote servers, agent harnesses, sandbox and approval modes, JSONL events, session resume, and stdin prompts.

repo: XiaomiMiMo/MiMo-Code

Độ phổ biến

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