mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-12 02:37:45 +08:00
Refactor workflow tools and user interaction methods
- Updated synthesis tool to enhance user interaction with multi-select options and improved question presentation in Chinese. - Revised conflict resolution tool to allow batch processing of conflicts, increasing the limit from 4 to 10 per round and changing user interaction from AskUserQuestion to text output. - Added context_package_path to task generation tools for better context management. - Improved task generation schema to include context_package_path for enhanced context delivery. - Updated CLI templates to reflect changes in task JSON schema, ensuring context_package_path is included.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
name: artifacts
|
||||
description: Interactive clarification generating confirmed guidance specification
|
||||
argument-hint: "topic or challenge description [--count N]"
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), AskUserQuestion(*), Glob(*)
|
||||
allowed-tools: TodoWrite(*), Read(*), Write(*), Glob(*)
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -15,7 +15,7 @@ Five-phase workflow: Extract topic challenges → Select roles → Generate task
|
||||
|
||||
**Parameters**:
|
||||
- `topic` (required): Topic or challenge description (structured format recommended)
|
||||
- `--count N` (optional): Number of roles user WANTS to select (system will recommend N+2 options via AskUserQuestion for user to choose from, default: 3)
|
||||
- `--count N` (optional): Number of roles user WANTS to select (system will recommend N+2 options for user to choose from, default: 3)
|
||||
|
||||
## Task Tracking
|
||||
|
||||
@@ -33,29 +33,104 @@ Five-phase workflow: Extract topic challenges → Select roles → Generate task
|
||||
```json
|
||||
[
|
||||
{"content": "Initialize session (.workflow/.active-* check, parse --count parameter)", "status": "pending", "activeForm": "Initializing"},
|
||||
{"content": "Phase 1: Extract challenges, generate 2-4 task-specific questions", "status": "pending", "activeForm": "Phase 1 topic analysis"},
|
||||
{"content": "Phase 2: Recommend count+2 roles, MUST collect user selection via AskUserQuestion (multiSelect)", "status": "pending", "activeForm": "Phase 2 role selection"},
|
||||
{"content": "Phase 3: Generate 3-4 task-specific questions per role (max 4 per round)", "status": "pending", "activeForm": "Phase 3 role questions"},
|
||||
{"content": "Phase 4: Detect conflicts in Phase 3 answers, generate clarifications (max 4 per round)", "status": "pending", "activeForm": "Phase 4 conflict resolution"},
|
||||
{"content": "Phase 1: Extract challenges, output 2-4 task-specific questions, wait for user input", "status": "pending", "activeForm": "Phase 1 topic analysis"},
|
||||
{"content": "Phase 2: Recommend count+2 roles, output role selection, wait for user input", "status": "pending", "activeForm": "Phase 2 role selection"},
|
||||
{"content": "Phase 3: Generate 3-4 questions per role, output and wait for answers (max 10 per round)", "status": "pending", "activeForm": "Phase 3 role questions"},
|
||||
{"content": "Phase 4: Detect conflicts, output clarifications, wait for answers (max 10 per round)", "status": "pending", "activeForm": "Phase 4 conflict resolution"},
|
||||
{"content": "Phase 5: Transform Q&A to declarative statements, write guidance-specification.md", "status": "pending", "activeForm": "Phase 5 document generation"}
|
||||
]
|
||||
```
|
||||
|
||||
## User Interaction Protocol
|
||||
|
||||
### Question Output Format
|
||||
|
||||
All questions output as structured text (detailed format with descriptions):
|
||||
|
||||
```markdown
|
||||
【问题{N} - {短标签}】{问题文本}
|
||||
a) {选项标签}
|
||||
说明:{选项说明和影响}
|
||||
b) {选项标签}
|
||||
说明:{选项说明和影响}
|
||||
c) {选项标签}
|
||||
说明:{选项说明和影响}
|
||||
|
||||
请回答:{N}a 或 {N}b 或 {N}c
|
||||
```
|
||||
|
||||
**Multi-select format** (Phase 2 role selection):
|
||||
```markdown
|
||||
【角色选择】请选择 {count} 个角色参与头脑风暴分析
|
||||
|
||||
a) {role-name} ({中文名})
|
||||
推荐理由:{基于topic的相关性说明}
|
||||
b) {role-name} ({中文名})
|
||||
推荐理由:{基于topic的相关性说明}
|
||||
...
|
||||
|
||||
支持格式:
|
||||
- 分别选择:2a 2c 2d (选择第2题的a、c、d选项)
|
||||
- 合并语法:2acd (选择a、c、d)
|
||||
- 逗号分隔:2a,c,d
|
||||
|
||||
请输入选择:
|
||||
```
|
||||
|
||||
### Input Parsing Rules
|
||||
|
||||
**Supported formats** (intelligent parsing):
|
||||
|
||||
1. **Space-separated**: `1a 2b 3c` → Q1:a, Q2:b, Q3:c
|
||||
2. **Comma-separated**: `1a,2b,3c` → Q1:a, Q2:b, Q3:c
|
||||
3. **Multi-select combined**: `2abc` → Q2: options a,b,c
|
||||
4. **Multi-select spaces**: `2 a b c` → Q2: options a,b,c
|
||||
5. **Multi-select comma**: `2a,b,c` → Q2: options a,b,c
|
||||
6. **Natural language**: `问题1选a` → 1a (fallback parsing)
|
||||
|
||||
**Parsing algorithm**:
|
||||
- Extract question numbers and option letters
|
||||
- Validate question numbers match output
|
||||
- Validate option letters exist for each question
|
||||
- If ambiguous/invalid, output example format and request re-input
|
||||
|
||||
**Error handling** (lenient):
|
||||
- Recognize common variations automatically
|
||||
- If parsing fails, show example and wait for clarification
|
||||
- Support re-input without penalty
|
||||
|
||||
### Batching Strategy
|
||||
|
||||
**Batch limits**:
|
||||
- **Default**: Maximum 10 questions per round
|
||||
- **Phase 2 (role selection)**: Display all recommended roles at once (count+2 roles)
|
||||
- **Auto-split**: If questions > 10, split into multiple rounds with clear round indicators
|
||||
|
||||
**Round indicators**:
|
||||
```markdown
|
||||
===== 第 1 轮问题 (共2轮) =====
|
||||
【问题1 - ...】...
|
||||
【问题2 - ...】...
|
||||
...
|
||||
【问题10 - ...】...
|
||||
|
||||
请回答 (格式: 1a 2b ... 10c):
|
||||
```
|
||||
|
||||
### Interaction Flow
|
||||
|
||||
**Standard flow**:
|
||||
1. Output questions in formatted text
|
||||
2. Output expected input format example
|
||||
3. Wait for user input
|
||||
4. Parse input with intelligent matching
|
||||
5. If parsing succeeds → Store answers and continue
|
||||
6. If parsing fails → Show error, example, and wait for re-input
|
||||
|
||||
**No question/option limits**: Text-based interaction removes previous 4-question and 4-option restrictions
|
||||
|
||||
## Execution Phases
|
||||
|
||||
### Phase 0: User Mode Check (First Step)
|
||||
|
||||
**Output to user**:
|
||||
```
|
||||
**⚠️ 请先启用 "CLAUDE accept edits on" 模式**
|
||||
|
||||
本命令需要多轮交互问答(5个阶段,约10-15个问题)
|
||||
|
||||
启用后回复继续。
|
||||
```
|
||||
|
||||
**Wait for user confirmation** before proceeding to Phase 1.
|
||||
|
||||
### Session Management
|
||||
- Check `.workflow/.active-*` markers first
|
||||
- Multiple sessions → Prompt selection | Single → Use it | None → Create `WFS-[topic-slug]`
|
||||
@@ -69,20 +144,42 @@ Five-phase workflow: Extract topic challenges → Select roles → Generate task
|
||||
**Steps**:
|
||||
1. **Deep topic analysis**: Extract technical entities, identify core challenges (what makes this hard?), constraints (timeline/budget/compliance), success metrics (what defines done?)
|
||||
2. **Generate 2-4 probing questions** targeting root challenges, trade-off priorities, and risk tolerance (NOT surface-level "Project Type")
|
||||
3. **User interaction via AskUserQuestion tool**: Present 2-4 task-specific questions (multiSelect: false for single-choice questions)
|
||||
4. **Storage**: Store answers to `session.intent_context` with `{extracted_keywords, identified_challenges, user_answers}`
|
||||
3. **User interaction**: Output questions using text format (see User Interaction Protocol), wait for user input
|
||||
4. **Parse user answers**: Use intelligent parsing to extract answers from user input (support multiple formats)
|
||||
5. **Storage**: Store answers to `session.intent_context` with `{extracted_keywords, identified_challenges, user_answers}`
|
||||
|
||||
**Example (Task-Specific)**:
|
||||
Topic: "Build real-time collaboration platform SCOPE: 100 users"
|
||||
→ Extract: ["real-time", "collaboration", "100 users"]
|
||||
→ Challenges: ["data sync", "scalability", "low latency"]
|
||||
→ Generate: "PRIMARY technical challenge?" → [Real-time data sync / Scalability to 100+ users / Conflict resolution]
|
||||
**Example Output**:
|
||||
```markdown
|
||||
===== Phase 1: 项目意图分析 =====
|
||||
|
||||
【问题1 - 核心挑战】实时协作平台的主要技术挑战?
|
||||
a) 实时数据同步
|
||||
说明:100+用户同时在线,状态同步复杂度高
|
||||
b) 可扩展性架构
|
||||
说明:用户规模增长时的系统扩展能力
|
||||
c) 冲突解决机制
|
||||
说明:多用户同时编辑的冲突处理策略
|
||||
|
||||
【问题2 - 优先级】MVP阶段最关注的指标?
|
||||
a) 功能完整性
|
||||
说明:实现所有核心功能
|
||||
b) 用户体验
|
||||
说明:流畅的交互体验和响应速度
|
||||
c) 系统稳定性
|
||||
说明:高可用性和数据一致性
|
||||
|
||||
请回答 (格式: 1a 2b):
|
||||
```
|
||||
|
||||
**User input examples**:
|
||||
- `1a 2c` → Q1:a, Q2:c
|
||||
- `1a,2c` → Q1:a, Q2:c
|
||||
|
||||
**⚠️ CRITICAL**: Questions MUST reference topic keywords. Generic "Project type?" violates dynamic generation.
|
||||
|
||||
### Phase 2: Role Selection
|
||||
|
||||
**⚠️ CRITICAL**: This phase MUST use AskUserQuestion tool for user selection. NEVER auto-select roles without user interaction.
|
||||
**⚠️ CRITICAL**: User MUST interact to select roles. NEVER auto-select without user confirmation.
|
||||
|
||||
**Available Roles**:
|
||||
- data-architect (数据架构师)
|
||||
@@ -96,35 +193,49 @@ Topic: "Build real-time collaboration platform SCOPE: 100 users"
|
||||
- ux-expert (UX 专家)
|
||||
|
||||
**Steps**:
|
||||
1. **Intelligent role recommendation** (AI analysis, NO user interaction yet):
|
||||
1. **Intelligent role recommendation** (AI analysis):
|
||||
- Analyze Phase 1 extracted keywords and challenges
|
||||
- Use AI reasoning to determine most relevant roles for the specific topic
|
||||
- Recommend count+2 roles (e.g., if user wants 3 roles, recommend 5 options)
|
||||
- Provide clear rationale for each recommended role based on topic context
|
||||
|
||||
2. **User selection** (MANDATORY AskUserQuestion interaction):
|
||||
- **Tool**: `AskUserQuestion` with `multiSelect: true`
|
||||
- **Question format**: "请选择 {count} 个角色参与头脑风暴分析(可多选):"
|
||||
- **Options**: Each recommended role with label (role name) and description (relevance rationale)
|
||||
- **⚠️ Option Limit**: Maximum 4 options per AskUserQuestion call. If count+2 > 4, split into multiple rounds
|
||||
- **User interaction**: Allow user to select multiple roles (typically count roles, but flexible)
|
||||
2. **User selection** (text interaction):
|
||||
- Output all recommended roles at once (no batching needed for count+2 roles)
|
||||
- Display roles with labels and relevance rationale
|
||||
- Wait for user input in multi-select format
|
||||
- Parse user input (support multiple formats)
|
||||
- **Storage**: Store selections to `session.selected_roles`
|
||||
|
||||
**AskUserQuestion Syntax**:
|
||||
```javascript
|
||||
AskUserQuestion({
|
||||
questions: [{
|
||||
question: "请选择 {count} 个角色参与头脑风暴分析(可多选):",
|
||||
header: "角色选择",
|
||||
multiSelect: true, // Enable multiple selection
|
||||
options: [
|
||||
{label: "{role-name} ({中文名})", description: "{基于topic的相关性说明}"}
|
||||
// count+2 recommended roles
|
||||
]
|
||||
}]
|
||||
});
|
||||
**Example Output**:
|
||||
```markdown
|
||||
===== Phase 2: 角色选择 =====
|
||||
|
||||
【角色选择】请选择 3 个角色参与头脑风暴分析
|
||||
|
||||
a) system-architect (系统架构师)
|
||||
推荐理由:实时同步架构设计和技术选型的核心角色
|
||||
b) ui-designer (UI设计师)
|
||||
推荐理由:协作界面用户体验和实时状态展示
|
||||
c) product-manager (产品经理)
|
||||
推荐理由:功能优先级和MVP范围决策
|
||||
d) data-architect (数据架构师)
|
||||
推荐理由:数据同步模型和存储方案设计
|
||||
e) ux-expert (UX专家)
|
||||
推荐理由:多用户协作交互流程优化
|
||||
|
||||
支持格式:
|
||||
- 分别选择:2a 2c 2d (选择a、c、d)
|
||||
- 合并语法:2acd (选择a、c、d)
|
||||
- 逗号分隔:2a,c,d (选择a、c、d)
|
||||
|
||||
请输入选择:
|
||||
```
|
||||
|
||||
**User input examples**:
|
||||
- `2acd` → Roles: a, c, d (system-architect, product-manager, data-architect)
|
||||
- `2a 2c 2d` → Same result
|
||||
- `2a,c,d` → Same result
|
||||
|
||||
**Role Recommendation Rules**:
|
||||
- NO hardcoded keyword-to-role mappings
|
||||
- Use intelligent analysis of topic, challenges, and requirements
|
||||
@@ -149,39 +260,28 @@ FOR each selected role:
|
||||
Q: "How resolve conflicts when 2 users edit simultaneously?" (explores edge case)
|
||||
Options: [Event Sourcing/Centralized/CRDT] (concrete, explain trade-offs for THIS use case)
|
||||
|
||||
3. Ask questions via AskUserQuestion tool (max 4 questions per call):
|
||||
- Tool: AskUserQuestion with questions array (1-4 questions)
|
||||
- Each question: multiSelect: false (single-choice)
|
||||
- If role has 3-4 questions: Single AskUserQuestion call with multiple questions
|
||||
3. Output questions in text format per role:
|
||||
- Display all questions for current role (3-4 questions, no 10-question limit)
|
||||
- Questions in Chinese (用中文提问)
|
||||
- Wait for user input
|
||||
- Parse answers using intelligent parsing
|
||||
- Store answers to session.role_decisions[role]
|
||||
```
|
||||
|
||||
**AskUserQuestion Tool Usage**:
|
||||
- **Batching**: Maximum 4 questions per AskUserQuestion call
|
||||
- **Mode**: `multiSelect: false` for each question (single-choice answers)
|
||||
- **Language**: Questions MUST be asked in Chinese (用中文提问)
|
||||
- **Format**: Each question includes header (short label), question text, and 2-4 options with descriptions
|
||||
**Batching Strategy**:
|
||||
- Each role outputs all its questions at once (typically 3-4 questions)
|
||||
- No need to split per role (within 10-question batch limit)
|
||||
- Multiple roles processed sequentially (one role at a time for clarity)
|
||||
|
||||
**Question Batching Rules**:
|
||||
- ✅ Each role generates 3-4 questions
|
||||
- ✅ AskUserQuestion supports maximum 4 questions per call
|
||||
- ✅ Single round per role (all questions asked together)
|
||||
- ✅ Questions MUST be asked in Chinese (用中文提问) for better user understanding
|
||||
- ✅ Questions MUST reference Phase 1 keywords (e.g., "real-time", "100 users")
|
||||
- ✅ Options MUST be concrete approaches, explain relevance to topic
|
||||
- ❌ NEVER generic "Architecture style?" without task context
|
||||
**Output Format**: Follow standard format from "User Interaction Protocol" section (single-choice question format)
|
||||
|
||||
**Examples by Role** (for "real-time collaboration platform"):
|
||||
- **system-architect** (4 questions in one round):
|
||||
1. "100+ 用户实时状态同步方案?" → [Event Sourcing/集中式状态/CRDT]
|
||||
2. "两个用户同时编辑冲突如何解决?" → [自动合并/手动解决/版本控制]
|
||||
3. "低延迟通信协议选择?" → [WebSocket/SSE/轮询]
|
||||
4. "系统扩展性架构方案?" → [微服务/单体+缓存/Serverless]
|
||||
**Example Topic-Specific Questions** (system-architect role for "real-time collaboration platform"):
|
||||
- "100+ 用户实时状态同步方案?" → Options: Event Sourcing / 集中式状态管理 / CRDT
|
||||
- "两个用户同时编辑冲突如何解决?" → Options: 自动合并 / 手动解决 / 版本控制
|
||||
- "低延迟通信协议选择?" → Options: WebSocket / SSE / 轮询
|
||||
- "系统扩展性架构方案?" → Options: 微服务 / 单体+缓存 / Serverless
|
||||
|
||||
- **ui-designer** (3 questions in one round):
|
||||
1. "如何展示实时协作状态?" → [实时光标/活动流/最小化指示器]
|
||||
2. "冲突时的用户界面反馈?" → [即时警告/合并界面/回滚选项]
|
||||
3. "多用户在线状态展示?" → [头像列表/活动面板/状态栏]
|
||||
**Quality Requirements**: See "Question Generation Guidelines" section for detailed rules
|
||||
|
||||
### Phase 4: Cross-Role Clarification (Conflict Detection)
|
||||
|
||||
@@ -197,33 +297,33 @@ FOR each selected role:
|
||||
2. FOR each detected conflict:
|
||||
Generate clarification questions referencing SPECIFIC Phase 3 choices
|
||||
|
||||
3. Ask via AskUserQuestion tool in batches (max 4 questions per call):
|
||||
- Tool: AskUserQuestion with questions array (1-4 questions)
|
||||
- Each question: multiSelect: false (single-choice)
|
||||
- If conflicts ≤ 4: Single AskUserQuestion call
|
||||
- If conflicts > 4: Multiple AskUserQuestion calls (max 4 questions each)
|
||||
3. Output clarification questions in text format:
|
||||
- Batch conflicts into rounds (max 10 questions per round)
|
||||
- Display questions with context from Phase 3 answers
|
||||
- Questions in Chinese (用中文提问)
|
||||
- Wait for user input
|
||||
- Parse answers using intelligent parsing
|
||||
- Store answers to session.cross_role_decisions
|
||||
|
||||
4. If NO conflicts: Skip Phase 4 (inform user)
|
||||
4. If NO conflicts: Skip Phase 4 (inform user: "未检测到跨角色冲突,跳过Phase 4")
|
||||
```
|
||||
|
||||
**AskUserQuestion Tool Usage**:
|
||||
- **Batching**: Maximum 4 questions per AskUserQuestion call
|
||||
- **Mode**: `multiSelect: false` for each question (single-choice answers)
|
||||
- **Language**: Questions in Chinese (用中文提问)
|
||||
- **Multiple rounds**: If conflicts > 4, call AskUserQuestion multiple times sequentially
|
||||
**Batching Strategy**:
|
||||
- Maximum 10 clarification questions per round
|
||||
- If conflicts > 10, split into multiple rounds
|
||||
- Prioritize most critical conflicts first
|
||||
|
||||
**Batching Rules**:
|
||||
- ✅ Maximum 4 clarification questions per AskUserQuestion call
|
||||
- ✅ Multiple rounds if more than 4 conflicts detected
|
||||
- ✅ Prioritize most critical conflicts first
|
||||
- ✅ Questions in Chinese (用中文提问)
|
||||
**Output Format**: Follow standard format from "User Interaction Protocol" section (single-choice question format with background context)
|
||||
|
||||
**Example Conflict**:
|
||||
- Detect: system-architect "CRDT sync" (conflict-free) + ui-designer "Rollback on conflict" (expects conflicts)
|
||||
- Generate: "CRDT 与 UI 回滚期望冲突,如何解决?" → [CRDT 自动合并/显示合并界面/切换到 OT]
|
||||
**Example Conflict Detection** (from Phase 3 answers):
|
||||
- **Architecture Conflict**: "CRDT 与 UI 回滚期望冲突,如何解决?"
|
||||
- Background: system-architect chose CRDT, ui-designer expects rollback UI
|
||||
- Options: 采用 CRDT / 显示合并界面 / 切换到 OT
|
||||
- **Integration Gap**: "实时光标功能缺少身份认证方案"
|
||||
- Background: ui-designer chose live cursors, no auth defined
|
||||
- Options: OAuth 2.0 / JWT Token / Session-based
|
||||
|
||||
**⚠️ CRITICAL**: NEVER use static "Cross-Role Matrix". ALWAYS analyze actual Phase 3 answers.
|
||||
**Quality Requirements**: See "Question Generation Guidelines" section for conflict-specific rules
|
||||
|
||||
### Phase 5: Generate Guidance Specification
|
||||
|
||||
@@ -288,35 +388,6 @@ FOR each selected role:
|
||||
| D-003+ | [Role] | [Q] | [A] | 3 | [Why] |
|
||||
```
|
||||
|
||||
## AskUserQuestion Tool Reference
|
||||
|
||||
### Syntax Structure
|
||||
```javascript
|
||||
AskUserQuestion({
|
||||
questions: [
|
||||
{
|
||||
question: "{动态生成的问题文本}",
|
||||
header: "{短标签,最多12字符}",
|
||||
multiSelect: false, // Phase 1,3,4: false | Phase 2: true
|
||||
options: [
|
||||
{label: "{选项标签}", description: "{选项说明}"},
|
||||
// 2-4 options per question
|
||||
]
|
||||
}
|
||||
// Maximum 4 questions per call
|
||||
]
|
||||
});
|
||||
```
|
||||
|
||||
### Usage Rules
|
||||
- **Maximum**: 4 questions per AskUserQuestion call
|
||||
- **Language**: Questions in Chinese (用中文提问)
|
||||
- **multiSelect**:
|
||||
- `false` (Phase 1, 3, 4): Single-choice
|
||||
- `true` (Phase 2): Multiple role selection
|
||||
- **Options**: 2-4 options with label + description
|
||||
- **Multiple rounds**: Call tool multiple times if > 4 questions needed
|
||||
|
||||
## Question Generation Guidelines
|
||||
|
||||
### Core Principle: Developer-Facing Questions with User Context
|
||||
@@ -329,49 +400,50 @@ AskUserQuestion({
|
||||
3. **Phase 3**: 业务需求 + 技术选型(需求驱动的技术决策)
|
||||
4. **Phase 4**: 技术冲突的业务权衡(帮助开发者理解影响)
|
||||
|
||||
### Question Quality Rules
|
||||
### Universal Quality Rules
|
||||
|
||||
**Balanced Question Pattern** (需求 → 技术):
|
||||
```
|
||||
问题结构:[用户场景/业务需求] + [技术关注点]
|
||||
选项格式:[技术方案简称] + [业务影响说明]
|
||||
```
|
||||
|
||||
**Phase 1 Focus**:
|
||||
- 用户使用场景(谁用?怎么用?多频繁?)
|
||||
- 业务约束(预算、时间、团队、合规)
|
||||
- 成功标准(性能指标、用户体验目标)
|
||||
- 优先级排序(MVP vs 长期规划)
|
||||
|
||||
**Phase 3 Focus**:
|
||||
- 业务需求驱动的技术问题
|
||||
- 技术选项带业务影响说明
|
||||
- 包含量化指标(并发数、延迟、可用性)
|
||||
|
||||
**Phase 4 Focus**:
|
||||
- 技术冲突的业务权衡
|
||||
- 帮助开发者理解不同选择的影响
|
||||
|
||||
**Question Structure**:
|
||||
**Question Structure** (all phases):
|
||||
```
|
||||
[业务场景/需求前提] + [技术关注点]
|
||||
```
|
||||
|
||||
**Option Structure**:
|
||||
**Option Structure** (all phases):
|
||||
```
|
||||
标签:[技术方案简称] + (业务特征)
|
||||
说明:[业务影响] + [技术权衡]
|
||||
```
|
||||
|
||||
**MUST Include**:
|
||||
- 业务场景作为问题前提
|
||||
- 技术选项的业务影响说明
|
||||
- 量化指标和约束条件
|
||||
**MUST Include** (all phases):
|
||||
- ✅ All questions in Chinese (用中文提问)
|
||||
- ✅ 业务场景作为问题前提
|
||||
- ✅ 技术选项的业务影响说明
|
||||
- ✅ 量化指标和约束条件
|
||||
|
||||
**MUST Avoid**:
|
||||
- 纯技术选型无业务上下文
|
||||
- 过度抽象的用户体验问题
|
||||
- 脱离话题的通用架构问题
|
||||
**MUST Avoid** (all phases):
|
||||
- ❌ 纯技术选型无业务上下文
|
||||
- ❌ 过度抽象的用户体验问题
|
||||
- ❌ 脱离话题的通用架构问题
|
||||
|
||||
### Phase-Specific Requirements
|
||||
|
||||
**Phase 1 Requirements**:
|
||||
- Questions MUST reference topic keywords (NOT generic "Project type?")
|
||||
- Focus: 用户使用场景(谁用?怎么用?多频繁?)、业务约束(预算、时间、团队、合规)
|
||||
- Success metrics: 性能指标、用户体验目标
|
||||
- Priority ranking: MVP vs 长期规划
|
||||
|
||||
**Phase 3 Requirements**:
|
||||
- Questions MUST reference Phase 1 keywords (e.g., "real-time", "100 users")
|
||||
- Options MUST be concrete approaches with relevance to topic
|
||||
- Each option includes trade-offs specific to this use case
|
||||
- Include 业务需求驱动的技术问题、量化指标(并发数、延迟、可用性)
|
||||
|
||||
**Phase 4 Requirements**:
|
||||
- Questions MUST reference SPECIFIC Phase 3 choices in background context
|
||||
- Options address the detected conflict directly
|
||||
- Each option explains impact on both conflicting roles
|
||||
- NEVER use static "Cross-Role Matrix" - ALWAYS analyze actual Phase 3 answers
|
||||
- Focus: 技术冲突的业务权衡、帮助开发者理解不同选择的影响
|
||||
|
||||
## Validation Checklist
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: synthesis
|
||||
description: Clarify and refine role analyses through intelligent Q&A and targeted updates
|
||||
argument-hint: "[optional: --session session-id]"
|
||||
allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*), AskUserQuestion(*)
|
||||
allowed-tools: Task(conceptual-planning-agent), TodoWrite(*), Read(*), Write(*), Edit(*), Glob(*)
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -137,54 +137,67 @@ Return JSON array:
|
||||
|
||||
### Phase 4: Main Flow User Interaction
|
||||
|
||||
**Main flow handles all user interaction**:
|
||||
**Main flow handles all user interaction via text output**:
|
||||
|
||||
**⚠️ CRITICAL**: ALL AskUserQuestion calls MUST use Chinese (所有问题必须用中文) for better user understanding
|
||||
**⚠️ CRITICAL**: ALL questions MUST use Chinese (所有问题必须用中文) for better user understanding
|
||||
|
||||
1. **Present Enhancement Options**:
|
||||
```
|
||||
AskUserQuestion(
|
||||
questions=[{
|
||||
"question": "Which enhancements would you like to apply?",
|
||||
"header": "Enhancements",
|
||||
"multiSelect": true,
|
||||
"options": [
|
||||
{"label": "EP-001: ...", "description": "... (affects: role1, role2)"},
|
||||
{"label": "EP-002: ...", "description": "..."},
|
||||
...
|
||||
]
|
||||
}]
|
||||
)
|
||||
1. **Present Enhancement Options** (multi-select):
|
||||
```markdown
|
||||
===== Enhancement 选择 =====
|
||||
|
||||
请选择要应用的改进建议(可多选):
|
||||
|
||||
a) EP-001: API Contract Specification
|
||||
影响角色:system-architect, api-designer
|
||||
说明:添加详细的请求/响应 schema 定义
|
||||
|
||||
b) EP-002: User Intent Validation
|
||||
影响角色:product-manager, ux-expert
|
||||
说明:明确用户需求优先级和验收标准
|
||||
|
||||
c) EP-003: Error Handling Strategy
|
||||
影响角色:system-architect
|
||||
说明:统一异常处理和降级方案
|
||||
|
||||
支持格式:1abc 或 1a 1b 1c 或 1a,b,c
|
||||
请输入选择(可跳过输入 skip):
|
||||
```
|
||||
|
||||
2. **Generate Clarification Questions** (based on analysis agent output):
|
||||
- ✅ **ALL questions MUST be in Chinese (所有问题必须用中文)**
|
||||
- ✅ **ALL questions in Chinese (所有问题必须用中文)**
|
||||
- Use 9-category taxonomy scan results
|
||||
- Create max 5 prioritized questions
|
||||
- Prioritize most critical questions (no hard limit)
|
||||
- Each with 2-4 options + descriptions
|
||||
|
||||
3. **Interactive Clarification Loop**:
|
||||
```
|
||||
# Present ONE question at a time
|
||||
FOR question in clarification_questions (max 5):
|
||||
AskUserQuestion(
|
||||
questions=[{
|
||||
"question": "Question {N}/5: {text}",
|
||||
"header": "Clarification",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{"label": "Option A", "description": "..."},
|
||||
{"label": "Option B", "description": "..."},
|
||||
...
|
||||
]
|
||||
}]
|
||||
)
|
||||
# Record answer
|
||||
# Continue to next question
|
||||
3. **Interactive Clarification Loop** (max 10 questions per round):
|
||||
```markdown
|
||||
===== Clarification 问题 (第 1/2 轮) =====
|
||||
|
||||
【问题1 - 用户意图】MVP 阶段的核心目标是什么?
|
||||
a) 快速验证市场需求
|
||||
说明:最小功能集,快速上线获取反馈
|
||||
b) 建立技术壁垒
|
||||
说明:完善架构,为长期发展打基础
|
||||
c) 实现功能完整性
|
||||
说明:覆盖所有规划功能,延迟上线
|
||||
|
||||
【问题2 - 架构决策】技术栈选择的优先考虑因素?
|
||||
a) 团队熟悉度
|
||||
说明:使用现有技术栈,降低学习成本
|
||||
b) 技术先进性
|
||||
说明:采用新技术,提升竞争力
|
||||
c) 生态成熟度
|
||||
说明:选择成熟方案,保证稳定性
|
||||
|
||||
...(最多10个问题)
|
||||
|
||||
请回答 (格式: 1a 2b 3c...):
|
||||
```
|
||||
|
||||
Wait for user input → Parse all answers in batch → Continue to next round if needed
|
||||
|
||||
4. **Build Update Plan**:
|
||||
```
|
||||
```
|
||||
update_plan = {
|
||||
"role1": {
|
||||
"enhancements": [EP-001, EP-003],
|
||||
|
||||
@@ -207,48 +207,85 @@ Task(subagent_type="cli-execution-agent", prompt=`
|
||||
8. Return execution log path
|
||||
```
|
||||
|
||||
### Phase 3: User Confirmation via AskUserQuestion
|
||||
### Phase 3: User Confirmation via Text Interaction
|
||||
|
||||
**Command parses agent JSON output and presents conflicts to user**:
|
||||
**Command parses agent JSON output and presents conflicts to user via text**:
|
||||
|
||||
```javascript
|
||||
// 1. Parse agent JSON output
|
||||
const conflictData = JSON.parse(agentOutput);
|
||||
const conflicts = conflictData.conflicts.slice(0, 4); // Max 4 (tool limit)
|
||||
const conflicts = conflictData.conflicts; // No 4-conflict limit
|
||||
|
||||
// 2. Build AskUserQuestion with all conflicts
|
||||
const questions = conflicts.map((conflict, idx) => ({
|
||||
question: `${conflict.id}: ${conflict.brief} - 请选择解决方案`,
|
||||
header: `冲突${idx + 1}`,
|
||||
multiSelect: false,
|
||||
options: [
|
||||
...conflict.strategies.map(s => ({
|
||||
label: s.name,
|
||||
description: `${s.approach} | 复杂度: ${s.complexity} | 风险: ${s.risk} | 工作量: ${s.effort}`
|
||||
})),
|
||||
{
|
||||
label: "跳过此冲突",
|
||||
description: "稍后手动处理,不应用任何修改"
|
||||
}
|
||||
]
|
||||
}));
|
||||
// 2. Format conflicts as text output (max 10 per round)
|
||||
const batchSize = 10;
|
||||
const batches = chunkArray(conflicts, batchSize);
|
||||
|
||||
// 3. Call AskUserQuestion
|
||||
AskUserQuestion({questions});
|
||||
for (const [batchIdx, batch] of batches.entries()) {
|
||||
const totalBatches = batches.length;
|
||||
|
||||
// 4. Parse user selections
|
||||
const selectedStrategies = parseUserAnswers(answers, conflicts);
|
||||
// Output batch header
|
||||
console.log(`===== 冲突解决 (第 ${batchIdx + 1}/${totalBatches} 轮) =====\n`);
|
||||
|
||||
// Output each conflict in batch
|
||||
batch.forEach((conflict, idx) => {
|
||||
const questionNum = batchIdx * batchSize + idx + 1;
|
||||
console.log(`【问题${questionNum} - ${conflict.category}】${conflict.id}: ${conflict.brief}`);
|
||||
|
||||
conflict.strategies.forEach((strategy, sIdx) => {
|
||||
const optionLetter = String.fromCharCode(97 + sIdx); // a, b, c, ...
|
||||
console.log(`${optionLetter}) ${strategy.name}`);
|
||||
console.log(` 说明:${strategy.approach}`);
|
||||
console.log(` 复杂度: ${strategy.complexity} | 风险: ${strategy.risk} | 工作量: ${strategy.effort}`);
|
||||
});
|
||||
|
||||
// Add skip option
|
||||
const skipLetter = String.fromCharCode(97 + conflict.strategies.length);
|
||||
console.log(`${skipLetter}) 跳过此冲突`);
|
||||
console.log(` 说明:稍后手动处理,不应用任何修改\n`);
|
||||
});
|
||||
|
||||
console.log(`请回答 (格式: 1a 2b 3c...):`);
|
||||
|
||||
// Wait for user input
|
||||
const userInput = await readUserInput();
|
||||
|
||||
// Parse answers
|
||||
const answers = parseUserAnswers(userInput, batch);
|
||||
}
|
||||
|
||||
// 3. Build selected strategies
|
||||
const selectedStrategies = answers.filter(a => !a.isSkip).map(a => a.strategy);
|
||||
```
|
||||
|
||||
**User Selection Examples**:
|
||||
```
|
||||
Question: "CON-001: 现有认证系统与计划不兼容 - 请选择解决方案"
|
||||
Options:
|
||||
- "渐进式迁移" | 复杂度: Medium | 风险: Low | 工作量: 3-5天
|
||||
- "完全重写" | 复杂度: High | 风险: Medium | 工作量: 7-10天
|
||||
- "跳过此冲突"
|
||||
**Text Output Example**:
|
||||
```markdown
|
||||
===== 冲突解决 (第 1/1 轮) =====
|
||||
|
||||
【问题1 - 认证系统】CON-001: 现有认证系统与计划不兼容
|
||||
a) 渐进式迁移
|
||||
说明:保留现有系统,逐步迁移到新方案
|
||||
复杂度: Medium | 风险: Low | 工作量: 3-5天
|
||||
b) 完全重写
|
||||
说明:废弃旧系统,从零实现新认证
|
||||
复杂度: High | 风险: Medium | 工作量: 7-10天
|
||||
c) 跳过此冲突
|
||||
说明:稍后手动处理,不应用任何修改
|
||||
|
||||
【问题2 - 数据库】CON-002: 数据库 schema 冲突
|
||||
a) 添加迁移脚本
|
||||
说明:创建数据库迁移脚本处理 schema 变更
|
||||
复杂度: Low | 风险: Low | 工作量: 1-2天
|
||||
b) 跳过此冲突
|
||||
说明:稍后手动处理,不应用任何修改
|
||||
|
||||
请回答 (格式: 1a 2b):
|
||||
```
|
||||
|
||||
**User Input Examples**:
|
||||
- `1a 2a` → Conflict 1: 渐进式迁移, Conflict 2: 添加迁移脚本
|
||||
- `1b 2b` → Conflict 1: 完全重写, Conflict 2: 跳过
|
||||
- `1c 2c` → Both skipped
|
||||
|
||||
### Phase 4: Apply Modifications
|
||||
|
||||
```javascript
|
||||
@@ -290,7 +327,7 @@ return {
|
||||
**Validation**:
|
||||
```
|
||||
✓ Agent returns valid JSON structure
|
||||
✓ AskUserQuestion displays all conflicts (max 4)
|
||||
✓ Text output displays all conflicts (max 10 per round)
|
||||
✓ User selections captured correctly
|
||||
✓ Edit tool successfully applies modifications
|
||||
✓ guidance-specification.md updated
|
||||
@@ -310,7 +347,7 @@ return {
|
||||
### Key Requirements
|
||||
| Requirement | Details |
|
||||
|------------|---------|
|
||||
| **Conflict limit** | Max 4 conflicts (AskUserQuestion tool limit) |
|
||||
| **Conflict batching** | Max 10 conflicts per round (no total limit) |
|
||||
| **Strategy count** | 2-4 strategies per conflict |
|
||||
| **Modifications** | Each strategy includes file paths, old_content, new_content |
|
||||
| **User-facing text** | Chinese (brief, strategy names, pros/cons) |
|
||||
@@ -338,7 +375,7 @@ return {
|
||||
```
|
||||
If Edit tool fails mid-application:
|
||||
1. Log all successfully applied modifications
|
||||
2. Offer rollback option via AskUserQuestion
|
||||
2. Output rollback option via text interaction
|
||||
3. If rollback selected: restore files from git or backups
|
||||
4. If continue: mark partial resolution in context-package.json
|
||||
```
|
||||
@@ -359,15 +396,15 @@ If Edit tool fails mid-application:
|
||||
- NO report file generation
|
||||
|
||||
**User Interaction**:
|
||||
- AskUserQuestion for strategy selection (max 4 conflicts)
|
||||
- Text-based strategy selection (max 10 conflicts per round)
|
||||
- Each conflict: 2-4 strategy options + "跳过" option
|
||||
|
||||
### Success Criteria
|
||||
```
|
||||
✓ CLI analysis returns valid JSON structure
|
||||
✓ Max 4 conflicts presented (tool limit)
|
||||
✓ Conflicts presented in batches (max 10 per round)
|
||||
✓ Min 2 strategies per conflict with modifications
|
||||
✓ AskUserQuestion displays all conflicts correctly
|
||||
✓ Text output displays all conflicts correctly
|
||||
✓ User selections captured and processed
|
||||
✓ Edit tool applies modifications successfully
|
||||
✓ guidance-specification.md updated with resolved conflicts
|
||||
|
||||
@@ -49,6 +49,7 @@ Autonomous task JSON and IMPL_PLAN.md generation using action-planning-agent wit
|
||||
"synthesis_output": {"path": "...", "exists": true},
|
||||
"conflict_resolution": {"path": "...", "exists": true} // if conflict_risk >= medium
|
||||
},
|
||||
"context_package_path": ".workflow/{session-id}/.process/context-package.json",
|
||||
"context_package": {
|
||||
// If in memory: use cached content
|
||||
// Else: Load from .workflow/{session-id}/.process/context-package.json
|
||||
@@ -336,9 +337,11 @@ const agentContext = {
|
||||
? memory.get("workflow-session.json")
|
||||
: Read(.workflow/WFS-[id]/workflow-session.json),
|
||||
|
||||
context_package_path: ".workflow/WFS-[id]/.process/context-package.json",
|
||||
|
||||
context_package: memory.has("context-package.json")
|
||||
? memory.get("context-package.json")
|
||||
: Read(.workflow/WFS-[id]/.process/context-package.json),
|
||||
: Read(".workflow/WFS-[id]/.process/context-package.json"),
|
||||
|
||||
// Extract brainstorm artifacts from context package
|
||||
brainstorm_artifacts: extractBrainstormArtifacts(context_package),
|
||||
|
||||
@@ -134,6 +134,7 @@ For each feature, generate task(s) with ID format:
|
||||
"id": "IMPL-N", // Task identifier
|
||||
"title": "Feature description with TDD", // Human-readable title
|
||||
"status": "pending", // pending | in_progress | completed | container
|
||||
"context_package_path": ".workflow/{session-id}/.process/context-package.json", // Path to smart context package
|
||||
"meta": {
|
||||
"type": "feature", // Task type
|
||||
"agent": "@code-developer", // Assigned agent
|
||||
@@ -259,6 +260,7 @@ identifier: WFS-{session-id}
|
||||
source: "User requirements" | "File: path"
|
||||
conflict_resolution: .workflow/{session-id}/.process/CONFLICT_RESOLUTION.md # if exists
|
||||
context_package: .workflow/{session-id}/.process/context-package.json
|
||||
context_package_path: .workflow/{session-id}/.process/context-package.json
|
||||
test_context: .workflow/{session-id}/.process/test-context-package.json # if exists
|
||||
workflow_type: "tdd"
|
||||
verification_history:
|
||||
@@ -411,6 +413,7 @@ Update workflow-session.json with TDD metadata:
|
||||
├── CONFLICT_RESOLUTION.md # Conflict resolution strategies (if conflict_risk ≥ medium)
|
||||
├── test-context-package.json # Test coverage analysis
|
||||
├── context-package.json # Input from context-gather
|
||||
├── context_package_path # Path to smart context package
|
||||
└── green-fix-iteration-*.md # Fix logs from Green phase test-fix cycles
|
||||
```
|
||||
|
||||
|
||||
@@ -173,6 +173,7 @@ This enhanced 5-field schema embeds all necessary context, artifacts, and execut
|
||||
"id": "IMPL-N[.M]",
|
||||
"title": "Descriptive task name",
|
||||
"status": "pending|active|completed|blocked|container",
|
||||
"context_package_path": ".workflow/WFS-[session]/.process/context-package.json",
|
||||
"meta": {
|
||||
"type": "feature|bugfix|refactor|test-gen|test-fix|docs",
|
||||
"agent": "@code-developer|@test-fix-agent|@universal-executor",
|
||||
@@ -193,11 +194,6 @@ This enhanced 5-field schema embeds all necessary context, artifacts, and execut
|
||||
"priority": "highest",
|
||||
"usage": "Role-specific requirements, design specs, enhanced by synthesis. Paths loaded dynamically from context-package.json (supports multiple files per role: analysis.md, analysis-01.md, analysis-api.md, etc.). Common roles: product-manager, system-architect, ui-designer, data-architect, ux-expert."
|
||||
},
|
||||
{
|
||||
"path": ".workflow/WFS-[session]/.process/context-package.json",
|
||||
"priority": "critical",
|
||||
"usage": "Smart context with focus paths, module structure, dependency graph, existing patterns, tech stack. Use for: environment setup, dependency resolution, pattern discovery, conflict detection results"
|
||||
},
|
||||
{
|
||||
"path": ".workflow/WFS-[session]/.brainstorming/guidance-specification.md",
|
||||
"priority": "high",
|
||||
@@ -210,8 +206,9 @@ This enhanced 5-field schema embeds all necessary context, artifacts, and execut
|
||||
{
|
||||
"step": "load_context_package",
|
||||
"action": "Load context package for artifact paths",
|
||||
"note": "Context package path is now at top-level field: context_package_path",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-[session]/.process/context-package.json)"
|
||||
"Read({{context_package_path}})"
|
||||
],
|
||||
"output_to": "context_package",
|
||||
"on_error": "fail"
|
||||
@@ -221,7 +218,7 @@ This enhanced 5-field schema embeds all necessary context, artifacts, and execut
|
||||
"action": "Load role analyses from context-package.json (supports multiple files per role)",
|
||||
"note": "Paths loaded from context-package.json → brainstorm_artifacts.role_analyses[]. Supports analysis*.md automatically.",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-[session]/.process/context-package.json)",
|
||||
"Read({{context_package_path}})",
|
||||
"Extract(brainstorm_artifacts.role_analyses[].files[].path)",
|
||||
"Read(each extracted path)"
|
||||
],
|
||||
@@ -231,9 +228,9 @@ This enhanced 5-field schema embeds all necessary context, artifacts, and execut
|
||||
{
|
||||
"step": "load_planning_context",
|
||||
"action": "Load plan-generated context intelligence with resolved conflicts",
|
||||
"note": "CRITICAL: context-package.json provides smart context (focus paths, dependencies, patterns) and conflict resolution status. If conflict_risk was medium/high, conflicts have been resolved in guidance-specification.md and role analyses.",
|
||||
"note": "CRITICAL: context-package.json (from context_package_path) provides smart context (focus paths, dependencies, patterns) and conflict resolution status. If conflict_risk was medium/high, conflicts have been resolved in guidance-specification.md and role analyses.",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-[session]/.process/context-package.json)",
|
||||
"Read({{context_package_path}})",
|
||||
"Read(.workflow/WFS-[session]/.brainstorming/guidance-specification.md)"
|
||||
],
|
||||
"output_to": "planning_context",
|
||||
@@ -403,7 +400,7 @@ Role analyses provide specialized perspectives on the implementation:
|
||||
- **topic-framework.md**: Role-specific discussion points and analysis framework
|
||||
|
||||
**Artifact Priority in Development**:
|
||||
1. context-package.json (primary source: smart context AND brainstorm artifact catalog in `brainstorm_artifacts` + conflict_risk status)
|
||||
1. {context_package_path} (primary source: smart context AND brainstorm artifact catalog in `brainstorm_artifacts` + conflict_risk status)
|
||||
2. role/analysis*.md (paths from context-package.json: requirements, design specs, enhanced by synthesis, with resolved conflicts if any)
|
||||
3. guidance-specification.md (path from context-package.json: finalized decisions with resolved conflicts if any)
|
||||
|
||||
@@ -592,8 +589,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
|
||||
**Key Points**:
|
||||
- **Sequential Steps**: Steps execute in order defined in `implementation_approach` array
|
||||
- **Context Delivery**: Each codex command receives context via CONTEXT field: `@.workflow/WFS-session/.process/context-package.json` (role analyses loaded dynamically from context package)
|
||||
- **Multi-Step Tasks**: First step provides full context, subsequent steps use `resume --last` to maintain session continuity
|
||||
- **Context Delivery**: Each codex command receives context via CONTEXT field: `@{context_package_path}` (role analyses loaded dynamically from context package)- **Multi-Step Tasks**: First step provides full context, subsequent steps use `resume --last` to maintain session continuity
|
||||
- **Step Dependencies**: Later steps reference outputs from earlier steps via `depends_on` field
|
||||
|
||||
### Example 1: Agent Mode - Simple Task (Default, No Command)
|
||||
@@ -601,6 +597,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
{
|
||||
"id": "IMPL-001",
|
||||
"title": "Implement user authentication module",
|
||||
"context_package_path": ".workflow/WFS-session/.process/context-package.json",
|
||||
"context": {
|
||||
"depends_on": [],
|
||||
"focus_paths": ["src/auth"],
|
||||
@@ -617,7 +614,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
"step": "load_role_analyses",
|
||||
"action": "Load role analyses from context-package.json",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-session/.process/context-package.json)",
|
||||
"Read({{context_package_path}})",
|
||||
"Extract(brainstorm_artifacts.role_analyses[].files[].path)",
|
||||
"Read(each extracted path)"
|
||||
],
|
||||
@@ -627,7 +624,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
{
|
||||
"step": "load_context",
|
||||
"action": "Load context package for project structure",
|
||||
"commands": ["Read(.workflow/WFS-session/.process/context-package.json)"],
|
||||
"commands": ["Read({{context_package_path}})"],
|
||||
"output_to": "context_pkg",
|
||||
"on_error": "fail"
|
||||
}
|
||||
@@ -662,6 +659,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
{
|
||||
"id": "IMPL-002",
|
||||
"title": "Implement user authentication module",
|
||||
"context_package_path": ".workflow/WFS-session/.process/context-package.json",
|
||||
"context": {
|
||||
"depends_on": [],
|
||||
"focus_paths": ["src/auth"],
|
||||
@@ -674,7 +672,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
"step": "load_role_analyses",
|
||||
"action": "Load role analyses from context-package.json",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-session/.process/context-package.json)",
|
||||
"Read({{context_package_path}})",
|
||||
"Extract(brainstorm_artifacts.role_analyses[].files[].path)",
|
||||
"Read(each extracted path)"
|
||||
],
|
||||
@@ -687,7 +685,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
"step": 1,
|
||||
"title": "Implement authentication with Codex",
|
||||
"description": "Create JWT-based authentication module",
|
||||
"command": "bash(codex -C src/auth --full-auto exec \"PURPOSE: Implement user authentication TASK: JWT-based auth with login/registration MODE: auto CONTEXT: @.workflow/WFS-session/.process/context-package.json EXPECTED: Complete auth module with tests RULES: Load role analyses from context-package.json → brainstorm_artifacts\" --skip-git-repo-check -s danger-full-access)",
|
||||
"command": "bash(codex -C src/auth --full-auto exec \"PURPOSE: Implement user authentication TASK: JWT-based auth with login/registration MODE: auto CONTEXT: @{{context_package_path}} EXPECTED: Complete auth module with tests RULES: Load role analyses from context-package.json → brainstorm_artifacts\" --skip-git-repo-check -s danger-full-access)",
|
||||
"modification_points": ["Create auth service", "Implement endpoints", "Add JWT middleware"],
|
||||
"logic_flow": ["Validate credentials", "Generate JWT", "Return token"],
|
||||
"depends_on": [],
|
||||
@@ -704,6 +702,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
{
|
||||
"id": "IMPL-003",
|
||||
"title": "Implement role-based access control",
|
||||
"context_package_path": ".workflow/WFS-session/.process/context-package.json",
|
||||
"context": {
|
||||
"depends_on": ["IMPL-002"],
|
||||
"focus_paths": ["src/auth", "src/middleware"],
|
||||
@@ -716,7 +715,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
"step": "load_context",
|
||||
"action": "Load context and role analyses from context-package.json",
|
||||
"commands": [
|
||||
"Read(.workflow/WFS-session/.process/context-package.json)",
|
||||
"Read({{context_package_path}})",
|
||||
"Extract(brainstorm_artifacts.role_analyses[].files[].path)",
|
||||
"Read(each extracted path)"
|
||||
],
|
||||
@@ -729,7 +728,7 @@ When using `--cli-execute`, each step in `implementation_approach` includes a `c
|
||||
"step": 1,
|
||||
"title": "Create RBAC models",
|
||||
"description": "Define role and permission data models",
|
||||
"command": "bash(codex -C src/auth --full-auto exec \"PURPOSE: Create RBAC models TASK: Role and permission models MODE: auto CONTEXT: @.workflow/WFS-session/.process/context-package.json EXPECTED: Models with migrations RULES: Load role analyses from context-package.json → brainstorm_artifacts\" --skip-git-repo-check -s danger-full-access)",
|
||||
"command": "bash(codex -C src/auth --full-auto exec \"PURPOSE: Create RBAC models TASK: Role and permission models MODE: auto CONTEXT: @{{context_package_path}} EXPECTED: Models with migrations RULES: Load role analyses from context-package.json → brainstorm_artifacts\" --skip-git-repo-check -s danger-full-access)",
|
||||
"modification_points": ["Define role model", "Define permission model", "Create migrations"],
|
||||
"logic_flow": ["Design schema", "Implement models", "Generate migrations"],
|
||||
"depends_on": [],
|
||||
|
||||
Reference in New Issue
Block a user