using-cpython-optimize

A routing guide for optimizing CPython and CinderX, a Python runtime with just-in-time compilation. It assigns environment checks, tests, performance work, crash analysis, and processor-specific investigation to the right workflow.

In plain words
What is it for?
Use it for CPython or CinderX optimization, JIT issues, crashes, pyperformance tests, runtime tests, and differences between Kunpeng ARM and x86 systems.
Why use it?
It helps choose an appropriate investigation path and prevents unsupported performance conclusions when the environment or tests are incomplete.

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/sisibeloved/cpython-optimize-skill/using-cpython-optimize
Any agent
npx skills add sisibeloved/cpython-optimize-skill --skill using-cpython-optimize
Clone the repo
git clone --depth 1 https://github.com/sisibeloved/cpython-optimize-skill

Made for: Claude Code, Codex.

Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,385 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00056 $0.01385
Opus 5 $0.00028 $0.00692
Sonnet 5 $0.00011 $0.00277
Haiku 4.5 $0.00006 $0.00138

Measured yesterday against content hash d3c6e00c1482, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

using-cpython-optimize scanned grade A with 0 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cpython-optimize-skill/skills/using-cpython-optimize/SKILL.md · 82 lines

How it starts

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

CPython/CinderX Optimize Router

薄 router:Orchestrator 选 Workflow,Workflow 分派 Agent,Agent 调专业 Skill。

层级

职责
Orchestrator 运行时主 Agent,理解目标、选 Workflow、分派 Agent、合并结果
Workflow 端到端剧本和 gate
Agent 阶段负责人,接管环境、跑分、crash、JIT 或平台分析
Skill CPython/CinderX 专业动作

Agent 路由

Agent 文档不是原生 Skill 自动触发单元。主 Agent 或 hook 一旦决定分派某个 Agent,必须按 agents/<agent>.md 路径显式读取对应角色文档,再执行其职责、反问 Gate 和输出要求。

Agent 触发
cinderx-orchestrator 任意入口和任务分发
cinderx-environment-verifier / environment-verifier 环境审计、三态判断
pyperformance-baseline-runner / baseline-runner baseline slot 跑分
pyperformance-candidate-runner / candidate-runner candidate slot 跑分
pyperformance-benchmark-analyst run.json / speedup.json 结果解读
cinderx-crash-triager / crash-triager SIGSEGVexit 139、core dump
cinderx-jit-analyst CinderX JIT、HIR/LIR、解释执行用例、机器码优化点
cinderx-platform-analyst Kunpeng/x86、ISA、微架构差异
cinderx-evidence-analyst 单用例证据表、跨层根因下钻、穿刺判读

反问 Gate

能从仓库、环境、日志或历史产物查证的信息先查证,不问用户。以下信息无法唯一确定时必须暂停反问:

缺口 典型问题
目标路线 三个主 Workflow、supporting workflow 或验证等级无法唯一选择
实验轴 benchmark、平台、baseline/candidate、JIT 口径或环境句柄缺失
高成本动作 清理环境、bootstrap、在线安装、编译 CinderX、全量 Runtime、全量 pyperformance
运行中异常 远端无输出、timeout、网络卡顿时需要继续等待、换镜像、复用缓存或中止
证据链断裂 crash 缺真实命令/core,结果比较缺配对 run.json,平台分析缺平台对

平台映射:Codex 优先用 request_user_input,Claude Code 优先用 AskUserQuestion;工具不可用时,退化为普通文本选择题并等待用户回答。

需要结构化选项时读取 references/clarifying-question-templates.md,复用其中的 question_id、选项和文本降级格式。

Environment Verifier 三态

状态 下一步
可复用 / reusable 返回环境句柄
新环境 / needs_bootstrap cinderx-env-bootstrap
被破坏 / needs_clean_bootstrap cinderx-env-clean 再 bootstrap

专业 Skill

cinderx-env-validatecinderx-env-cleancinderx-env-bootstrapcinderx-remote-lab-opscinderx-ab-run-slotcpython-runtime-test-runcinderx-smoke-checkpyperformance-worker-runpyperformance-suite-runpyperformance-result-comparepyperformance-stat-reportcinderx-gdb-core-triagecinderx-hir-dumpcinderx-jit-entry-checkcinderx-hir-lir-analyzecinderx-interpreter-case-analyzecinderx-isa-microarch-comparecinderx-evidence-tablecinderx-optimization-reportvalidation-strategyisa-instruction-lookupcompiler-optimization-theory

Read the full file on GitHub · 82 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 82 lines · 56 tokens per session scan A d3c6e00c1482

Subscribe to this mod's changes

using-cpython-optimize is a skill published in the GitHub repository sisibeloved/cpython-optimize-skill (2 stars, last pushed 3d ago), licensed MIT. It adds 56 tokens to every session and 1,385 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. 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