executor-capability-gate

A pre-check for calling external coding agents such as Codex or Gemini. It checks that the command-line tool is installed, credentials exist, the network works, rate limits allow a call, and the request is usable.

In plain words
What is it for?
Verify external-agent readiness, detect missing login or network access, avoid calls during rate limits, and decide whether to call Codex or use a fallback.
Why use it?
It catches setup and connectivity problems before spending time on an external call. When Codex cannot be used, it specifies returning to Claude.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jerrylalala/compound-engineering/executor-capability-gate
Any agent
npx skills add Jerrylalala/compound-engineering --skill executor-capability-gate
Clone the repo
git clone --depth 1 https://github.com/Jerrylalala/compound-engineering

Made for: Claude Code, Codex.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,373 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00066 $0.01373
Opus 5 $0.00033 $0.00687
Sonnet 5 $0.00013 $0.00275
Haiku 4.5 $0.00007 $0.00137

Measured 2d ago against content hash 67fcf84a7700, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

executor-capability-gate scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

LAST_CALL=$(cat ~/.codex/.last_call 2>/dev/null || echo "0")

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s --max-time 5 "https://api.openai.com" -o /dev/null -w "%{http_code}"
plugins/compound-engineering/skills-custom/executor-capability-gate/SKILL.md · 161 lines

How it starts

The opening of the file, as written. The whole thing — 161 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Executor Capability Gate — 外部调用前置检查

Codex 洞察(P8,新增项):调用外部模型前做前置检查比"自动路由"更实用。 5 项检查防止无效调用,是 P7 Codex-first Executor 的前置依赖。


五项前置检查

Check 1: CLI 安装检查

# Codex
command -v codex &>/dev/null
echo "exit: $?"  # 0=已安装, 1=未安装

# Gemini
command -v gemini &>/dev/null

失败处理

❌ Codex CLI 未安装
   安装命令:npm install -g @openai/codex
   或:bun install -g @openai/codex

Check 2: 登录状态检查

# Codex - 检查凭据文件是否存在(codex --version 无需登录,不能用于验证)
[ -f ~/.codex/auth.json ] && echo "OK" || echo "NOT_LOGGED_IN"

# Gemini
gemini --version 2>&1 | grep -q "version" && echo "OK" || echo "NOT_LOGGED_IN"

失败处理

❌ Codex 未登录(~/.codex/auth.json 不存在)
   登录命令:codex  (首次运行引导登录)

Check 3: 网络连通性检查

# 检查网络可达性(仅连通性,不含认证——凭据走 auth.json,非 OPENAI_API_KEY)
curl -s --max-time 5 "https://api.openai.com" -o /dev/null -w "%{http_code}"
# 非 000 = 网络可达(包括 401 均表示网络通)
# 000 = 网络不可达

失败处理

❌ 网络不可达(curl 返回 000)
   跳过 Codex 调用,退回 Claude 执行

Check 4: Rate Limit 检查

# 检查最近 Codex 调用记录(简单本地记录)
# 注意:~/.codex/.last_call 由本 gate 在调用通过后写入(见门控输出格式末尾)
LAST_CALL=$(cat ~/.codex/.last_call 2>/dev/null || echo "0")
NOW=$(date +%s)
ELAPSED=$((NOW - LAST_CALL))

if [ $ELAPSED -lt 60 ]; then
  echo "RATE_LIMITED: 距上次调用 ${ELAPSED}s,建议等待至少 60s"
fi

# 调用通过后,写入时间戳(防止频繁调用):
# echo $(date +%s) > ~/.codex/.last_call

重要:调用 Codex 成功完成后,必须执行 echo $(date +%s) > ~/.codex/.last_call 以更新记录,否则 rate limit 检查永远通过(文件不存在时 ELAPSED 极大)。

Check 5: 任务适配性检查

根据任务特征快速判断(详细决策逻辑见 codex-first-executor skill):

任务特征 Codex 适合?
大量机械 patch(格式化、重命名) ✅ 适合
高风险改动(auth、payment、migration) ❌ 不适合
纯分析/research 任务 ✅ 适合
视觉/UI 任务 ❌ 不适合
需要项目上下文的重构 ⚠️ 谨慎

门控输出格式

每次外部调用前输出检查结果:

🔍 Executor Capability Gate — Codex 检查

  ✅ CLI 已安装 (codex v0.1.x)
  ✅ 已登录
  ✅ 网络正常 (API 200)
  ✅ Rate limit 正常 (距上次 120s)
  ✅ 任务适合 Codex(批量 patch)

  → 允许调用 Codex

或:

🔍 Executor Capability Gate — Codex 检查

  ✅ CLI 已安装
  ❌ Rate limit(距上次仅 30s)
  ⚠️  任务高风险(涉及 auth/payment)

  → 跳过 Codex,由 Claude 执行
     理由:rate limit + 高风险任务不适合外部执行器

Read the full file on GitHub · 161 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 161 lines · 66 tokens per session scan B 67fcf84a7700

Subscribe to this mod's changes

executor-capability-gate is a skill published in the GitHub repository Jerrylalala/compound-engineering (5 stars, last pushed 3mo ago), licensed MIT. It adds 66 tokens to every session and 1,373 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens