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

@kne/prompts-frontend-libs

v1.0.1

Published

前端组件库开发辅助提示词集合,包含国际化、TypeScript 类型声明、文档生成、示例编写等常用任务的 AI 提示词模板

Readme

Prompts Frontend Libs 文档索引

本项目包含多个前端开发辅助提示词文档,用于指导 AI 完成常见的前端组件库开发任务。

文档列表

1. 组件国际化

功能: 指导将 React 组件完成国际化,支持多语言切换

适用场景:

  • 组件需要支持多语言显示
  • 项目需要面向国际用户
  • 现有组件需要添加国际化支持

核心内容:

  • useIntl Hook 使用方法
  • withLocale HOC 包裹模式
  • 语言包配置规范
  • 不同组件类型的国际化处理方式

使用方式: 阅读 国际化 了解详情


2. 添加 TypeScript 类型声明

功能: 为现有的 React 组件库添加完整的 TypeScript 类型定义

适用场景:

  • JavaScript 组件库需要添加 TypeScript 支持
  • 提升代码可维护性和 IDE 智能提示
  • 便于团队协作和代码审查

核心内容:

  • Props 接口定义规范
  • 类型声明文件结构
  • 复杂场景处理(嵌套对象、函数属性、联合类型)
  • 组件导出声明模板

使用方式: 阅读 添加ts类型声明 了解详情


3. 完善 package.json 描述和关键词

功能: 为项目完善 package.json 的 description 和 keywords 字段

适用场景:

  • 新建项目需要完善 package.json 信息
  • 项目功能更新后需要调整描述
  • 提升 npm 包的搜索可发现性

核心内容:

  • 描述撰写原则和模板
  • 关键词分类和提取来源
  • 信息收集和分析流程
  • 输出格式和检查清单

使用方式: 阅读 完善package.json描述和关键词 了解详情


4. 生成包功能描述文件

功能: 为 JavaScript/TypeScript 包生成 package-manifest.json 描述文件

适用场景:

  • 自动化 API 文档生成
  • IDE 智能提示和自动补全
  • 包管理和分发平台的组件展示
  • 第三方工具的集成和分析

核心内容:

  • 项目结构分析流程
  • 导出模块识别方法
  • JSON 结构构建规范
  • 类型定义标准和描述编写原则

使用方式: 阅读 生成包功能描述文件 了解详情


5. 生成文档

功能: 为项目生成标准化的 API 文档和概述文档

适用场景:

  • 需要生成项目概述文档 (summary.md)
  • 需要生成 API 文档 (api.md)
  • 规范化项目文档结构

核心内容:

  • 文档结构规范
  • 标题级别使用规范
  • 表格格式要求
  • 内容基于实际代码分析的原则

使用方式: 阅读 生成文档 了解详情


6. 组件示例编写

功能: 编写遵循特定目录结构规范的 React 组件示例

适用场景:

  • 为组件创建可运行的示例代码
  • 编写组件演示和文档
  • 构建组件库的示例展示系统

核心内容:

  • 项目目录布局规范
  • example.json 配置结构
  • 示例代码编写模板
  • scope 依赖声明规则
  • 数据模拟方法

使用方式: 阅读 组件示例编写 了解详情


如何选择

| 需求 | 使用文档 | |------|----------| | 组件需要支持多语言 | 组件国际化 | | 为 JS 组件库添加 TS 类型支持 | 添加 TypeScript 类型声明 | | 完善 package.json 描述和关键词 | 完善 package.json 描述和关键词 | | 生成包的 API 描述文件 | 生成包功能描述文件 | | 生成项目概述和 API 文档 | 生成文档 | | 编写组件演示示例代码 | 组件示例编写 |