AI-Assisted Development
Valaxy 通过 Claude Code 支持 AI 辅助开发工作流,使项目贡献变得更加简单。
Valaxy supports AI-assisted development workflows through Claude Code, making it easier to contribute to the project.
环境配置
Setup
仓库在 .claude/commands/ 目录中包含了自定义的 Claude Code 命令,用于简化常见的开发任务。
The repository includes custom Claude Code commands in .claude/commands/ to streamline common development tasks.
可用命令
Available Commands
修复 GitHub Issues
Fix GitHub Issues
自动分析并修复 GitHub issues:
Automatically analyze and fix GitHub issues:
/fix-github-issue 1234此命令将会:
- 使用 GitHub CLI 获取 issue 详情
- 分析问题描述
- 搜索相关代码文件
- 实现必要的修改
- 运行测试验证修复
- 确保代码质量(代码检查、类型检查)
- 创建描述性的提交
- 推送更改并创建 Pull Request
示例:
/fix-github-issue 628这将自动修复 issue #628,包括:
- 读取 issue 描述
- 找到受影响的组件
- 实现修复
- 运行测试
- 创建带有适当描述的 PR
This command will:
- Fetch the issue details using GitHub CLI
- Analyze the problem description
- Search for relevant code files
- Implement the necessary changes
- Run tests to verify the fix
- Ensure code quality (linting, type checking)
- Create a descriptive commit
- Push changes and create a pull request
Example:
/fix-github-issue 628This will automatically fix issue #628 by:
- Reading the issue description
- Finding affected components
- Implementing the fix
- Running tests
- Creating a PR with proper description
CLAUDE.md
仓库根目录包含 CLAUDE.md 文件,提供:
- 基本开发命令
- 架构概览
- 关键模式和约定
- 项目特定说明
该文件帮助 Claude Code 理解代码库结构和开发工作流。
The repository includes a CLAUDE.md file at the root that provides:
- Essential development commands
- Architecture overview
- Key patterns and conventions
- Project-specific notes
This file helps Claude Code understand the codebase structure and development workflow.
最佳实践
Best Practices
使用 AI 辅助开发时:
- 审查更改:提交前务必审查 AI 做出的更改
- 充分测试:确保测试通过并手动验证关键更改
- 理解代码:不要只是接受更改 - 理解更改了什么以及为什么
- 迭代优化:与 AI 迭代协作以优化解决方案
- 遵循约定:AI 会遵循现有代码模式,但要验证一致性
When using AI-assisted development:
- Review Changes: Always review the changes made by AI before committing
- Test Thoroughly: Ensure tests pass and manually verify critical changes
- Understand the Code: Don’t just accept changes - understand what was changed and why
- Iterative Refinement: Work with the AI iteratively to refine solutions
- Follow Conventions: The AI will follow existing code patterns, but verify consistency
创建自定义命令
Creating Custom Commands
你可以为常见任务创建自定义命令:
- 在
.claude/commands/中创建新文件 - 使用描述性命名(例如
add-feature.md) - 编写 Claude Code 要遵循的指令
示例命令结构:
请实现新功能:$ARGUMENTS。
遵循以下步骤:
1. 分析需求
2. 设计解决方案
3. 实现代码
4. 编写测试
5. 更新文档You can create custom commands for common tasks:
- Create a new file in
.claude/commands/ - Name it descriptively (e.g.,
add-feature.md) - Write instructions for Claude Code to follow
Example command structure:
Please implement a new feature: $ARGUMENTS.
Follow these steps:
1. Analyze requirements
2. Design the solution
3. Implement the code
4. Write tests
5. Update documentation提示
Tips
- 使用
/help查看所有可用命令 - AI 可以访问完整的代码库上下文
- 命令可以通过
$ARGUMENTS接受参数 - AI 会遵循
CLAUDE.md和现有代码的模式 - 可以使用 GitHub CLI (
gh) 进行 GitHub 操作
- Use
/helpto see all available commands - The AI has access to the full codebase context
- Commands can accept arguments via
$ARGUMENTS - AI will follow patterns from
CLAUDE.mdand existing code - GitHub CLI (
gh) is available for GitHub operations
局限性
Limitations
- AI 建议应由人工审查
- 复杂的架构决策可能需要人工规划
- 安全敏感的更改需要额外审查
- 部署前务必在本地环境测试
- AI suggestions should be reviewed by humans
- Complex architectural decisions may need manual planning
- Security-sensitive changes require extra scrutiny
- Always test in a local environment before deploying
注意:AI 辅助开发是提高生产力的工具,而非替代人工判断。务必审查和理解所做的更改。
Note: AI-assisted development is a tool to enhance productivity, not replace human judgment. Always review and understand the changes made.