workflow

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Development Workflow Orchestrator

开发工作流编排器

Guides the complete development cycle: Ticket → Planning → Coding → Review → PR.
指导完整的开发周期:工单 → 规划 → 编码 → 评审 → PR。

Workflow Overview

工作流概述

┌─────────────────────────────────────────────────────────────┐
│                    DEVELOPMENT WORKFLOW                      │
├─────────────────────────────────────────────────────────────┤
│  1. INITIATE                                                │
│     └── Select ticket → Clone repo → Create worktree        │
├─────────────────────────────────────────────────────────────┤
│  2. PLAN                                                    │
│     └── Understand requirements → Create implementation plan │
├─────────────────────────────────────────────────────────────┤
│  3. CODE                                                    │
│     └── Implement → Test → Iterate                          │
├─────────────────────────────────────────────────────────────┤
│  4. REVIEW                                                  │
│     └── Self-review → Fix issues → Validate                 │
├─────────────────────────────────────────────────────────────┤
│  5. SHIP                                                    │
│     └── Create PR → Update ticket → Clean up worktree       │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│                    DEVELOPMENT WORKFLOW                      │
├─────────────────────────────────────────────────────────────┤
│  1. INITIATE                                                │
│     └── Select ticket → Clone repo → Create worktree        │
├─────────────────────────────────────────────────────────────┤
│  2. PLAN                                                    │
│     └── Understand requirements → Create implementation plan │
├─────────────────────────────────────────────────────────────┤
│  3. CODE                                                    │
│     └── Implement → Test → Iterate                          │
├─────────────────────────────────────────────────────────────┤
│  4. REVIEW                                                  │
│     └── Self-review → Fix issues → Validate                 │
├─────────────────────────────────────────────────────────────┤
│  5. SHIP                                                    │
│     └── Create PR → Update ticket → Clean up worktree       │
└─────────────────────────────────────────────────────────────┘

Phase 1: Initiate

第一阶段:启动

Start work on a JIRA ticket:
bash
undefined
开始处理JIRA工单:
bash
undefined

1. List your tickets

1. 列出你的工单

npx tsx skills/jira/scripts/list_tickets.ts
npx tsx skills/jira/scripts/list_tickets.ts

2. Get ticket details

2. 获取工单详情

npx tsx skills/jira/scripts/get_ticket.ts PROJ-123
npx tsx skills/jira/scripts/get_ticket.ts PROJ-123

3. Clone repo if needed

3. 如有需要,克隆仓库

./skills/git-worktree/scripts/clone_repo.sh https://github.com/org/repo.git
./skills/git-worktree/scripts/clone_repo.sh https://github.com/org/repo.git

4. Create worktree for the ticket

4. 为工单创建工作树

./skills/git-worktree/scripts/create_worktree.sh repo PROJ-123-feature-name
./skills/git-worktree/scripts/create_worktree.sh repo PROJ-123-feature-name

5. Update ticket status

5. 更新工单状态

npx tsx skills/jira/scripts/update_ticket.ts PROJ-123 "In Progress"
npx tsx skills/jira/scripts/update_ticket.ts PROJ-123 "In Progress"

6. Navigate to worktree

6. 导航到工作树目录

cd ~/dev/<workspace>/repo-worktrees/PROJ-123-feature-name
undefined
cd ~/dev/<workspace>/repo-worktrees/PROJ-123-feature-name
undefined

Phase 2: Plan

第二阶段:规划

Create an implementation plan before coding:
  1. Read the ticket thoroughly - Understand requirements, acceptance criteria
  2. Research the codebase - Find related code, understand patterns
  3. Create plan document - Write to
    PLAN.md
    in the worktree:
markdown
undefined
编码前先制定实现方案:
  1. 仔细阅读工单 - 理解需求和验收标准
  2. 研究代码库 - 找到相关代码,理解代码模式
  3. 创建方案文档 - 在工作树目录中写入
    PLAN.md
markdown
undefined

PROJ-123: Feature Name

PROJ-123: 功能名称

Requirements

需求

  • Requirement 1
  • Requirement 2
  • 需求1
  • 需求2

Approach

实现方案

  1. Step one
  2. Step two
  1. 第一步
  2. 第二步

Files to Modify

需要修改的文件

  • src/module/file.ts
    - Add X
  • src/tests/file.test.ts
    - Add tests
  • src/module/file.ts
    - 添加X功能
  • src/tests/file.test.ts
    - 添加测试用例

Open Questions

待解决问题

  • Q1?

4. **Get plan approval** - Review with stakeholder if needed
  • 问题1?

4. **获取方案批准** - 如有需要,与相关人员评审方案

Phase 3: Code

第三阶段:编码

Implement the solution:
  1. Follow the plan - Work through requirements systematically
  2. Commit frequently - Small, atomic commits with clear messages
  3. Write tests - Unit tests for new code
  4. Run tests - Ensure nothing is broken
bash
undefined
实现解决方案:
  1. 遵循方案 - 系统地完成各项需求
  2. 频繁提交 - 小而独立的提交,配合清晰的提交信息
  3. 编写测试 - 为新代码编写单元测试
  4. 运行测试 - 确保没有功能被破坏
bash
undefined

Commit format

提交信息格式

git commit -m "feat(module): description [PROJ-123]"
undefined
git commit -m "feat(module): description [PROJ-123]"
undefined

Phase 4: Review

第四阶段:评审

Self-review before creating PR:
创建PR前先进行自我评审:

Code Review Checklist

代码评审检查清单

  • Functionality - Does it work as expected?
  • Tests - Are there adequate tests?
  • Edge cases - Are edge cases handled?
  • Error handling - Are errors handled gracefully?
  • Performance - Any obvious performance issues?
  • Security - Any security concerns?
  • Documentation - Are complex parts documented?
  • Style - Does it follow project conventions?
  • 功能完整性 - 是否符合预期?
  • 测试覆盖 - 测试是否充分?
  • 边缘情况 - 是否处理了边缘情况?
  • 错误处理 - 错误是否被优雅处理?
  • 性能 - 是否有明显的性能问题?
  • 安全性 - 是否有安全隐患?
  • 文档 - 复杂部分是否有文档说明?
  • 代码风格 - 是否遵循项目规范?

Run Reviews

执行评审

bash
undefined
bash
undefined

Run linter

运行代码检查工具

npm run lint
npm run lint

Run tests

运行测试

npm test
npm test

Run type check

运行类型检查

npm run typecheck
undefined
npm run typecheck
undefined

Phase 5: Ship

第五阶段:交付

Create PR and close the loop:
bash
undefined
创建PR并完成闭环:
bash
undefined

1. Push branch

1. 推送分支

git push origin PROJ-123-feature-name
git push origin PROJ-123-feature-name

2. Create PR

2. 创建PR

npx tsx skills/github/scripts/create_pr.ts org/repo PROJ-123-feature-name main "feat: Add feature [PROJ-123]"
npx tsx skills/github/scripts/create_pr.ts org/repo PROJ-123-feature-name main "feat: Add feature [PROJ-123]"

3. Add PR link to ticket

3. 向工单添加PR链接

npx tsx skills/jira/scripts/add_comment.ts PROJ-123 "PR created: https://github.com/org/repo/pull/XXX"
npx tsx skills/jira/scripts/add_comment.ts PROJ-123 "PR created: https://github.com/org/repo/pull/XXX"

4. Update ticket status

4. 更新工单状态

npx tsx skills/jira/scripts/update_ticket.ts PROJ-123 "Code Review"
npx tsx skills/jira/scripts/update_ticket.ts PROJ-123 "Code Review"

5. After merge, clean up

5. 合并后,清理工作树

./skills/git-worktree/scripts/remove_worktree.sh repo PROJ-123-feature-name
undefined
./skills/git-worktree/scripts/remove_worktree.sh repo PROJ-123-feature-name
undefined

Detailed Guides

详细指南

  • Planning Workflow - Detailed planning process
  • Coding Workflow - Coding best practices
  • Review Workflow - Review checklist and process
  • 规划工作流 - 详细的规划流程
  • 编码工作流 - 编码最佳实践
  • 评审工作流 - 评审检查清单及流程