Logo Codex

Codex

Cộng đồng
iamneilroberts
codex

Delegate a task or question to the OpenAI Codex CLI running as an isolated subagent, then relay its answer. Use when the user invokes /codex <prompt>, says "ask codex", "have codex look at / do X", or wants a second independent model to investigate a question or make a self-contained edit. Read-only by default; /codex --write lets Codex edit the working tree. Distinct from /codex-review, which is the structured JSON review gate — /codex is a general-purpose Codex delegate.

Tổng quan

Nhà phát hànhiamneilroberts
Kho mãclaude-skills
Tên kỹ năngcodex
Sao
37
Bản fork
6
Tệp đi kèm
1
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI là Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được iamneilroberts công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Codex trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/iamneilroberts/claude-skills/tree/main/skills/codex
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/iamneilroberts/claude-skills.git /tmp/claude-skills
mkdir -p .claude/skills
cp -r /tmp/claude-skills/skills/codex .claude/skills/codex
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Codex trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự tải Codex ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên Codex không bị giới hạn ở mô hình mà kỹ năng này được viết cho. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên kỹ năng chưa dùng không tốn chi phí.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

/codex — delegate to the Codex CLI via a subagent

Runs the OpenAI Codex CLI (codex exec) on the user's prompt inside a dispatched subagent, so Codex's (possibly large) output stays out of the main context and you relay only its answer. Codex is a genuinely independent model — good for a second opinion, an adversarial read, or offloading a self-contained investigation or edit.

Helper: codex.sh (this skill's dir) runs codex exec, captures only Codex's final message (-o), and falls back across models on failure.

When to use

  • /codex <prompt> — hand any question or task to Codex against this repo.
  • "ask codex to …", "have codex look at …", "get codex to write / refactor …".
  • NOT the structured review gate — that's /codex-review.

How to run

  1. Parse the invocation. Everything after /codex is the PROMPT. Flags:

    • --write → Codex may edit the working tree (workspace-write sandbox). Default is read-only.
    • -m <model> → pin a Codex model. --dir <path> → working root (default: repo root).
  2. Dispatch ONE subagent (Agent tool, subagent_type: general-purpose). Pin the model explicitly: haiku for a plain ask/relay; sonnet if Codex is making edits and you want the result sanity-checked. Give it this task (substitute <SKILL_DIR> = this skill's base directory, and <PROMPT>):

    Run the Codex CLI and return its final answer VERBATIM — trim only banner/progress noise, do not summarize or editorialize. Run: printf %s '<PROMPT>' | bash <SKILL_DIR>/codex.sh [--write] [--stats] [-m MODEL] - (stdin form avoids quoting problems for long or quote-heavy prompts). If the script exits non-zero, report its stderr line so the caller can retry. If --write was used, also run git status --short and git --no-pager diff afterward and include a short list of what Codex changed.

    Only pass --stats when the user asked for Codex's token usage or API cost (e.g. a model comparison / cost accounting). It appends a token-usage + estimated-cost block after the answer; relay that block verbatim. Omit --stats for normal delegation so output stays clean. Cost is an estimate — override the rates with CODEX_PRICE_INPUT_PER_M / CODEX_PRICE_CACHED_PER_M / CODEX_PRICE_OUTPUT_PER_M if the model's real pricing differs.

  3. Relay Codex's answer to the user, attributed ("Codex says:") so it's clear this is the second model, not you. If --write was used, review the diff the subagent returned and summarize what Codex changed before trusting it — never present Codex's edits as verified without looking at the diff.

Notes

  • Read-only is the safe default; pass --write only when the user clearly wants Codex to edit files.
  • Codex's output is not ground truth. Verify anything that matters — especially --write edits — against the actual code and the test suite.
  • If codex.sh reports rate-limit / auth failure, tell the user and offer to retry (or try a different -m model). If it exits 3 (CODEX-INFRA: empty final message), the run is an infra failure — never interpret it as a completed task; any --write diff is unreviewed salvage.

Constraint design (MANDATORY for --write dispatches)

Never issue a constraint set whose only nominal success path is gaming. In particular, never combine "change behavior" with "all existing tests must stay green" — that exact combination has produced a manufactured green in practice (dozens of suites pinned to legacy exports via vi.mock/import aliases so the new behavior was never exercised). Reformulate: "expected failures are FINDINGS — list them; do not make them pass." Every implementation prompt MUST include:

  1. The escape hatch, verbatim or equivalent: "If any existing test fails and the fix is not a straightforwardly legitimate assertion update, or any two instructions here conflict: STOP, report, and change nothing to work around it. A stopped run with a clear report is a SUCCESS; a green suite obtained by mocks, aliases, wrapper exports, fixture reshaping, or snapshot regeneration is a FAILURE."
  2. A disclosure ledger requirement: counts of test files changed, assertions changed (before/after), mocks/aliases added (must be 0), snapshots touched (must be 0 or itemized).
  3. Scope fences (CREATE-ONLY / READ-ONLY file lists — these have a clean track record).
  4. Your repo's fixture rules restated whenever tests will be written (Codex never sees your CLAUDE.md): fixtures derive from the REAL writer; relative dates only; assert independently enumerated values, never the code-under-test's own output.

Verification (before trusting any --write result — applies to EVERY worker, not just Codex)

  • Tier 0 (always): independently re-run every claimed command; run the mechanical mock sweep git diff -U0 -- '*.test.*' | grep -nE '^\+.*(vi\.(do)?mock|Legacy)' — any hit is an automatic stop; an empty final message is INFRA (codex.sh exits 3), never a result; record the model id + token count into your run log.
  • Tier 1 (new tests/fixtures): tautology + reader-shaped-fixture spot-check; a couple of targeted mutants on the claimed-critical logic.
  • Tier 2 (live behavior / "behavior-preserving"): a behavioral old-vs-new capture diff is the non-negotiable gate; the instrument must not be solely authored by the same worker; use a top-tier model for the verification wrapper, doing an adversarial code READ, not a suite re-run.
  • Wrapper protocol: after launching a background codex job, arm a monitor on the process; the driver arms a backstop. Silence long past job completion is a defect, not a signal to assume success.

Retirement rule

One manufactured-green incident (mocked/aliased/tautologized tests presented as passing verification) retires Codex from that lane immediately. Re-entry, if any: greenfield-only, Tier-2 verification, several consecutive clean packages, never sole author of a verification instrument.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

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

Kỹ năng AI Codex làm được gì?

Delegate a task or question to the OpenAI Codex CLI running as an isolated subagent, then relay its answer. Use when the user invokes /codex <prompt>, says "ask codex", "have codex look at / do X", or wants a second independent model to investigate a question or make a self-contained edit. Read-only by default; /codex --write lets Codex edit the working tree. Distinct from /codex-review, which is the structured JSON review gate — /codex is a general-purpose Codex delegate.

Vì sao nên dùng Codex trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Codex là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Codex trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/iamneilroberts/claude-skills/tree/main/skills/codex. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Codex?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Bạn có thể dùng Codex với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Codex với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Codex có miễn phí không?

Kỹ năng này được iamneilroberts phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp cho mô hình các công cụ mới để gọi — mã được chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và tiêu chí của đầu ra tốt. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇