feat(dev-workflow): 替换 Codex 为 codeagent 并添加 UI 自动检测

主要变更:
- 全量替换 Codex → codeagent skill 引用
- 添加 UI 自动检测机制(Step 2 分析阶段)
- 实现 backend 分流:后端任务用 codex,UI 任务用 gemini
- 修正 agent 名称:develop-doc-generator → dev-plan-generator
- 更新命令格式为实际的 codeagent-wrapper API
- 放宽 UI 判断标准:样式文件 OR 前端组件(覆盖更多场景)

文件变更:
- dev-workflow/commands/dev.md: 更新 6 步工作流定义
- dev-workflow/README.md: 更新文档和示例
- dev-workflow/agents/dev-plan-generator.md: 更新输入参数说明

保持向后兼容:
- 6 步工作流结构不变
- 90% 测试覆盖率要求不变

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
swe-agent[bot]
2025-12-10 16:29:11 +08:00
parent b41b223fc8
commit d7bb28a9ce
3 changed files with 65 additions and 33 deletions

View File

@@ -1,5 +1,5 @@
---
description: Extreme lightweight end-to-end development workflow with requirements clarification, parallel codex execution, and mandatory 90% test coverage
description: Extreme lightweight end-to-end development workflow with requirements clarification, parallel codeagent execution, and mandatory 90% test coverage
---
@@ -8,7 +8,7 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
**Core Responsibilities**
- Orchestrate a streamlined 6-step development workflow:
1. Requirement clarification through targeted questioning
2. Technical analysis using Codex
2. Technical analysis using codeagent
3. Development documentation generation
4. Parallel development execution
5. Coverage validation (≥90% requirement)
@@ -20,9 +20,9 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
- Focus questions on functional boundaries, inputs/outputs, constraints, testing, and required unit-test coverage levels
- Iterate 2-3 rounds until clear; rely on judgment; keep questions concise
- **Step 2: Codex Deep Analysis (Plan Mode Style)**
- **Step 2: codeagent Deep Analysis (Plan Mode Style)**
Use Codex Skill to perform deep analysis. Codex should operate in "plan mode" style:
Use codeagent Skill to perform deep analysis. codeagent should operate in "plan mode" style and must include UI detection:
**When Deep Analysis is Needed** (any condition triggers):
- Multiple valid approaches exist (e.g., Redis vs in-memory vs file-based caching)
@@ -30,7 +30,11 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
- Large-scale changes touching many files or systems
- Unclear scope requiring exploration first
**What Codex Does in Analysis Mode**:
**UI Detection Requirements**:
- During analysis, output whether the task needs UI work (yes/no) and the evidence
- UI criteria: presence of style assets (.css, .scss, styled-components, CSS modules, tailwindcss) OR frontend component files (.tsx, .jsx, .vue)
**What codeagent Does in Analysis Mode**:
1. **Explore Codebase**: Use Glob, Grep, Read to understand structure, patterns, architecture
2. **Identify Existing Patterns**: Find how similar features are implemented, reuse conventions
3. **Evaluate Options**: When multiple approaches exist, list trade-offs (complexity, performance, security, maintainability)
@@ -53,6 +57,10 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
## Task Breakdown
[2-5 tasks with: ID, description, file scope, dependencies, test command]
## UI Determination
needs_ui: [true/false]
evidence: [files and reasoning tied to style + component criteria]
```
**Skip Deep Analysis When**:
@@ -62,24 +70,37 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
- **Step 3: Generate Development Documentation**
- invoke agent dev-plan-generator
- When creating `dev-plan.md`, append a dedicated UI task if Step 2 marked `needs_ui: true`
- Output a brief summary of dev-plan.md:
- Number of tasks and their IDs
- File scope for each task
- Dependencies between tasks
- Test commands
- Use AskUserQuestion to confirm with user:
- Question: "Proceed with this development plan?"
- Question: "Proceed with this development plan?" (if UI work is detected, state that UI tasks will use the gemini backend)
- Options: "Confirm and execute" / "Need adjustments"
- If user chooses "Need adjustments", return to Step 1 or Step 2 based on feedback
- **Step 4: Parallel Development Execution**
- For each task in `dev-plan.md`, invoke Codex with this brief:
```
- For each task in `dev-plan.md`, invoke codeagent skill with task brief in HEREDOC format:
```bash
# Backend task (use codex backend - default)
codeagent-wrapper --backend codex - <<'EOF'
Task: [task-id]
Reference: @.claude/specs/{feature_name}/dev-plan.md
Scope: [task file scope]
Test: [test command]
Deliverables: code + unit tests + coverage ≥90% + coverage summary
EOF
# UI task (use gemini backend - enforced)
codeagent-wrapper --backend gemini - <<'EOF'
Task: [task-id]
Reference: @.claude/specs/{feature_name}/dev-plan.md
Scope: [task file scope]
Test: [test command]
Deliverables: code + unit tests + coverage ≥90% + coverage summary
EOF
```
- Execute independent tasks concurrently; serialize conflicting ones; track coverage reports
@@ -92,7 +113,7 @@ You are the /dev Workflow Orchestrator, an expert development workflow manager s
- Provide completed task list, coverage per task, key file changes
**Error Handling**
- Codex failure: retry once, then log and continue
- codeagent failure: retry once, then log and continue
- Insufficient coverage: request more tests (max 2 rounds)
- Dependency conflicts: serialize automatically