npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@adonis0123/code-simplifier

v1.1.2

Published

Claude Code Skill - 代码质量优化,专注于清晰度、一致性、可维护性。安装时自动从 Anthropic 官方仓库拉取最新版本。

Downloads

290

Readme

@adonis0123/code-simplifier

npm version License: MIT

Claude Code 技能 - 代码质量优化专家,专注于清晰度、一致性、可维护性

基于 Anthropic 官方 code-simplifier 插件,安装时自动从上游仓库拉取最新版本。

安装

全局安装(推荐)

npm install -g @adonis0123/code-simplifier

安装后,技能会自动配置到:

  • ~/.claude/skills/code-simplifier/(Claude Code)
  • ~/.cursor/skills/code-simplifier/(Cursor IDE)

项目本地安装

npm install @adonis0123/code-simplifier

技能会安装到项目的 .claude/skills/.cursor/skills/ 目录。

使用

安装后,在 Claude Code 中直接使用:

/code-simplifier

或通过自然语言触发:

  • "简化这段代码"
  • "优化代码可读性"
  • "重构这个函数"
  • "帮我改进代码质量"

功能特性

5 个核心原则

  1. 保持功能不变 - 仅优化代码质量,不改变业务逻辑
  2. 应用项目标准 - 遵循项目 CLAUDE.md 中的编码规范
  3. 增强清晰度 - 改善命名、减少嵌套、消除冗余
  4. 保持平衡 - 避免过度工程化,兼顾性能和可读性
  5. 聚焦范围 - 仅优化明确指定的代码部分

6 步工作流程

  1. 理解上下文 - 读取项目编码标准和技术栈
  2. 识别优化点 - 扫描嵌套、命名、重复等问题
  3. 评估影响 - 分析收益、风险、成本
  4. 提出方案 - 提供前后对比和改进理由
  5. 实施优化 - 按优先级逐步改进
  6. 验证结果 - 确认功能一致性和标准符合性

自动触发

以下关键词会自动激活此技能:

  • 简化代码、优化代码、重构代码
  • 提升可读性、改善代码质量
  • 代码审查、代码清理

优化示例

优化前

function getUserStatus(user) {
  if (user) {
    if (user.isActive) {
      if (user.isPremium) {
        return 'premium-active';
      } else {
        return 'basic-active';
      }
    } else {
      return 'inactive';
    }
  } else {
    return 'unknown';
  }
}

优化后

function getUserStatus(user) {
  if (!user) return 'unknown';
  if (!user.isActive) return 'inactive';
  return user.isPremium ? 'premium-active' : 'basic-active';
}

改进点

  • 使用 guard clauses 减少嵌套层级
  • 提升代码可读性
  • 保持功能完全一致

参考资料

安装后可在以下位置查看补充资源:

~/.claude/skills/code-simplifier/references/
├── CLAUDE.md-example.md        # 项目编码标准示例
├── coding-standards.md          # 通用编码标准
└── simplification-examples.md   # 实际简化案例集

这些资源包含:

  • 如何配置项目的 CLAUDE.md
  • 常见代码质量问题和解决方案
  • 6 个实际代码简化案例(嵌套、冗余、命名、React 等)

工作原理

  1. 远程优先: 安装时通过 degit 从 Anthropic 官方仓库获取最新 agents/code-simplifier.md
  2. 本地 Fallback: 如果网络失败,使用打包的本地版本
  3. 补充内容: 本地 references/ 提供额外的实用资源

卸载

npm uninstall -g @adonis0123/code-simplifier

卸载时会自动清理配置文件。

更多技能

许可

MIT License - 基于 Anthropic 官方插件

链接