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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cc-prompt-enhance

v2.3.1

Published

CLI tool for enhancing prompts before sending to AI - Context-aware prompt optimization for better AI responses

Readme

CC Prompt Enhance

Claude Code提示词增强工具 - 帮助你在Claude Code中使用更精确、更有效的提示词

功能特性

  • 🚀 智能上下文收集: 自动分析项目结构、技术栈和代码风格
  • 🎯 提示词优化: 基于最佳实践优化你的原始提示词
  • 📝 多场景模板: 支持bug修复、功能开发、代码重构等多种场景
  • 🧠 学习能力: 根据项目特征和用户习惯持续学习优化
  • 高性能: 智能缓存和异步处理,快速响应

安装

npm install -g cc-prompt-enhance

使用方法

基本使用

# 直接使用工具,然后输入提示词
cc-prompt-enhance

# 直接传入提示词
cc-prompt-enhance "帮我修复一个登录页面的bug"

高级选项

# 使用自定义配置文件
cc-prompt-enhance -c ./my-config.json "优化这个函数的性能"

# 详细输出模式
cc-prompt-enhance -v "重构这个组件"

# 调试模式
cc-prompt-enhance -d "添加单元测试"

配置

环境变量

export OPENAI_API_KEY="your-openai-api-key"

配置文件

在项目根目录创建 .cc-prompt-enhance/config.json:

{
  "ai": {
    "provider": "openai",
    "model": "gpt-3.5-turbo",
    "temperature": 0.1
  },
  "context": {
    "max_depth": 3,
    "ignore_patterns": ["node_modules", ".git", "dist"]
  },
  "enhancement": {
    "auto_context": true,
    "improvement_suggestions": true
  }
}

工作原理

  1. 上下文收集: 扫描当前项目,识别技术栈、代码风格、Git状态等
  2. 提示词分析: 使用AI分析原始提示词的类型、清晰度和具体性
  3. 模板匹配: 根据分析结果选择最适合的提示词模板
  4. 增强生成: 结合上下文信息和最佳实践,生成增强的提示词
  5. 持续学习: 收集用户反馈,持续优化提示词质量

支持的场景

  • 🐛 Bug修复: 提供详细的bug信息和修复指导
  • 功能开发: 明确需求规格和实现细节
  • 🔧 代码重构: 制定重构计划和验证标准
  • 📋 代码审查: 提供审查要点和最佳实践
  • 📚 文档编写: 结构化文档要求和内容指导

示例

原始提示词

帮我修复一个登录bug

增强后的提示词

# Bug修复请求

## 问题描述
需要修复用户登录功能中的验证问题

## 项目上下文
- 项目类型:React + TypeScript + Express.js
- 代码风格:Prettier + ESLint
- Git状态:main分支,有未提交的更改

## 详细需求

### 问题现象
- 具体表现:用户输入正确密码后仍然显示"密码错误"
- 复现步骤:1. 打开登录页面 2. 输入已注册用户邮箱 3. 输入正确密码 4. 点击登录按钮
- 期望行为:登录成功并跳转到首页
- 实际行为:显示"密码错误"提示

### 技术环境
- 前端:React 18.2.0, TypeScript 4.9
- 后端:Node.js 18.0, Express.js 4.18
- 认证:JWT token
- 数据库:MongoDB

### 修复要求
- 保持现有登录流程不变
- 添加输入验证和错误处理
- 确保密码安全传输
- 添加相关测试用例

### 验证标准
- 测试正确的用户名密码组合
- 测试错误的用户名密码组合
- 检查JWT token是否正确生成
- 验证前端错误提示是否准确

请提供完整的修复代码和测试用例。

贡献

欢迎提交Issue和Pull Request!

许可证

MIT License