关于 readme-generator
为项目编写 README 文档的技能,面向需要清晰介绍项目、安装方法和使用方式的开发者。它还提供贡献指南与变更日志的模板及文档检查清单。
主要功能
- 01分析项目类型与功能
- 02整理标题、徽章和简介
- 03编写安装配置与使用示例
- 04提供贡献指南模板
- 05提供变更日志模板
- 06检查文档必备内容
适用场景
- 01为新项目创建 README
- 02补充安装和 API 使用说明
- 03为项目准备贡献指南与变更日志
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ patricio0312rev/ skills --skill readme-generator安装后在 Claude Code 中输入/readme-generator确认已加载。
详细介绍
README 生成器
为项目创建全面、专业的 README 文档。
核心工作流
- 分析项目:识别项目类型和功能
- 添加标题:标题、徽章、描述
- 编写设置说明:安装和配置
- 展示用法:示例和 API
- 添加指南:贡献指南、许可证
- 添加其他内容:截图、路线图
README 模板
# Project Name
[](https://www.npmjs.com/package/package-name)
[](https://github.com/username/repo/actions)
[](https://codecov.io/gh/username/repo)
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
Brief description of what this project does and who it's for. One to two sentences that capture the essence of the project.
## Features
- ✨ Feature one with brief description
- 🚀 Feature two with brief description
- 🔒 Feature three with brief description
- 📦 Feature four with brief description
## Demo

[Live Demo](https://demo.example.com) | [Documentation](https://docs.example.com)
## Quick Start
\`\`\`bash
npx create-project-name my-app
cd my-app
npm run dev
\`\`\`
## Installation
### Prerequisites
- Node.js 18.0 or higher
- npm 9.0 or higher (or pnpm/yarn)
### Package Manager
\`\`\`bash
# npm
npm install package-name
# pnpm
pnpm add package-name
# yarn
yarn add package-name
\`\`\`
### From Source
\`\`\`bash
git clone https://github.com/username/repo.git
cd repo
npm install
npm run build
\`\`\`
## Usage
### Basic Usage
\`\`\`typescript
import { something } from 'package-name';
const result = something({
option1: 'value',
option2: true,
});
console.log(result);
\`\`\`
### Advanced Usage
\`\`\`typescript
import { createClient, type Config } from 'package-name';
const config: Config = {
apiKey: process.env.API_KEY,
timeout: 5000,
retries: 3,
};
const client = createClient(config);
// Async operation
const data = await client.fetch('/endpoint');
\`\`\`
### With React
\`\`\`tsx
import { Provider, useData } from 'package-name/react';
function App() {
return (
<Provider apiKey={process.env.API_KEY}>
<MyComponent />
</Provider>
);
}
function MyComponent() {
const { data, loading, error } = useData('key');
if (loading) return <Spinner />;
if (error) return <Error message={error.message} />;
return <div>{data.value}</div>;
}
\`\`\`
## API Reference
### `createClient(config)`
Creates a new client instance.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `apiKey` | `string` | required | Your API key |
| `baseUrl` | `string` | `'https://api.example.com'` | API base URL |
| `timeout` | `number` | `30000` | Request timeout in ms |
| `retries` | `number` | `3` | Number of retry attempts |
**Returns:** `Client`
### `client.fetch(endpoint, options?)`
Fetches data from the specified endpoint.
\`\`\`typescript
const data = await client.fetch('/users', {
method: 'GET',
headers: { 'X-Custom': 'value' },
});
\`\`\`
### `client.create(endpoint, data)`
Creates a new resource.
\`\`\`typescript
const user = await client.create('/users', {
name: 'John Doe',
email: '[email protected]',
});
\`\`\`
## Configuration
### Environment Variables
| Variable | Description | Required |
|----------|-------------|----------|
| `API_KEY` | Your API key | Yes |
| `API_URL` | Custom API URL | No |
| `DEBUG` | Enable debug mode | No |
### Configuration File
Create a `config.json` in your project root:
\`\`\`json
{
"apiKey": "your-api-key",
"environment": "production",
"features": {
"caching": true,
"logging": false
}
}
\`\`\`
## Examples
### Example 1: Basic CRUD
\`\`\`typescript
// Create
const user = await client.create('/users', { name: 'John' });
// Read
const users = await client.fetch('/users');
// Update
await client.update(\`/users/\${user.id}\`, { name: 'Jane' });
// Delete
await client.delete(\`/users/\${user.id}\`);
\`\`\`
### Example 2: Error Handling
\`\`\`typescript
try {
const data = await client.fetch('/protected');
} catch (error) {
if (error instanceof AuthError) {
console.error('Authentication failed');
} else if (error instanceof NetworkError) {
console.error('Network error:', error.message);
} else {
throw error;
}
}
\`\`\`
More examples in the [examples directory](./examples).
## Architecture
\`\`\`
src/
├── client/ # Client implementation
├── hooks/ # React hooks
├── utils/ # Utility functions
├── types/ # TypeScript types
└── index.ts # Main export
\`\`\`
## Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
### Development Setup
\`\`\`bash
# Clone the repository
git clone https://github.com/username/repo.git
# Install dependencies
npm install
# Run tests
npm test
# Start development
npm run dev
\`\`\`
### Commit Convention
We use [Conventional Commits](https://www.conventionalcommits.org/):
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation
- `test:` Tests
- `chore:` Maintenance
## Roadmap
- [x] Initial release
- [x] TypeScript support
- [ ] React Native support
- [ ] Offline mode
- [ ] Plugin system
See the [open issues](https://github.com/username/repo/issues) for a full list of proposed features.
## FAQ
<details>
<summary><strong>How do I get an API key?</strong></summary>
Visit [our dashboard](https://dashboard.example.com) to create an account and generate an API key.
</details>
<details>
<summary><strong>Is there a rate limit?</strong></summary>
Yes, the free tier allows 1000 requests per hour. See our [pricing page](https://example.com/pricing) for higher limits.
</details>
<details>
<summary><strong>Does it work with Next.js?</strong></summary>
Yes! We have full support for Next.js including App Router and Server Components.
</details>
## Troubleshooting
### Common Issues
**Error: API key is invalid**
Make sure your API key is correctly set in the environment variables and hasn't expired.
**Error: Network timeout**
Increase the timeout value in your configuration or check your network connection.
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a history of changes.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [Library 1](https://example.com) - For the amazing feature
- [Library 2](https://example.com) - For inspiration
- All our [contributors](https://github.com/username/repo/graphs/contributors)
## Support
- 📧 Email: [email protected]
- 💬 Discord: [Join our community](https://discord.gg/example)
- 🐦 Twitter: [@username](https://twitter.com/username)
- 📖 Documentation: [docs.example.com](https://docs.example.com)
---
Made with ❤️ by [Your Name](https://github.com/username)
徽章示例
[](https://github.com/user/repo/actions/workflows/ci.yml)
[](https://www.npmjs.com/package/package)
[](https://www.npmjs.com/package/package)
[](https://codecov.io/gh/user/repo)
[](https://opensource.org/licenses/MIT)
[](https://opensource.org/licenses/Apache-2.0)
[](https://www.typescriptlang.org/)
[](https://developer.mozilla.org/en-US/docs/Web/JavaScript)
[](https://reactjs.org/)
[](https://nextjs.org/)
[](https://nodejs.org/)
[](https://pnpm.io/)
[](http://makeapullrequest.com)
[](https://github.com/user/repo/graphs/commit-activity)
[](https://example.com)
CONTRIBUTING.md 模板
# Contributing to Project Name
Thank you for your interest in contributing! This document provides guidelines and steps for contributing.
## Code of Conduct
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
## How Can I Contribute?
### Reporting Bugs
- Check existing issues first
- Use the bug report template
- Include reproduction steps
- Provide environment details
### Suggesting Features
- Check existing feature requests
- Use the feature request template
- Explain the use case
- Consider implementation approach
### Pull Requests
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/my-feature`
3. Make your changes
4. Write/update tests
5. Run the test suite: `npm test`
6. Commit with conventional commits: `git commit -m 'feat: add new feature'`
7. Push to your fork: `git push origin feature/my-feature`
8. Open a Pull Request
## Development Setup
\`\`\`bash
# Clone your fork
git clone https://github.com/your-username/repo.git
# Add upstream remote
git remote add upstream https://github.com/original-owner/repo.git
# Install dependencies
npm install
# Create a branch
git checkout -b feature/my-feature
\`\`\`
## Coding Standards
- Follow existing code style
- Use TypeScript strict mode
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
## Testing
\`\`\`bash
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run specific test file
npm test -- path/to/test.ts
\`\`\`
## Questions?
Feel free to open an issue or reach out on Discord.
CHANGELOG.md 模板
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- New feature description
### Changed
- Change description
### Fixed
- Bug fix description
## [1.2.0] - 2024-01-15
### Added
- Add new authentication method
- Add TypeScript support for config files
### Changed
- Improve error messages
- Update dependencies
### Fixed
- Fix memory leak in connection pool
- Fix race condition in cache invalidation
## [1.1.0] - 2024-01-01
### Added
- Add retry mechanism for failed requests
- Add timeout configuration option
### Deprecated
- Deprecate `oldMethod()` in favor of `newMethod()`
## [1.0.0] - 2023-12-15
### Added
- Initial release
- Core API functionality
- React hooks
- TypeScript types
[Unreleased]: https://github.com/user/repo/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/user/repo/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/user/repo/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/user/repo/releases/tag/v1.0.0
最佳实践
- 从价值开始:开篇介绍项目的用途
- 优先提供快速入门:帮助用户快速开始使用
- 展示而非空谈:加入代码示例
- 保持更新:与代码变更保持同步
- 使用徽章:展示项目的健康状况
- 添加视觉内容:截图和图表
- 关联相关内容:链接到其他文档
- 保持一致:遵循既定模式
输出检查清单
每份 README 都应包含:
- 项目标题和描述
- 徽章(构建、版本、许可证)
- 功能列表
- 快速入门 / 安装
- 用法示例
- API 文档
- 配置选项
- 贡献指南
- 许可证信息
- 支持 / 联系方式
评论
支持 Markdown