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.
npx skills add rockyflux/yq-workflow --skill yq-code-refactorgit clone --depth 1 https://github.com/rockyflux/yq-workflowWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/rockyflux/yq-workflow/yq-code-refactor)<a href="https://agentmods.dev/skills/rockyflux/yq-workflow/yq-code-refactor"><img src="https://agentmods.dev/badge/skills/rockyflux/yq-workflow/yq-code-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/rockyflux/yq-workflow/yq-code-refactor"><img src="https://agentmods.dev/badge/skills/rockyflux/yq-workflow/yq-code-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.00658 |
| Opus 5 | $0.00015 | $0.00329 |
| Sonnet 5 | $0.00006 | $0.00132 |
| Haiku 4.5 | $0.00003 | $0.00066 |
Grade A, and why
yq-code-refactor 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 7d 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.
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.
What it actually says
YQ Code Refactor
Overview
在行为守恒前提下改善结构、命名、职责和边界,降低理解成本、改动成本和回归风险。
Core principle: 先保护行为,再调整结构。
When to Use
- 用户要重构、拆模块、去重或收敛职责
- 代码难测、难扩展、耦合过高或命名失真
- 评审已经指出明显的可维护性问题
- 功能反复出错,但根因在结构而不是单点 bug
Route Elsewhere
- 主要是新增功能:转
yq-code-gen - 主要是根因排查:转
yq-debug - 主要是质量审查:转
yq-code-review
Process
- 识别重复、长函数、隐式耦合和职责混杂。
- 明确行为保护方式:现有测试、补测或验证清单。
- 选择最小有效改法,避免大爆炸重写。
- 检查结构是否更清晰、更易测、更易改。
- 记录本次已处理项和剩余技术债。
Output
# Refactor Summary
## Problems Addressed
## Refactor Strategy
## Behavior Preservation Notes
## Structural Improvements
## Remaining Debt
## Recommended Next Step
Related Skills
- 上游常来自
yq-code-review、yq-performance-opt - 下游通常接
yq-test-gen、yq-code-review - 验证完成前可参考
superpowers:verification-before-completion
Recommended Next Step
- 默认接
yq-test-gen,先保护重构后的行为边界 - 然后回到
yq-code-review,确认结构改善没有引入新的回归风险 - 如果需要沉淀结构调整理由和影响面,可补
yq-doc-gen
Common Mistakes
- 把功能变更伪装成重构
- 没有行为保护就大范围重写
- 只改格式和命名,没有解决真实结构问题
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.
- 7d ago First seen · 87 lines · 31 tokens per session scan A 49280dc3b786
yq-code-refactor is a skill published in the GitHub repository rockyflux/yq-workflow (2 stars, last pushed yesterday), licensed MIT. It adds 31 tokens to every session and 658 once invoked, about $0.0002 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-09-03.
Other skills, from other repositories
adversarial-reviewer
Adversarial code review that assumes bugs exist and hunts for them. Use when asked to review code, find bugs, audit for correctness, stress-test a PR, or when someone says "tear this apart" or "what's wrong with this". Give no benefit of the doubt — every line is guilty until proven innocent.
gsd-ns-review
Route to the appropriate quality / review skill based on the user's intent. gsd-code-review-fix was absorbed by gsd-code-review --fix in #2790.
issue
Use when starting a chain from a GitHub issue — turning an issue URL or number into a triaged, planned, dispatched, and reviewed pull request. Classifies the thread (bug → root-cause discipline, feature → plan chain, question → drafted reply), synthesizes a spec from the issue's own acceptance criteria, then runs the…
gitnexus
A code-graph analysis add-on for examining an existing codebase, including symbols, call paths, execution flows, and effects across repositories. It can query GitNexus through its command-line or MCP interfaces.
cleanup-code-inspections
Reduce technical debt and improve code quality by systematically resolving static analysis warnings.
sonarqube-mcp
Provides SonarQube and SonarCloud integration patterns via the Model Context Protocol (MCP) server. Enables quality gate monitoring, issue discovery and triaging, pre-push code analysis, and rule education directly in the agent workflow. Use when the user wants to check quality gates, search for Sonar issues, analyze…