Skip to content

贡献指南

欢迎贡献代码


📋 贡献流程

1. Fork 仓库

在 GitHub 上 Fork 仓库:

https://github.com/Agions/taskflow-ai

2. 克隆仓库

bash
git clone https://github.com/your-username/taskflow-ai.git
cd taskflow-ai

3. 创建分支

bash
git checkout -b feature/your-feature

4. 开发

bash
# 安装依赖
npm install

# 启动开发模式
npm run dev

# 运行测试
npm test

5. 提交

bash
git add .
git commit -m "feat: add your feature"

6. 推送

bash
git push origin feature/your-feature

7. 创建 Pull Request

在 GitHub 上创建 Pull Request。


📝 代码规范

TypeScript

typescript
// ✅ 好的风格
interface User {
  id: number;
  name: string;
}

// ❌ 避免的风格
interface User {
  id: any;
  name: any;
}

命名约定

类型约定示例
变量/函数camelCasegetUserById
类/接口PascalCaseUserService
常量UPPER_SNAKE_CASEMAX_RETRY
私有成员_camelCase_internalCache

提交信息

<type>(<scope>): <description>

[optional body]

[optional footer]

类型:

类型说明
feat新功能
fixBug 修复
docs文档更新
style代码格式
refactor代码重构
test测试相关
chore构建/工具

示例:

feat(mcp): add filesystem tool

- Add listDirectory tool
- Add readFile tool
- Add writeFile tool

Closes #123

🧪 测试要求

单元测试

bash
npm test

覆盖率要求

模块最低覆盖率
核心模块90%
MCP 工具85%
CLI80%

运行测试

bash
# 运行所有测试
npm test

# 运行特定测试
npm test -- filesystem

# 查看覆盖率
npm run test:coverage

📖 文档要求

新增功能

  • 添加 API 文档
  • 添加使用示例
  • 更新导航

修改功能

  • 更新相关文档
  • 添加变更说明

🔍 代码审查

审查清单

  • [ ] 代码符合规范
  • [ ] 测试通过
  • [ ] 文档已更新
  • [ ] 无安全漏洞
  • [ ] 性能无回归

审查流程

  1. 自动 CI 检查
  2. 维护者审查
  3. 合并到主分支

💬 交流渠道

渠道说明
💬 GitHub Discussions问题讨论
🐛 GitHub Issues提交 Bug
📧 Email联系维护者

📄 行为准则

  • 尊重他人
  • 建设性反馈
  • 接受批评
  • 帮助新人

🔗 相关链接


贡献代码有问题随时问我

Released under the MIT License.