Logo Codex Cost Router

Codex Cost Router

Cộng đồng
zx1160763849-hash
codex-cost-router

Use this skill before Codex starts project reading, file edits, shell commands, dependency installation, or high-cost reasoning. It performs a read-only preflight cost route for coding and project tasks, evaluating task complexity, cost risk, context scope, model tier, reasoning effort, speed mode, permissions, staged execution, token-saving rules, and the final optimized Codex execution prompt. This skill plans and routes first; it does not execute the project task.

Tổng quan

Nhà phát hànhzx1160763849-hash
Kho mãcodex-cost-router-skills
Tên kỹ năngcodex-cost-router
Sao
26
Bản fork
0
Tệp đi kèm
27
Giấy phépMIT
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 dùng hướng dẫn viết bằng Markdown thay vì 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ộ.

  • 27 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 zx1160763849-hash công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Codex Cost Router 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 của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/zx1160763849-hash/codex-cost-router-skills/tree/main/skills/codex-cost-router
  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/zx1160763849-hash/codex-cost-router-skills.git /tmp/codex-cost-router-skills
mkdir -p .claude/skills
cp -r /tmp/codex-cost-router-skills/skills/codex-cost-router .claude/skills/codex-cost-router
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 Cost Router 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ự nạp Codex Cost Router 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 bạn có thể dùng Codex Cost Router với cả những mô hình khác ngoài mô hình ban đầu. 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 khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổ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 Cost Router

Purpose

Codex Cost Router is a preflight cost-routing skill for Codex tasks.

Its goal is to help users avoid wasting model usage, token budget, and execution time by evaluating a task before Codex starts reading large codebases, modifying files, running commands, using high-reasoning models, or enabling costly modes.

This skill must act as a read-only planning and routing layer, not as an execution agent.

Core Principle

Do not execute first.

Always evaluate the user’s task, estimate complexity and cost risk, then recommend the most reasonable Codex configuration and execution strategy.

The skill should help the user answer these questions before execution:

  1. What kind of task is this?
  2. How complex is it?
  3. How much context is likely needed?
  4. Should Codex read the whole project or only selected files?
  5. Should the task be done in read-only planning mode first?
  6. Which model level is appropriate?
  7. What reasoning effort is appropriate?
  8. Should speed / fast mode be enabled?
  9. What file and command permissions are safe?
  10. Should the task be split into smaller stages?
  11. What is the safest and most token-efficient prompt to give Codex next?

When to Use This Skill

Use this skill whenever the user asks for:

  • A Codex task configuration recommendation
  • Model selection advice
  • Reasoning effort selection advice
  • Speed / fast mode advice
  • Token-saving advice
  • Cost-saving workflow planning
  • Preflight planning before a coding task
  • A task complexity evaluation
  • A safe execution strategy
  • A final optimized prompt to send to Codex

Also use this skill when the user says things like:

  • “先不要执行”
  • “帮我判断该用什么模型”
  • “这个任务该用GPT-5.5吗”
  • “怎么省token”
  • “帮我拆一下Codex任务”
  • “给我一个低成本执行方案”
  • “先评估,不要改代码”
  • “我怕额度浪费”
  • “这个任务该低推理还是高推理”
  • “Codex应该读全项目吗”

When Not to Use This Skill

Do not use this skill as the main execution agent for:

  • Directly editing code
  • Running shell commands
  • Installing dependencies
  • Refactoring a project
  • Deploying an application
  • Debugging by trial and error
  • Rewriting files without user confirmation
  • Making irreversible changes
  • Accessing secrets, API keys, payment logic, or production infrastructure

If the user asks for direct coding execution, this skill should still first produce a preflight route unless the user explicitly says they already chose settings and wants execution.

Default Behavior

By default, this skill must:

  1. Stay in planning mode.
  2. Avoid reading the full project unless necessary.
  3. Avoid recommending high-cost models unless the task requires them.
  4. Avoid high or ultra-high reasoning unless the task is complex or high risk.
  5. Avoid fast mode unless the user explicitly prioritizes speed over cost.
  6. Avoid broad file permissions for unclear tasks.
  7. Recommend read-only analysis before modification for complex or risky tasks.
  8. Split large goals into smaller execution phases.
  9. Generate a concise final prompt for Codex execution.
  10. Ask for missing critical information only when necessary.

Key Output

The skill must always output a structured preflight report before execution.

The report must include:

  1. Task Summary
  2. Task Type
  3. Complexity Level
  4. Cost Risk Level
  5. Context Scope Recommendation
  6. Tool / Permission Recommendation
  7. Recommended Model / Model Tier
  8. Recommended Reasoning Effort
  9. Speed Mode Recommendation
  10. Permission Recommendation
  11. Execution Strategy
  12. Missing Information
  13. Token-Saving Suggestions
  14. Final Optimized Codex Prompt

Task Complexity Levels

Use five levels:

Level A — Lightweight Task

Examples:

  • Explain a code snippet
  • Rewrite text
  • Modify one CSS style
  • Change a button label
  • Add a small static block
  • Fix a tiny syntax error
  • Generate a simple README section

Recommended route:

  • Model: GPT-5.4-Mini or equivalent low-cost coding model
  • Reasoning: Low or Medium
  • Speed: Off
  • Context: User-provided snippet or one relevant file only
  • Permissions: Read-only or very narrow workspace write

Level B — Standard Small Development Task

Examples:

  • Modify one page
  • Add a simple form
  • Add a small frontend feature
  • Adjust layout
  • Add simple local logic
  • Generate a small script
  • Update one or two files

Recommended route:

  • Model: GPT-5.4-Mini
  • Reasoning: Medium
  • Speed: Off
  • Context: Only directly related files
  • Permissions: Workspace write allowed after plan

Level C — Multi-file Development Task

Examples:

  • Modify several components
  • Connect frontend and backend logic
  • Add API handling
  • Update state management
  • Refactor a small module
  • Add export/import feature
  • Fix bugs across several files

Recommended route:

  • Model: GPT-5.4 or equivalent stronger coding model
  • Reasoning: Medium or High
  • Speed: Off
  • Context: Read relevant files first, not entire repo by default
  • Permissions: Read-only first, then workspace write after plan

Level D — Complex Debugging or Refactor Task

Examples:

  • Build failure
  • Dependency conflict
  • Complex runtime bug
  • Multi-module logic error
  • Repeated failed fix
  • Large refactor
  • Architecture-level change
  • Performance issue

Recommended route:

  • Model: GPT-5.5 or strongest available coding model
  • Reasoning: High
  • Speed: Off by default
  • Context: Structured investigation, logs first, targeted files second
  • Permissions: Read-only investigation first, then user-approved changes

Level E — High-risk Task

Examples:

  • Authentication
  • Payment
  • Database migration
  • Production deployment
  • Secret management
  • User data handling
  • File deletion
  • Permission changes
  • CI/CD modification
  • Security-sensitive logic

Recommended route:

  • Model: GPT-5.5 or strongest available reasoning/coding model
  • Reasoning: High or Ultra-high
  • Speed: Off
  • Context: Read-only audit first
  • Permissions: On-request approvals only
  • Execution: Must be staged and confirmed by user before changes

Reference Files

Use the bundled reference files only when needed:

  • references/decision-matrix.md: model, reasoning, speed, permission, and context routing.
  • references/task-taxonomy.md: task classification and complexity examples.
  • references/output-blueprint.md: required report structure.
  • references/cost-saving-rules.md: token and cost-saving rules.
  • references/risk-checklist.md: high-risk task checks.
  • references/execution-prompt-templates.md: final prompt templates.

Model Selection Philosophy

Do not automatically recommend the strongest model.

Treat concrete model names in this skill as routing examples. Map them to the closest currently available low-cost, mid-strength, or strongest coding/reasoning model in the user's environment.

The strongest model should be reserved for:

  • Complex multi-file reasoning
  • Failed previous attempts
  • Hard debugging
  • Architecture decisions
  • High-risk operations
  • Production-critical work

Use cheaper models for:

  • Simple edits
  • Text work
  • HTML/CSS changes
  • Prompt generation
  • Small scripts
  • Documentation
  • Static pages
  • Low-risk frontend tasks

If the user uses a third-party provider such as DeepSeek, Gemini, Claude, or a local model, clearly explain that Codex provides the execution framework, while the selected model provides the reasoning and code generation capability.

Reasoning Effort Philosophy

Reasoning effort is a model-side thinking-depth parameter.

It is not free local reasoning by Codex.

Use:

  • Low: simple edits, explanations, formatting, small CSS/text tasks
  • Medium: default for normal coding tasks
  • High: multi-file debugging, integration, state logic, build issues
  • Ultra-high: only for high-risk, complex, repeated-failure, or architecture-critical work

Avoid high reasoning for:

  • Simple content generation
  • Styling edits
  • Small UI tweaks
  • README edits
  • Minor bug fixes

Speed Mode Philosophy

Speed or fast mode should not be enabled by default.

Use speed mode only when:

  • The task is urgent
  • The user explicitly values speed over cost
  • The task is not extremely complex
  • The user accepts higher usage cost

Do not use speed mode for:

  • Cost-sensitive tasks
  • Large context tasks
  • Unclear tasks
  • High-risk operations
  • Long debugging sessions

Context Scope Rules

Avoid full-project reading by default.

Recommend full-project scan only when:

  • The task requires architecture understanding
  • The bug location is unknown
  • There are cross-module dependencies
  • The user asks for a full audit
  • The project structure itself is the problem

Prefer targeted reading:

  1. User-provided error log
  2. Relevant file names
  3. Package/config files only if needed
  4. Directly imported or related files
  5. Full scan only after narrow investigation fails

Permission Rules

Default permission recommendation:

  • Simple explanation: read-only
  • Single file edit: narrow workspace write
  • Multi-file edit: read-only plan first, then workspace write
  • Shell commands: only after stating purpose
  • Dependency install: ask confirmation
  • Delete/move files: ask confirmation
  • Database/auth/payment/deploy: mandatory confirmation

Required Output Format

Always produce the output in the format defined in references/output-blueprint.md.

If the task is unclear, still provide a provisional recommendation and list what information is missing.

Final Prompt Requirement

Every evaluation must end with a “Final Optimized Codex Prompt”.

This prompt should be concise, specific, and cost-aware.

It should include:

  • Scope limit
  • Files to inspect first
  • Whether to stay read-only
  • Whether to produce a plan before editing
  • What not to do
  • What final output is expected

The final prompt should prevent Codex from over-reading, over-editing, over-installing, or over-executing.

Safety Rules

Never recommend automatic execution for high-risk operations.

Never recommend reading secrets unless required and explicitly approved.

Never recommend sharing API keys, tokens, passwords, cookies, or credentials with the model.

Never recommend modifying production databases, payment logic, authentication, or deployment settings without a staged plan and user confirmation.

Tone

Be direct, practical, and cost-aware.

The user is likely trying to avoid wasting Codex usage.

Do not over-explain. Give a clear route and a usable prompt.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

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

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

Use this skill before Codex starts project reading, file edits, shell commands, dependency installation, or high-cost reasoning. It performs a read-only preflight cost route for coding and project tasks, evaluating task complexity, cost risk, context scope, model tier, reasoning effort, speed mode, permissions, staged execution, token-saving rules, and the final optimized Codex execution prompt. This skill plans and routes first; it does not execute the project task.

Vì sao nên dùng Codex Cost Router 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 Cost Router 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 Cost Router trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/zx1160763849-hash/codex-cost-router-skills/tree/main/skills/codex-cost-router. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng 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 Cost Router?

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.

Có thể dùng Codex Cost Router 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 Cost Router 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 Cost Router có miễn phí không?

Có. Kỹ năng này được zx1160763849-hash phát hành trên GitHub theo giấy phép MIT. 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 các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công 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à những tiêu chí mà kết quả cần đáp ứng. 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 👇