mirror of
https://github.com/cexll/myclaude.git
synced 2025-12-24 13:47:58 +08:00
主要变更: - 全量替换 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>
175 lines
4.8 KiB
Markdown
175 lines
4.8 KiB
Markdown
# /dev - Minimal Dev Workflow
|
||
|
||
## Overview
|
||
|
||
A freshly designed lightweight development workflow with no legacy baggage, focused on delivering high-quality code fast.
|
||
|
||
## Flow
|
||
|
||
```
|
||
/dev trigger
|
||
↓
|
||
AskUserQuestion (requirements clarification)
|
||
↓
|
||
codeagent analysis (plan mode + UI auto-detection)
|
||
↓
|
||
dev-plan-generator (create dev doc)
|
||
↓
|
||
codeagent concurrent development (2–5 tasks, backend split)
|
||
↓
|
||
codeagent testing & verification (≥90% coverage)
|
||
↓
|
||
Done (generate summary)
|
||
```
|
||
|
||
## The 6 Steps
|
||
|
||
### 1. Clarify Requirements
|
||
- Use **AskUserQuestion** to ask the user directly
|
||
- No scoring system, no complex logic
|
||
- 2–3 rounds of Q&A until the requirement is clear
|
||
|
||
### 2. codeagent Analysis & UI Detection
|
||
- Call codeagent to analyze the request in plan mode style
|
||
- Extract: core functions, technical points, task list (2–5 items)
|
||
- UI auto-detection: needs UI work when task involves style assets (.css, .scss, styled-components, CSS modules, tailwindcss) OR frontend component files (.tsx, .jsx, .vue); output yes/no plus evidence
|
||
|
||
### 3. Generate Dev Doc
|
||
- Call the **dev-plan-generator** agent
|
||
- Produce a single `dev-plan.md`
|
||
- Append a dedicated UI task when Step 2 marks `needs_ui: true`
|
||
- Include: task breakdown, file scope, dependencies, test commands
|
||
|
||
### 4. Concurrent Development
|
||
- Work from the task list in dev-plan.md
|
||
- Use codeagent per task with explicit backend selection:
|
||
- Backend/API/DB tasks → `--backend codex` (default)
|
||
- UI/style/component tasks → `--backend gemini` (enforced)
|
||
- Independent tasks → run in parallel
|
||
- Conflicting tasks → run serially
|
||
|
||
### 5. Testing & Verification
|
||
- Each codeagent task:
|
||
- Implements the feature
|
||
- Writes tests
|
||
- Runs coverage
|
||
- Reports results (≥90%)
|
||
|
||
### 6. Complete
|
||
- Summarize task status
|
||
- Record coverage
|
||
|
||
## Usage
|
||
|
||
```bash
|
||
/dev "Implement user login with email + password"
|
||
```
|
||
|
||
**No options**, fixed workflow, works out of the box.
|
||
|
||
## Output Structure
|
||
|
||
```
|
||
.claude/specs/{feature_name}/
|
||
└── dev-plan.md # Dev document generated by agent
|
||
```
|
||
|
||
Only one file—minimal and clear.
|
||
|
||
## Core Components
|
||
|
||
### Tools
|
||
- **AskUserQuestion**: interactive requirement clarification
|
||
- **codeagent skill**: analysis, development, testing; supports `--backend` for codex (default) or gemini (UI)
|
||
- **dev-plan-generator agent**: generate dev doc (subagent via Task tool, saves context)
|
||
|
||
## UI Auto-Detection & Backend Routing
|
||
- **UI detection standard**: style files (.css, .scss, styled-components, CSS modules, tailwindcss) OR frontend component code (.tsx, .jsx, .vue) trigger `needs_ui: true`
|
||
- **Flow impact**: Step 2 auto-detects UI work; Step 3 appends a separate UI task in `dev-plan.md` when detected
|
||
- **Backend split**: backend/API tasks use codex backend (default); UI tasks force gemini backend
|
||
- **Implementation**: Orchestrator invokes codeagent skill with appropriate backend parameter per task type
|
||
|
||
## Key Features
|
||
|
||
### ✅ Fresh Design
|
||
- No legacy project residue
|
||
- No complex scoring logic
|
||
- No extra abstraction layers
|
||
|
||
### ✅ Minimal Orchestration
|
||
- Orchestrator controls the flow directly
|
||
- Only three tools/components
|
||
- Steps are straightforward
|
||
|
||
### ✅ Concurrency
|
||
- 2–5 tasks in parallel
|
||
- Auto-detect dependencies and conflicts
|
||
- codeagent executes independently
|
||
|
||
### ✅ Quality Assurance
|
||
- Enforces 90% coverage
|
||
- codeagent tests and verifies its own work
|
||
- Automatic retry on failure
|
||
|
||
## Example
|
||
|
||
```bash
|
||
# Trigger
|
||
/dev "Add user login feature"
|
||
|
||
# Step 1: Clarify requirements
|
||
Q: What login methods are supported?
|
||
A: Email + password
|
||
Q: Should login be remembered?
|
||
A: Yes, use JWT token
|
||
|
||
# Step 2: codeagent analysis
|
||
Output:
|
||
- Core: email/password login + JWT auth
|
||
- Task 1: Backend API
|
||
- Task 2: Password hashing
|
||
- Task 3: Frontend form
|
||
UI detection: needs_ui = true (tailwindcss classes in frontend form)
|
||
|
||
# Step 3: Generate doc
|
||
dev-plan.md generated with backend + UI tasks ✓
|
||
|
||
# Step 4-5: Concurrent development (backend codex, UI gemini)
|
||
[task-1] Backend API (codex) → tests → 92% ✓
|
||
[task-2] Password hashing (codex) → tests → 95% ✓
|
||
[task-3] Frontend form (gemini) → tests → 91% ✓
|
||
```
|
||
|
||
## Directory Structure
|
||
|
||
```
|
||
dev-workflow/
|
||
├── README.md # This doc
|
||
├── commands/
|
||
│ └── dev.md # /dev workflow orchestrator definition
|
||
└── agents/
|
||
└── dev-plan-generator.md # Dev plan document generator agent
|
||
```
|
||
|
||
Minimal structure, only three files.
|
||
|
||
## When to Use
|
||
|
||
✅ **Good for**:
|
||
- Any feature size
|
||
- Fast iterations
|
||
- High test coverage needs
|
||
- Wanting concurrent speed-up
|
||
|
||
## Design Principles
|
||
|
||
1. **KISS**: keep it simple
|
||
2. **Disposable**: no persistent config
|
||
3. **Quality first**: enforce 90% coverage
|
||
4. **Concurrency first**: leverage codeagent
|
||
5. **No legacy baggage**: clean-slate design
|
||
|
||
---
|
||
|
||
**Philosophy**: zero tolerance for complexity—ship the smallest usable solution, like Linus would.
|