一键导入
non-test-bloat-reduction
Deletion-first non-test runtime code reduction; cluster equivalent logic and merge fragments without changing behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Deletion-first non-test runtime code reduction; cluster equivalent logic and merge fragments without changing behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Create, repair, validate, visually QA, and package Codex-compatible v2 animated pets from character art, generated images, company or prospect brand cues, or visual references. Use for any new Codex pet, custom mascot, non-pixel pet style, brand-inspired pet, existing-pet repair, or 8x11 spritesheet workflow requiring all 9 standard animation rows, 16 look directions, deterministic assembly, QA artifacts, and spriteVersionNumber 2 packaging.
Rewrite current branch into N semantic commits with a legacy backup branch and optional rebase onto origin/main.
Merge origin/main into current branch while preserving branch intent, context, and ownership decisions.
Chain branch onboarding, code-health, and non-test analysis into a branch-scoped remediation plan.
Summarize current branch diff from fork point with intent, scope, risks, and context for follow-on work.
Audit codebase architecture: module dependencies, layering, circular imports, ownership, and structural decay.
| name | non-test-bloat-reduction |
| description | Deletion-first non-test runtime code reduction; cluster equivalent logic and merge fragments without changing behavior. |
Run one deterministic cleanup loop per commit to reduce non-test code bloat with intent-first abstraction and deletion-first edits. Treat syntax/method/API variation as possible surface variance of one domain intent, then compress each intent cluster into one robust abstraction. Never satisfy the quota through comment/docstring-only churn. Treat LOC reduction as valid only when code-health complexity gates (radon trend and xenon pass) remain satisfied.
flowchart LR
A["Set fixed constraints"] --> B["Build intent clusters"]
B --> C["Check abstraction quality gates"]
C --> D["Edit + simplify"]
D --> E["Lint + test"]
E --> F{"non-test <= -200?"}
F -- "No" --> B
F -- "Yes" --> G["Report + stop"]
radon outcomes must stay stable or improve for touched runtime modules.xenon must pass with repository-configured thresholds on every cycle.Use these signatures to identify high-yield reduction candidates:
<= -200 (preferred <= -300)src/ domain/application modules and related non-test runtime modules).tests/, **/test_*.py, **/*_test.py, **/conftest.py.src/scripts/, scripts/, tools/, bin/, **/management/commands/**.export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"
code-health plus probe-deep-search for cross-file discovery and structural extraction, then use rg only for exact follow-up anchors.rpg-loop-reasoning in hybrid mode before proposing edits.references/non_test_reduction_queries.mdreferences/intent_abstraction_rubric.mdintent_idsymbols/call_formsshared ruleestimated removable LOCbehavioral_gateconceptual_gatephysical_gateriskpython "$CODEX_HOME/skills/code-health/scripts/diff_summary_compact.py"
2+ call sites exist and net LOC still decreases.> 0, immediately run a deletion pass before new helper extractionguardrail_not_metmake lint, make test, make code-health).radon, xenon) as blocking validation gates, not advisory signals.uv run ruff check src testsuv run pytest tests -q --maxfail=1uv run radon cc src -s -auv run xenon src<= -200 (preferred <= -300)< 50 projected removable LOC or remaining candidates fail abstraction gates with no credible safety harness; report blockers explicitly.rg queries from references/non_test_reduction_queries.md before any broad sweep.src/ and exclude tests/, scripts/, tools/, bin/ unless the user opts in.rg --files or find only after a concrete module/symbol trace needs expansion.Use deterministic fallbacks when tool CLI contracts differ by version.
| Tool | Preferred | Fallback | Stop Condition |
|---|---|---|---|
xenon | project command from make code-health | quote exclude globs explicitly (example: -e 'tests/*') | argument parsing still fails |
| topology/code-health scripts | $CODEX_HOME path | resolve with absolute $HOME/.codex/... path | path still unresolved |
When fallback is used, record one-line evidence in the cycle report.
codex-exec-sub-agent.~/.codex/skills/codex-exec-sub-agent/scripts/run.sh --timeout-sec 600 --prompt-file /full/path/prompt.txt
intent_idsymbols/call_formsshared_ruleprojected_removable_locbehavioral_gateconceptual_gatephysical_gateriskmet or not met) and current non-test net delta.radon delta (or no-regression confirmation) and xenon pass/fail separately from LOC metrics.before clusters -> after clusters).applied reductions from next identifiable reductions.code-health owns health metrics and diff summary tooling.code-health also owns complexity gate evidence (radon/xenon) for this workflow.rpg-loop-reasoning owns dual-view localization and incremental delta framing when cluster intent crosses module boundaries.references/non_test_reduction_queries.mdreferences/intent_abstraction_rubric.md