code-quality

code-quality is a skill for Claude Code, Codex from apexcheng/yingdao-xbot-ai-agent. It costs 41 tokens per session (2,710 once invoked), scanned A, original, MIT.

A set of code-quality instructions for checking consistency, simplifying recent changes, and reviewing code for bugs or regressions. A regression is a new problem caused by a change that previously worked.

In plain words
What is it for?
Reviewing changes, spotting bugs, simplifying recent code without changing its behavior, and matching nearby implementations.
Why use it?
It keeps reviews focused on the requested files and prevents unrelated cleanup or behavior changes. It also tells the agent to follow patterns already used in the project.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

Good fit Reviewing changes, spotting bugs, simplifying recent code without changing its behavior, and matching nearby implementations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/apexcheng/yingdao-xbot-ai-agent/code-quality
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.

Any agent
npx skills add apexcheng/yingdao-xbot-ai-agent --skill code-quality
Clone the repo
git clone --depth 1 https://github.com/apexcheng/yingdao-xbot-ai-agent

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for code-quality

README.md
[![agentmods](https://agentmods.dev/badge/skills/apexcheng/yingdao-xbot-ai-agent/code-quality/github.svg)](https://agentmods.dev/skills/apexcheng/yingdao-xbot-ai-agent/code-quality)
Your own site
<a href="https://agentmods.dev/skills/apexcheng/yingdao-xbot-ai-agent/code-quality"><img src="https://agentmods.dev/badge/skills/apexcheng/yingdao-xbot-ai-agent/code-quality/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.

agentmods 80×15 button for code-quality

Your own site · 80×15
<a href="https://agentmods.dev/skills/apexcheng/yingdao-xbot-ai-agent/code-quality"><img src="https://agentmods.dev/badge/skills/apexcheng/yingdao-xbot-ai-agent/code-quality.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,710 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00041 $0.02710
Opus 5.5 $0.00016 $0.01084
Sonnet 5.5 $0.00008 $0.00542
Haiku 4.5 $0.00004 $0.00271

Measured 3d ago against content hash aca0a4f3a731, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

code-quality 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 3d 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.

project-template/.agents/skills/code-quality/SKILL.md · 171 lines

How it starts

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

代码质量:一致性、简化与审查

先读取项目 AGENTS.md,只进入当前任务涉及的部分:比较已有实现时用「代码一致性」,用户要求精简时用「代码简化」,要求审查时用「代码审查」。需要过程式主流程、变量内联、函数边界或异常收尾等标准时,按需读取 编码标准;普通明确小改无需全量加载。

代码一致性

修改已有项目时,先查看当前文件、相邻代码和最接近的同类业务实现,沿用其已经验证的 API、控制流、异常处理及日志模式;不要为同一个问题另造等价写法。

  • 当前文件 / 模块有成熟先例时直接参考,新增或改变 xbot API 调用契约时仍以知识库正式事实页核对。
  • 同类实现不一致时,优先选择与本次业务最接近、当前仍在使用且可确认正确的写法,不顺便统一整个项目。
  • 没有适用先例时按项目 AGENTS.md 和对应知识页处理,不照搬错误、过时或业务条件不同的示例。
  • 修改后仅检查本次代码与附近实现是否无理由产生新的差异;用户明确要求重构、替换旧模式或统一风格时不机械沿用旧代码。

代码简化

只优化本次最近修改的代码,使实现更直接、清晰、符合当前项目习惯;不改变业务行为,不顺手重构无关代码。

先确定范围

优先以当前 git diff、本次会话实际修改文件和用户指定范围为准。

除非用户明确要求扩大范围,否则不要因为发现旧代码也能优化,就继续整理整个文件、模块或项目。

简化前先读取当前项目 AGENTS.md。涉及项目已有实现方式时,同时按 本 Skill 的「代码一致性」部分 检查附近和同类代码,不用通用“最佳实践”覆盖项目已经形成的合理约定。

简化目标

重点检查本次改动是否出现:

  • 没有额外语义、只服务下一行调用的一次性临时变量。
  • 为当前单次业务步骤新增的薄函数、包装层或中转参数。
  • 同一 Page 的连续操作被拆成无真实复用、无独立职责或稳定后置条件的薄函数;按 编码标准 判断,必要时还原清晰的主流程。
  • 可以直接表达却被拆成初始化再覆盖、重复判断或多余状态的逻辑。
  • 不必要的嵌套、重复分支、重复转换或重复读取。
  • 已有成功时间和跳过机制仍新增跨轮文件缓存、额外状态源,或没有明确业务需求却新增关闭 / 重开工作簿、补跑和回滚分支。
  • 只为形式分层新增的 Service、Manager、Context、Helper 等业务抽象。
  • 与当前模块已有代码相比明显更绕、更啰嗦或采用了第二套等价写法的实现。
  • 逐行复述代码、没有解释业务意图的注释。

简化时优先让真实业务顺序直接可见,并遵守项目已有的函数边界、日志、异常处理和 xbot API 使用方式。

表格更新 RPA 的独立 Sheet 失败继续、最后统一保存等固定规则,直接按 表格操作 Skill 执行,不额外添加重开和回滚流程。

保持行为不变

简化不是重新设计。不得无理由改变:

  • 业务条件、执行顺序、循环边界和停止条件。
  • 将多个函数合并回主流程时,检查原函数的局部变量是否覆盖外层循环变量或业务状态;同时保持原有执行顺序、异常处理、返回值和页面状态不变。
  • 返回值、数据结构、异常传播和失败语义。
  • 日志中承担排查价值的业务上下文。
  • 用户已确认的字段名、XPath、CSS、URL、按钮文案、Sheet 名、状态值和配置值。
  • xbot / 市场指令的 API、参数、调用时机和页面交互顺序。
  • 已有必要封装提供的后置条件,例如“返回一个已经登录且可直接使用的 page”。

如果无法确认某个改写是否保持行为一致,就不要为了更短或更“优雅”而修改。

不要过度简化

目标不是减少行数。

以下情况应保留显式结构:

  • 分支包含多个业务动作、副作用或异常处理。
  • 中间变量会复用、参与后续判断,或名称能明显解释业务含义。
  • 函数 / 类确实隐藏一组实现细节,并向调用方提供稳定完整的结果或后置条件。
  • 展开写法更方便排查、调试或理解真实业务顺序。

不要生成密集 one-liner、复杂条件表达式、难读的链式调用或仅为了“更少代码”合并多个业务步骤。

完成后验证

修改后重新检查 diff,确认:

  1. 只修改了本次简化范围。
  2. 没有引入与当前项目不同的新实现模式。
  3. 业务行为、失败语义和关键常量没有变化。

按项目 AGENTS.md 的验证规则做与本次简化直接相关的最小必要验证。没有实际运行或可验证证据时,只能说明静态检查结果,不能声称业务运行行为已经验证一致。

Read the full file on GitHub · 171 lines

Files

What ships with it

1 file 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. 3d ago Changed · +2 lines aca0a4f3a731
  2. 8d ago Changed · +6 lines 84bd70f48dae
  3. 9d ago First seen · 163 lines · 41 tokens per session scan A cfbae3ef8832

Subscribe to this mod's changes

code-quality is a skill published in the GitHub repository apexcheng/yingdao-xbot-ai-agent (37 stars, last pushed today), licensed MIT. It adds 41 tokens to every session and 2,710 once invoked, about $0.0002 per session on Opus 5.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-10-09.

Related

Other skills, from other repositories

ego-lite-simplify

Find and implement evidence-backed simplifications in the ego-lite repository. Use when reviewing the codebase for dead code, duplicated state or APIs, speculative abstractions, unnecessary compatibility layers, hand-written infrastructure, excessive tests or documentation, or when the user asks to reduce code size or…

citrolabs/ego-lite · 68 tokens

dogfood

Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to "dogfood", "QA", "exploratory test", "find issues", "bug hunt", "test this app/site/platform", or review the quality of a web application. Produces a structured report with full reproduction evidence -…

coelhobugado/antigravity-browser-bridge · 100 tokens

moli-webfetch

Fetch, inspect, crawl, and capture live, JavaScript-rendered websites with Moli. Use when Codex needs current web content, web research, fact lookup, link following, a bounded crawl, client-rendered or response-gated content, network diagnostics, or a standalone HTML, Markdown, JSON, semantic-tree, viewport or…

lexmount/moli · 90 tokens

adversarial-reviewer

Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…

emdash-cms/emdash · 72 tokens

gsd-ns-review

quality gates | code review debug audit security eval ui.

open-gsd/gsd-core · 16 tokens

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.

hashgraph-online/awesome-codex-plugins · 58 tokens