pd-simplify
Skill2 starsChanged 5 months agoMITView on GitHub
Simplifies and refines recently modified code for clarity, consistency, and maintainability while preserving exact functionality. Use when code has just been written or modified, when user asks to clean up, refine, or simplify code, or when reviewing for code quality issues.
In this repository71 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- academic-searchSkill
- agent-reachSkill
- anysearchSkill
- brainstormingSkill
- brave-searchSkill
- clash-verge-controlSkill
- drawio-skillSkill
- find-skillsSkill
- fireworks-tech-graphSkill
- github-trending-discoverySkill
- html-pptSkill
- humanizer-zhSkill
- ai-news-collectorSkill
- info-andrej-karpathy-rssSkill
- info-daily-hot-topicsSkill
- karpathy-guidelinesSkill
- markdown-to-docxSkill
- mcp-builderSkill
- minimax-docxSkill
- minimax-pdfSkill
- minimax-xlsxSkill
- office-docxSkill
- office-pdfSkill
- office-pptxSkill
- office-pywordSkill
- office-xlsxSkill
- ontologySkill
- openclaw-optimizationSkill
- pd-architectureSkill
- pd-bddSkill
- pd-brainstormingSkill
- pd-diagnoseSkill
- pd-docSkill
- pd-executionSkill
- pd-grill-with-docsSkill
- pd-improve-codebase-architectureSkill
- pd-planSkill
- pd-postgresSkill
- pd-prototypeSkill
- pd-puaSkill
- pd-reviewSkill
- pd-rules-checkSkill
- pd-setupSkill
- pd-tddSkill
- pd-to-issuesSkill
- pd-to-prdSkill
- pd-triageSkill
- pd-zoom-outSkill
- pi-drawioSkill
- pi-githubSkill
- pi-llm-serverSkill
- pi-memorySkill
- pi-painterSkill
- pi-sketch-readerSkill
- pr-academic-searchSkill
- pr-arxiv-watcherSkill
- pr-critic-mentor-reviewSkill
- pr-daily-research-papersSkill
- pr-deep-researchSkill
- The first 60 shown.
The file
Files
pd-simplify — 代码精炼
对最近修改的代码进行精炼,提升可读性、一致性和可维护性,不改变任何功能行为。
使用方式
/pd-simplify # 精炼最近修改的代码
/pd-simplify --file path # 精炼指定文件如果未指定范围,通过 git diff 确定最近修改的代码范围。
精炼原则
1. 功能不变
这是硬性约束。 所有原始功能、输出和行为必须保持完整。只改"怎么做",不改"做什么"。
2. 遵循项目规范
遵循项目 CLAUDE.md 中的编码规范,包括:import 排序、函数声明方式(function vs 箭头函数)、显式返回类型、React 组件模式、错误处理模式、命名约定等。若无规范文件,遵循代码既有风格。
3. 提升清晰度
- 减少不必要的复杂度和嵌套
- 消除冗余代码和重复逻辑
- 改进变量和函数命名
- 合并相关逻辑
- 删除描述显而易见代码的冗余注释
- 避免嵌套三元运算符 — 优先 switch 或 if/else
- 清晰优先于简短 — 显式代码优于过度紧凑的写法
4. 避免过度简化
- 不为"行数更少"牺牲可读性
- 不做过度聪明的"一行式"改写
- 不合并过多关注点到单一函数
- 不删除有助于代码组织的有用抽象
- 不破坏调试和扩展能力
精炼流程
- 识别最近修改的代码范围(通过 git diff 或用户指定)
- 分析优雅性和一致性改进机会
- 应用项目最佳实践和编码标准
- 确保所有功能保持不变
- 确认精炼后的代码更简洁、更易维护
- 仅对影响理解的重要变更做简要说明
作用域
默认只作用于当前 session 中修改过的代码,除非用户明确指定更大范围。
输出要求
直接输出精炼后的代码变更,附带简要说明。仅记录显著影响理解的重要变更,不对每个小改动逐一解释。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

