pd-simplify

pd-simplify is a skill for Claude Code, Codex from bushuhui/skills. It costs 57 tokens per session (638 once invoked), scanned A, original, MIT.

A code-cleanup tool for recently changed code that improves clarity and maintainability without changing what the code does.

In plain words
What is it for?
Use it after writing or editing code, on a specific file, or when reviewing code for readability and quality.
Why use it?
It removes unnecessary complexity, repetition, and inconsistent style while preserving the code’s exact behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md.

Good fit Use it after writing or editing code, on a specific file, or when reviewing code for readability and quality.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bushuhui/skills/pd-simplify
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 bushuhui/skills --skill pd-simplify
Clone the repo
git clone --depth 1 https://github.com/bushuhui/skills

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 pd-simplify

README.md
[![agentmods](https://agentmods.dev/badge/skills/bushuhui/skills/pd-simplify.svg)](https://agentmods.dev/skills/bushuhui/skills/pd-simplify)
Your own site
<a href="https://agentmods.dev/skills/bushuhui/skills/pd-simplify"><img src="https://agentmods.dev/badge/skills/bushuhui/skills/pd-simplify.svg" alt="Measured on agentmods" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 638 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.00057 $0.00638
Opus 5 $0.00028 $0.00319
Sonnet 5 $0.00011 $0.00128
Haiku 4.5 $0.00006 $0.00064

Measured 7d ago against content hash 18df98a2586b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

pd-simplify 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.

pd-simplify/SKILL.md · 63 lines

What it actually says

pd-simplify — 代码精炼

对最近修改的代码进行精炼,提升可读性、一致性和可维护性,不改变任何功能行为

使用方式

/pd-simplify              # 精炼最近修改的代码
/pd-simplify --file path  # 精炼指定文件

如果未指定范围,通过 git diff 确定最近修改的代码范围。

精炼原则

1. 功能不变

这是硬性约束。 所有原始功能、输出和行为必须保持完整。只改"怎么做",不改"做什么"。

2. 遵循项目规范

遵循项目 CLAUDE.md 中的编码规范,包括:import 排序、函数声明方式(function vs 箭头函数)、显式返回类型、React 组件模式、错误处理模式、命名约定等。若无规范文件,遵循代码既有风格。

3. 提升清晰度

  • 减少不必要的复杂度和嵌套
  • 消除冗余代码和重复逻辑
  • 改进变量和函数命名
  • 合并相关逻辑
  • 删除描述显而易见代码的冗余注释
  • 避免嵌套三元运算符 — 优先 switch 或 if/else
  • 清晰优先于简短 — 显式代码优于过度紧凑的写法

4. 避免过度简化

  • 不为"行数更少"牺牲可读性
  • 不做过度聪明的"一行式"改写
  • 不合并过多关注点到单一函数
  • 不删除有助于代码组织的有用抽象
  • 不破坏调试和扩展能力

精炼流程

  1. 识别最近修改的代码范围(通过 git diff 或用户指定)
  2. 分析优雅性和一致性改进机会
  3. 应用项目最佳实践和编码标准
  4. 确保所有功能保持不变
  5. 确认精炼后的代码更简洁、更易维护
  6. 仅对影响理解的重要变更做简要说明

作用域

默认只作用于当前 session 中修改过的代码,除非用户明确指定更大范围。

输出要求

直接输出精炼后的代码变更,附带简要说明。仅记录显著影响理解的重要变更,不对每个小改动逐一解释。

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. 7d ago First seen · 63 lines · 57 tokens per session scan A 18df98a2586b

Subscribe to this mod's changes

pd-simplify is a skill published in the GitHub repository bushuhui/skills (2 stars, last pushed 3mo ago), licensed MIT. It adds 57 tokens to every session and 638 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

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 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

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 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