Skip to content

Latest commit

 

History

History
139 lines (104 loc) · 2.96 KB

File metadata and controls

139 lines (104 loc) · 2.96 KB

贡献指南

感谢您对 FluxAgent 的关注!我们欢迎各种形式的贡献。

如何贡献

报告 Bug

如果您发现了 bug,请:

  1. 检查 Issues 中是否已有相关报告
  2. 如果没有,请创建新的 issue,包含:
    • 详细的问题描述
    • 复现步骤
    • 期望的行为
    • 实际的行为
    • 环境信息(Node.js 版本、操作系统等)

功能请求

如果您有新功能的想法:

  1. 先在 Issues 中搜索是否有类似的请求
  2. 创建新的 feature request,描述:
    • 功能的用途和价值
    • 预期的API设计
    • 可能的实现方案

代码贡献

  1. Fork 项目
  2. 创建功能分支git checkout -b feature/amazing-feature
  3. 本地开发
    pnpm install
    pnpm build
    pnpm test
  4. 遵循代码规范
    pnpm lint
    pnpm format
  5. 提交更改git commit -m 'Add some amazing feature'
  6. 推送分支git push origin feature/amazing-feature
  7. 创建 Pull Request

开发规范

代码风格

  • 使用 TypeScript
  • 遵循 ESLint 和 Prettier 配置
  • 写有意义的变量和函数名
  • 添加必要的注释和文档

测试要求

  • 新功能需要包含单元测试
  • 确保所有测试通过:pnpm test
  • 保持测试覆盖率在 80% 以上

提交信息规范

使用 Conventional Commits 格式:

type(scope): description

- feat: 新功能
- fix: 修复bug
- docs: 文档更新
- style: 代码格式化
- refactor: 重构
- test: 测试相关
- chore: 构建工具或辅助工具的变动

例子:

feat(agent): add knowledge base search functionality
fix(eventHub): resolve memory leak in event listeners
docs(readme): update installation instructions

项目结构

src/
├── core/           # 核心模块
├── tools/          # 工具实现
├── plugins/        # 插件实现
├── examples/       # 示例代码
└── tests/          # 测试文件

开发环境设置

  1. 克隆项目

    git clone https://github.com/yourusername/fluxagent.git
    cd fluxagent
  2. 安装依赖

    pnpm install
  3. 设置环境变量

    cp .env.example .env
    # 编辑 .env 文件,添加必要的API密钥
  4. 运行示例

    pnpm dev

发布流程

只有维护者可以发布新版本:

  1. 更新版本号:pnpm version patch|minor|major
  2. 更新 CHANGELOG.md
  3. 创建 release tag
  4. 发布到 npm:pnpm publish

问题和讨论

行为准则

请遵循我们的 行为准则,营造友好包容的社区环境。

感谢您的贡献! 🎉