@zeyue0329/xiaoma-cli 1.8.0 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +93 -0
- package/package.json +1 -1
- package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md +54 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md +6 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md +13 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-03-validate-story.md +3 -1
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-04-develop-story.md +14 -7
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-05-code-review.md +2 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-06-test-story.md +111 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md +109 -0
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md +2 -2
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md +3 -0
- package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +3 -1
- package/tools/cli/installers/install-messages.yaml +1 -31
- package/tools/cli/installers/lib/ide/templates/combined/gemini-task.toml +2 -2
- package/tools/cli/installers/lib/ide/templates/combined/gemini-tool.toml +2 -2
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow-yaml.toml +1 -1
- package/tools/cli/installers/lib/ide/templates/combined/gemini-workflow.toml +1 -1
- package/tools/cli/lib/cli-utils.js +7 -7
- package/pipeline-optimization-report.md +0 -455
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
XiaoMa-CLI (`@zeyue0329/xiaoma-cli`) is an AI-driven agile development framework/CLI tool. It installs specialized AI agent personas, workflows, and skills into a user's project directory for use with AI IDEs (Claude Code, Cursor, etc.). Node.js v20+ required.
|
|
8
|
+
|
|
9
|
+
## Common Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Quality gate (run before commits)
|
|
13
|
+
npm run quality
|
|
14
|
+
|
|
15
|
+
# Individual checks
|
|
16
|
+
npm run test:schemas # Agent YAML schema validation (Zod-based)
|
|
17
|
+
npm run test:install # Installation component tests
|
|
18
|
+
npm run test:refs # Cross-file reference validation
|
|
19
|
+
npm run validate:schemas # Schema validation (separate from test)
|
|
20
|
+
npm run validate:refs # File reference validation (strict mode)
|
|
21
|
+
npm run lint # ESLint (JS + YAML), zero warnings allowed
|
|
22
|
+
npm run lint:md # Markdown linting
|
|
23
|
+
npm run format:check # Prettier check
|
|
24
|
+
npm run format:fix # Prettier auto-fix
|
|
25
|
+
|
|
26
|
+
# Test coverage
|
|
27
|
+
npm run test:coverage # c8 coverage report for schema tests
|
|
28
|
+
|
|
29
|
+
# Run the CLI locally
|
|
30
|
+
npm run install:xiaoma # Run install command
|
|
31
|
+
npm run xiaoma:uninstall # Run uninstall command
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The full `npm test` runs: test:schemas → test:refs → test:install → validate:schemas → lint → lint:md → format:check.
|
|
35
|
+
|
|
36
|
+
## Architecture
|
|
37
|
+
|
|
38
|
+
### Two-Layer Structure
|
|
39
|
+
|
|
40
|
+
1. **`src/`** — Content modules (YAML agents, Markdown workflows, skills)
|
|
41
|
+
2. **`tools/`** — CLI implementation (Node.js/CommonJS, installer, validators)
|
|
42
|
+
|
|
43
|
+
### Module System
|
|
44
|
+
|
|
45
|
+
Modules are defined by `module.yaml` files with configuration variables, prompts, and directory declarations:
|
|
46
|
+
- **`src/core/`** — Shared skills and tasks (module code: `core`)
|
|
47
|
+
- **`src/xmc/`** — XiaoMa Method module, the primary agile framework (module code: `xmc`)
|
|
48
|
+
|
|
49
|
+
### Agent System (`src/xmc/agents/`)
|
|
50
|
+
|
|
51
|
+
Agents are YAML files validated against a Zod schema (`tools/schema/`). Each agent defines:
|
|
52
|
+
- `metadata` — id, name, title, icon, module, capabilities
|
|
53
|
+
- `persona` — role, identity, communication_style, principles
|
|
54
|
+
- `menu` — trigger commands pointing to workflow exec targets
|
|
55
|
+
- `prompts` / `critical_actions` — optional
|
|
56
|
+
|
|
57
|
+
### Workflow System (`src/xmc/workflows/`)
|
|
58
|
+
|
|
59
|
+
Organized by development phase:
|
|
60
|
+
- `1-analysis/` — Brainstorming, research, product brief
|
|
61
|
+
- `2-plan-workflows/` — PRD creation/validation, UX design
|
|
62
|
+
- `3-solutioning/` — Architecture, epics/stories, implementation readiness
|
|
63
|
+
- `4-implementation/` — Sprint planning, story execution, code review, retros
|
|
64
|
+
|
|
65
|
+
Each workflow has: `workflow.md` (entry point with metadata), `steps/` or `steps-{variant}/` directories, and optional `templates/` and `data/` directories.
|
|
66
|
+
|
|
67
|
+
### CLI (`tools/cli/`)
|
|
68
|
+
|
|
69
|
+
- **Entry**: `xiaoma-cli.js` (Commander.js) → wrapped by `xiaoma-npx-wrapper.js`
|
|
70
|
+
- **Commands**: `install`, `status`, `uninstall`
|
|
71
|
+
- **Installer** (`tools/cli/installers/`): Core orchestration class (~8K LOC), module manager, IDE config manager, manifest generator
|
|
72
|
+
- **UI**: `@clack/prompts` for interactive terminal prompts
|
|
73
|
+
|
|
74
|
+
### Skills (`src/core/skills/`)
|
|
75
|
+
|
|
76
|
+
Reusable capabilities: `xiaoma-help`, `xiaoma-brainstorming`, `xiaoma-distillator`, `xiaoma-party-mode`, editorial review skills, etc.
|
|
77
|
+
|
|
78
|
+
## Code Conventions
|
|
79
|
+
|
|
80
|
+
- **JS**: CommonJS (`require`/`module.exports`) for all CLI/tool code
|
|
81
|
+
- **YAML**: `.yaml` extension enforced by ESLint (not `.yml`); double quotes preferred
|
|
82
|
+
- **Formatting**: Prettier with 140 char print width, 2-space indent, double quotes in YAML, single quotes in JS
|
|
83
|
+
- **Linting**: ESLint flat config with unicorn, node, yml plugins; `--max-warnings=0`
|
|
84
|
+
- **Schema validation**: Zod for agent YAML validation at `tools/schema/`
|
|
85
|
+
- **Git hooks**: Husky + lint-staged (runs lint:fix and format:fix on staged files)
|
|
86
|
+
|
|
87
|
+
## Testing
|
|
88
|
+
|
|
89
|
+
Tests are plain Node.js scripts (no test framework), located in `test/`:
|
|
90
|
+
- `test-agent-schema.js` — Validates all agent YAML against Zod schema; 50 fixtures (18 valid, 32 invalid); targets 100% coverage
|
|
91
|
+
- `test-installation-components.js` — Installation flow verification
|
|
92
|
+
- `test-file-refs-csv.js` — Validates cross-file references in CSV data files
|
|
93
|
+
- Fixtures in `test/fixtures/agent-schema/{valid,invalid}/`
|
package/package.json
CHANGED
package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md
CHANGED
|
@@ -47,7 +47,7 @@ Invoke the `xiaoma-validate-prd` skill to validate the PRD.
|
|
|
47
47
|
**CRITICAL PIPELINE MODE INSTRUCTIONS:**
|
|
48
48
|
|
|
49
49
|
- This is running in **automated pipeline mode** — do NOT pause for user input
|
|
50
|
-
- The validate-prd workflow has
|
|
50
|
+
- The validate-prd workflow has 14 step files in `steps-v/` (step-v-02b is a conditional branch for specific PRD format detection scenarios): step-v-01-discovery, step-v-02-format-detection, step-v-02b-parity-check, step-v-03-density-validation, step-v-04-brief-coverage, step-v-05-measurability, step-v-06-traceability, step-v-07-implementation-leakage, step-v-08-domain-compliance, step-v-09-project-type, step-v-10-smart, step-v-11-holistic-quality, step-v-12-completeness, step-v-13-report-complete
|
|
51
51
|
- The workflow begins with discovery-based structure extraction (step-v-01) before validation
|
|
52
52
|
- When ANY step presents a menu (Continue/Fix/Skip options), automatically select **Continue** unless critical issues are detected
|
|
53
53
|
- When validation identifies issues, automatically fix them in the PRD
|
|
@@ -104,3 +104,56 @@ For each iteration:
|
|
|
104
104
|
- Introducing new issues while fixing existing ones
|
|
105
105
|
- Not properly delegating to validate-prd workflow
|
|
106
106
|
- Stopping to ask user for input
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 阻断性问题检查清单 (Validation Blockers Checklist)
|
|
111
|
+
|
|
112
|
+
以下条件**必须全部通过** — 任何一个失败都阻断进度到step-06:
|
|
113
|
+
|
|
114
|
+
- [ ] **Functional Requirements Traceability**: 所有Story都可追溯到原始需求文档
|
|
115
|
+
- [ ] **Technical Feasibility**: 提议的技术栈和架构在给定时间线内可实现
|
|
116
|
+
- [ ] **Business Value Definition**: 每个Epic至少有一个明确的业务价值主张
|
|
117
|
+
- [ ] **Acceptance Criteria Clarity**: 所有Acceptance criteria都是SMART格式 (Specific, Measurable, Achievable, Relevant, Time-bound)
|
|
118
|
+
- [ ] **Cross-Team Dependencies**: 跨team和component的所有依赖已识别、优先级排序、可协调
|
|
119
|
+
- [ ] **Performance & Scalability**: 性能目标和可扩展性要求明确量化
|
|
120
|
+
- [ ] **Security Review**: 安全审查已完成,没有Critical或Unmitigated issues
|
|
121
|
+
- [ ] **Compliance & Legal**: 任何合规性要求(数据保护、行业标准等)都已纳入Story
|
|
122
|
+
|
|
123
|
+
## 验证通过标准 (Validation Pass Criteria)
|
|
124
|
+
|
|
125
|
+
PRD验证通过的充要条件:
|
|
126
|
+
|
|
127
|
+
1. ✅ 所有Blockers都已检查且通过
|
|
128
|
+
2. ✅ 没有超过3个Medium优先级未解决的issues
|
|
129
|
+
3. ✅ 所有Critical issues都有明确的Mitigation计划
|
|
130
|
+
4. ✅ PM (John) 和至少一个stakeholder已同意
|
|
131
|
+
5. ✅ 文档质量评分 >= 85%
|
|
132
|
+
6. ✅ Story计数 >= 5个 (如果目标是正常sprint)
|
|
133
|
+
|
|
134
|
+
## 如果验证失败后超过3次迭代 (Beyond 3 Iterations Escalation)
|
|
135
|
+
|
|
136
|
+
**步骤:**
|
|
137
|
+
|
|
138
|
+
1. 生成详细的"Unresolved Issues Report",按优先级分类
|
|
139
|
+
2. 对于仍未解决的**Critical issues**:
|
|
140
|
+
- 立即通知Winston (Architect) 进行架构审查
|
|
141
|
+
- 可能需要回到 **step-03-architecture-analysis** 重新评估技术可行性
|
|
142
|
+
3. 对于**Major issues**:
|
|
143
|
+
- John尝试通过PRD微调来修复
|
|
144
|
+
- 如果无法修复,escalate至PM决策
|
|
145
|
+
4. **决策选项**:
|
|
146
|
+
- A) 接受已识别的风险,添加mitigation计划到backlog
|
|
147
|
+
- B) 修改scope以移除有问题的Story
|
|
148
|
+
- C) 延迟到下一个iteration,回到step-04重新生成PRD
|
|
149
|
+
- D) 停止管道,等待manual intervention
|
|
150
|
+
|
|
151
|
+
**Escalation Notification Template:**
|
|
152
|
+
```
|
|
153
|
+
PRD Validation Status: FAILED AFTER 3 ITERATIONS
|
|
154
|
+
Blocking Story Count: [X]
|
|
155
|
+
Critical Issues: [list]
|
|
156
|
+
Proposed Resolution: [A/B/C/D]
|
|
157
|
+
Escalation To: [PM/Architect/Stakeholder]
|
|
158
|
+
Timeline Impact: [days]
|
|
159
|
+
```
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md
CHANGED
|
@@ -27,6 +27,11 @@ Check that the following required artifacts exist:
|
|
|
27
27
|
3. **Planning Artifacts** — At least one of `{planning_artifacts}/*prd*.md` or `{planning_artifacts}/*architecture*.md` should exist
|
|
28
28
|
- If missing: Output warning but continue — "Planning documents not found. Story creation may have limited context."
|
|
29
29
|
|
|
30
|
+
4. **Requirements Pipeline Status** *(Optional — recommended check)* — If `{planning_artifacts}/pipeline-status.json` exists, read it and verify the `status` field equals "complete"
|
|
31
|
+
- If file exists AND `status` != "complete": Output WARNING — "pipeline-status.json found but requirements pipeline did not complete successfully (status: {status}). Story pipeline may proceed, but planning artifacts may be incomplete. Consider rerunning AR (Auto Requirements) first."
|
|
32
|
+
- If file does not exist: Output INFO — "pipeline-status.json not found. Assuming planning was done outside auto-requirements-pipeline. Continuing."
|
|
33
|
+
- *(Note: This is a non-blocking check. The pipeline continues regardless — it is informational only, to prevent silently working from incomplete requirements.)*
|
|
34
|
+
|
|
30
35
|
### 2. Analyze Sprint Status
|
|
31
36
|
|
|
32
37
|
1. Load the FULL file: `{sprint_status}`
|
|
@@ -108,7 +113,7 @@ If `{current_story_key}` was provided via resume (user specified a specific stor
|
|
|
108
113
|
For stories with status == "in-progress", verify minimum work has begun:
|
|
109
114
|
|
|
110
115
|
1. Read the story file at `{current_story_path}`
|
|
111
|
-
2. Count completed tasks: look for `[x]` markers in Tasks/Subtasks section
|
|
116
|
+
2. Count completed tasks: look for `[x]`, `[X]`, or `[✓]` markers in Tasks/Subtasks section (case-insensitive match — any of these formats indicate a completed task)
|
|
112
117
|
3. If completed_tasks == 0:
|
|
113
118
|
- Output WARNING: "Story {current_story_key} is marked in-progress but has no completed tasks. This may indicate an abandoned development session."
|
|
114
119
|
- Recommend: "Consider resetting to 'ready-for-dev' if development was not actually started."
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
name: "step-02-create-story"
|
|
3
3
|
description: "Create the user story using SM role, delegating to create-story workflow logic"
|
|
4
4
|
nextStepFile: "./step-03-validate-story.md"
|
|
5
|
+
input_variables:
|
|
6
|
+
- "epic_key"
|
|
7
|
+
- "story_template"
|
|
8
|
+
- "batch_mode"
|
|
9
|
+
output_variables:
|
|
10
|
+
- "created_story"
|
|
11
|
+
- "story_details"
|
|
12
|
+
- "story_metadata"
|
|
5
13
|
---
|
|
6
14
|
|
|
7
15
|
# Step 2 of 9: Create User Story
|
|
@@ -58,8 +66,11 @@ Key parameters to pass:
|
|
|
58
66
|
|
|
59
67
|
After create-story workflow completes:
|
|
60
68
|
1. Verify story file exists at expected path
|
|
61
|
-
2. Verify story
|
|
62
|
-
|
|
69
|
+
2. Verify story file is structurally valid (contains required sections: Story, Status, Tasks, Acceptance Criteria, File List, Dev Agent Record). If sections are missing or malformed:
|
|
70
|
+
- Output WARNING — "Story file created but appears incomplete. Missing sections: {section_list}. Re-running create-story workflow."
|
|
71
|
+
- Retry the workflow (max 2 attempts) or HALT if retries exhausted
|
|
72
|
+
3. Verify story status is "ready-for-dev"
|
|
73
|
+
4. Store `{current_story_path}` = path to the created story file
|
|
63
74
|
|
|
64
75
|
If creation failed:
|
|
65
76
|
- HALT — "Story creation failed for {current_story_key}. Check planning artifacts and retry."
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-03-validate-story.md
CHANGED
|
@@ -25,6 +25,8 @@ Adopt the PM persona:
|
|
|
25
25
|
|
|
26
26
|
1. Read the COMPLETE story file at `{current_story_path}`
|
|
27
27
|
2. Parse all sections: Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Status
|
|
28
|
+
3. Initialize validation counter: Set `{validation_attempt}` = 1
|
|
29
|
+
*(Initialize here — before the validation loop begins — so repeated loop iterations (section 3 → section 4 → loop back to section 3) do NOT accidentally reset the counter on re-entry to section 4.)*
|
|
28
30
|
|
|
29
31
|
### 3. Execute 10-Step Validation
|
|
30
32
|
|
|
@@ -43,7 +45,7 @@ Perform the following validation checks:
|
|
|
43
45
|
|
|
44
46
|
### 4. Analyze Validation Results
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
*(Note: `{validation_attempt}` was initialized to 1 in section 2. Do NOT reset it here — this section may be re-entered during the fix-and-retry loop.)*
|
|
47
49
|
|
|
48
50
|
**IF validation report = GO (readiness score >= 7/10):**
|
|
49
51
|
- Record validation in story file (see section 4.5)
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-04-develop-story.md
CHANGED
|
@@ -17,11 +17,18 @@ nextStepFile: "./step-05-code-review.md"
|
|
|
17
17
|
### 1. Switch to Dev Role
|
|
18
18
|
|
|
19
19
|
Adopt the Dev persona:
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
20
|
+
- **Name:** Amelia
|
|
21
|
+
- **Title:** Elite Full-Stack Developer
|
|
22
|
+
- **Core Purpose:** Transform story requirements into production-ready code through TDD (red-green-refactor cycle), comprehensive testing, and meticulous task completion
|
|
23
|
+
- **Communication Style:** Crisp, code-focused, evidence-driven. Every pull request is accompanied by passing tests and clear commit messages
|
|
24
|
+
- **Key Behaviors:**
|
|
25
|
+
- Follow existing patterns and conventions from the codebase (identified in Step 3 architecture analysis)
|
|
26
|
+
- Ship clean, tested code incrementally
|
|
27
|
+
- Run full test suite after each task
|
|
28
|
+
- Every response moves the project forward with measurable progress
|
|
29
|
+
- Execute ALL steps in exact order — do NOT skip steps
|
|
30
|
+
- Absolutely DO NOT stop because of "milestones" or "significant progress" — continue until ALL tasks are complete
|
|
31
|
+
- **Quality Gate:** All tasks must be marked [x], [X], or [✓] (case-insensitive) with corresponding tests passing before considering any task "done"
|
|
25
32
|
|
|
26
33
|
### 2. Execute Story Development
|
|
27
34
|
|
|
@@ -46,8 +53,8 @@ Key parameters to pass:
|
|
|
46
53
|
### 3. Verify Development Output
|
|
47
54
|
|
|
48
55
|
After dev-story workflow completes:
|
|
49
|
-
1. Re-read the story file at `{current_story_path}`
|
|
50
|
-
2. Verify ALL tasks and subtasks are marked [x] — including any `[AI-Review]` prefixed tasks from prior code review
|
|
56
|
+
1. Re-read the story file at `{current_story_path}` (fresh read from disk to catch any updates during dev workflow execution)
|
|
57
|
+
2. Verify ALL tasks and subtasks are marked [x], [X], or [✓] (case-insensitive) — including any `[AI-Review]` prefixed tasks from prior code review
|
|
51
58
|
3. Verify story status is "review"
|
|
52
59
|
4. Verify sprint-status.yaml reflects "review" for `{current_story_key}`
|
|
53
60
|
5. Verify that tests actually exist for all implemented features (not just task checkboxes)
|
|
@@ -56,11 +56,11 @@ Key parameters to pass:
|
|
|
56
56
|
**IF all HIGH and MEDIUM issues are fixed AND all ACs are implemented:**
|
|
57
57
|
- Set story status to "review" (ready for QA)
|
|
58
58
|
- Output: "Code review complete. All critical issues resolved. Proceeding to QA testing."
|
|
59
|
-
- **NEXT:** Proceed to step-06 (test story)
|
|
59
|
+
- **NEXT:** Proceed to step-06 (test story) [frontmatter: nextStepFile]
|
|
60
60
|
|
|
61
61
|
**IF there are remaining HIGH or MEDIUM issues that could not be auto-fixed:**
|
|
62
62
|
- Output the unresolved issues
|
|
63
|
-
- **NEXT:** Proceed to step-07 (fix and retest) to address remaining issues
|
|
63
|
+
- **NEXT:** Proceed to step-07 (fix and retest) to address remaining issues [frontmatter: nextStepFile_issues]
|
|
64
64
|
|
|
65
65
|
### 5. Pipeline Status Update
|
|
66
66
|
|
|
@@ -103,12 +103,13 @@ Create a test results summary:
|
|
|
103
103
|
|
|
104
104
|
**IF all ACs pass AND no HIGH severity issues:**
|
|
105
105
|
- Output: "QA testing PASSED. All {ac_count} acceptance criteria verified with real data. Proceeding to completion."
|
|
106
|
-
- **NEXT:** Proceed to step-08 (complete story)
|
|
106
|
+
- **NEXT:** Proceed to step-08 (complete story) [frontmatter: nextStepFile]
|
|
107
107
|
|
|
108
108
|
**IF any AC fails OR HIGH severity issues found:**
|
|
109
109
|
- Output: "QA testing FAILED. {ac_fail_count} acceptance criteria not met. Issues: {issue_list}"
|
|
110
110
|
- Record test failures in story file under QA Results section
|
|
111
|
-
-
|
|
111
|
+
- Set `{fix_source}` = "qa-testing" (this variable will be used in step-07 to route fixes directly to step-08 after correction, since QA issues often don't require code review re-entry)
|
|
112
|
+
- **NEXT:** Proceed to step-07 (fix and retest) [frontmatter: nextStepFile_fail]
|
|
112
113
|
|
|
113
114
|
### 7. Pipeline Status Update
|
|
114
115
|
|
|
@@ -142,3 +143,111 @@ Create a test results summary:
|
|
|
142
143
|
- Skipping acceptance criteria during testing
|
|
143
144
|
- Not verifying database state after write operations
|
|
144
145
|
- Marking tests as PASS without evidence
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## 测试失败处理流程 (Test Failure Handling)
|
|
150
|
+
|
|
151
|
+
**当任何acceptance criteria失败时:**
|
|
152
|
+
|
|
153
|
+
### 1. 失败分类 (Categorize Failures)
|
|
154
|
+
|
|
155
|
+
对每个失败进行分类:
|
|
156
|
+
|
|
157
|
+
- **Type A - AC Failure (接受标准失败)**: 核心功能没有达到预期
|
|
158
|
+
- 示例: 应该返回值X,实际返回值Y
|
|
159
|
+
- 路由: → step-07 (fix-and-retest)
|
|
160
|
+
|
|
161
|
+
- **Type B - Data Integrity Issue (数据完整性问题)**: 数据库状态不正确
|
|
162
|
+
- 示例: 记录未保存或数据损坏
|
|
163
|
+
- 路由: → step-07 (fix-and-retest) 并标记为HIGH优先级
|
|
164
|
+
|
|
165
|
+
- **Type C - Performance Issue (性能问题)**: 功能正常但超过性能阈值
|
|
166
|
+
- 示例: API响应时间 > 2秒
|
|
167
|
+
- 路由: → step-07 (fix-and-retest) 但标记为MEDIUM优先级
|
|
168
|
+
|
|
169
|
+
- **Type D - Environment/Test Setup Issue (环境问题)**: 测试环境配置问题
|
|
170
|
+
- 示例: 数据库连接失败、假数据缺失
|
|
171
|
+
- 路由: → 修复测试环境,然后重新运行tests
|
|
172
|
+
|
|
173
|
+
### 2. 重试策略 (Retry Strategy)
|
|
174
|
+
|
|
175
|
+
**对于Type A和B失败:**
|
|
176
|
+
- 在step-07中作为HIGH优先级修复
|
|
177
|
+
- 每个Type A/B失败最多重试1次在step-06(re-run tests)
|
|
178
|
+
|
|
179
|
+
**对于Type C失败(仅性能):**
|
|
180
|
+
- 如果只有Type C失败,可以有条件地PASS
|
|
181
|
+
- 但必须在story文件中记录性能问题
|
|
182
|
+
- 标记为"KNOWN_PERFORMANCE_ISSUE"
|
|
183
|
+
- 移至backlog作为future optimization
|
|
184
|
+
- 仅在Type A/B都PASS时允许带Type C继续
|
|
185
|
+
|
|
186
|
+
**对于Type D失败:**
|
|
187
|
+
- 不计入fix iteration(fix-and-retest)
|
|
188
|
+
- 修复测试环境
|
|
189
|
+
- 立即重新运行测试
|
|
190
|
+
|
|
191
|
+
### 3. 测试覆盖率阈值 (Coverage Thresholds)
|
|
192
|
+
|
|
193
|
+
**强制要求:**
|
|
194
|
+
- 单元测试覆盖率: >= 75%
|
|
195
|
+
- 集成测试覆盖率: >= 60%
|
|
196
|
+
- 接受标准覆盖率: 100% (所有AC必须有至少1个测试)
|
|
197
|
+
|
|
198
|
+
**如果未达到:**
|
|
199
|
+
- 不允许进入step-07
|
|
200
|
+
- 回到开发阶段添加缺失的tests
|
|
201
|
+
- Type: AC-Incomplete failure → 标记story为"NEEDS_MORE_TESTS"
|
|
202
|
+
|
|
203
|
+
### 4. 记录失败详情 (Document Failures)
|
|
204
|
+
|
|
205
|
+
在Story文件的"QA Results"部分记录:
|
|
206
|
+
|
|
207
|
+
```markdown
|
|
208
|
+
## QA Results
|
|
209
|
+
|
|
210
|
+
**Overall Status:** FAILED - 2/5 ACs passed
|
|
211
|
+
|
|
212
|
+
### Failed Tests
|
|
213
|
+
- **AC#2 (Type A):** [Description]
|
|
214
|
+
- Expected: [X]
|
|
215
|
+
- Actual: [Y]
|
|
216
|
+
- Root Cause: [Analysis]
|
|
217
|
+
- Fix Priority: HIGH
|
|
218
|
+
|
|
219
|
+
- **AC#4 (Type C):** [Performance]
|
|
220
|
+
- Threshold: 1s
|
|
221
|
+
- Actual: 2.3s
|
|
222
|
+
- Fix Priority: MEDIUM (Known issue, defer if needed)
|
|
223
|
+
|
|
224
|
+
### Coverage Summary
|
|
225
|
+
- Unit: 72% (Below 75% threshold)
|
|
226
|
+
- Integration: 65%
|
|
227
|
+
- AC Coverage: 100%
|
|
228
|
+
|
|
229
|
+
### Recommended Next Step
|
|
230
|
+
- Re-run step-07 to fix AC#2 (HIGH)
|
|
231
|
+
- Consider Type C as known limitation unless time allows
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### 5. 条件通过规则 (Conditional Pass)
|
|
235
|
+
|
|
236
|
+
故事可以在以下条件下**有条件通过**到step-07:
|
|
237
|
+
|
|
238
|
+
✅ **全部Type A/B失败已解决**
|
|
239
|
+
✅ **至少80%的接受标准通过**
|
|
240
|
+
✅ **无Critical数据完整性问题**
|
|
241
|
+
❌ **Type C (性能)失败不阻止进度** (但需要记录)
|
|
242
|
+
❌ **测试覆盖率 < 60% 则必须返回修复**
|
|
243
|
+
|
|
244
|
+
### 6. 向step-07传递信息 (Hand-off to step-07)
|
|
245
|
+
|
|
246
|
+
设置以下变量供step-07使用:
|
|
247
|
+
|
|
248
|
+
```
|
|
249
|
+
{fix_source} = "qa-testing"
|
|
250
|
+
{failure_categories} = [Type A count, Type B count, Type C count]
|
|
251
|
+
{high_priority_issues} = [list]
|
|
252
|
+
{performance_known_issues} = [list] // For conditional pass scenarios
|
|
253
|
+
```
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md
CHANGED
|
@@ -126,3 +126,112 @@ After all fixes are applied:
|
|
|
126
126
|
- Introducing new regressions while fixing existing issues
|
|
127
127
|
- Exceeding `{max_fix_iterations}` fix iterations without resolution
|
|
128
128
|
- Not running regression tests after each fix
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## 当超过最大修复迭代次数 (Escalation Path: Beyond Max Fix Iterations)
|
|
133
|
+
|
|
134
|
+
**触发条件:** `{fix_iteration}` > `{max_fix_iterations}` (默认 > 5)
|
|
135
|
+
|
|
136
|
+
**Escalation Protocol:**
|
|
137
|
+
|
|
138
|
+
### 1. 生成Escalation Report
|
|
139
|
+
|
|
140
|
+
文档所有修复尝试和失败原因:
|
|
141
|
+
|
|
142
|
+
```
|
|
143
|
+
ESCALATION REPORT: Story {current_story_key}
|
|
144
|
+
==========================================
|
|
145
|
+
Status: FIX LIMIT EXCEEDED
|
|
146
|
+
Fix Iterations Attempted: {max_fix_iterations}
|
|
147
|
+
Unresolved Issues:
|
|
148
|
+
- [Issue 1]: [Root Cause Analysis]
|
|
149
|
+
- [Issue 2]: [Root Cause Analysis]
|
|
150
|
+
|
|
151
|
+
Pattern Analysis:
|
|
152
|
+
- Recurring issue? [Yes/No] — [Description]
|
|
153
|
+
- Root cause identified? [Yes/No]
|
|
154
|
+
- Architectural blocker? [Yes/No]
|
|
155
|
+
|
|
156
|
+
Timeline Impact: [number] days
|
|
157
|
+
Recommended Action: [A/B/C below]
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### 2. 通知团队 (Owner Notification)
|
|
161
|
+
|
|
162
|
+
发送通知至:
|
|
163
|
+
- **Primary:** Story Owner / Scrum Master (Mary)
|
|
164
|
+
- **Secondary:** Tech Lead / Architect (Winston)
|
|
165
|
+
|
|
166
|
+
**Notification Template:**
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
URGENT: Story {current_story_key} - Fix Limit Reached
|
|
170
|
+
|
|
171
|
+
Summary: After {max_fix_iterations} fix iterations, the following issues remain unresolved:
|
|
172
|
+
- [Issue list]
|
|
173
|
+
|
|
174
|
+
Root Cause Analysis:
|
|
175
|
+
- [Analysis summary]
|
|
176
|
+
|
|
177
|
+
Recommended Actions:
|
|
178
|
+
A) Mark as "Blocked" - Investigate architectural changes needed
|
|
179
|
+
B) Reduce scope - Defer failing AC to next iteration
|
|
180
|
+
C) Re-assign to Tech Lead for deep investigation
|
|
181
|
+
D) Revert changes and restart implementation from scratch
|
|
182
|
+
|
|
183
|
+
Timeline: Requires decision within [4 hours / 1 day]
|
|
184
|
+
Severity: BLOCKING SPRINT PROGRESS
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### 3. 处理选项 (Handling Options)
|
|
188
|
+
|
|
189
|
+
**选项 A - 标记为Blocked:**
|
|
190
|
+
- 更新story状态为 `BLOCKED_INVESTIGATION`
|
|
191
|
+
- 记录blocking factors
|
|
192
|
+
- Escalate to Architect (Winston) for architectural review
|
|
193
|
+
- 移出当前sprint backlog
|
|
194
|
+
|
|
195
|
+
**选项 B - 缩小范围 (Reduce Scope):**
|
|
196
|
+
- 识别哪些acceptance criteria无法在{max_fix_iterations}内完成
|
|
197
|
+
- 将这些AC移至"acceptance-criteria-deferred"部分
|
|
198
|
+
- 标记为"READY_FOR_TESTING"(简化的AC集合)
|
|
199
|
+
- 继续进入step-08
|
|
200
|
+
|
|
201
|
+
**选项 C - 重新分配 (Tech Lead Deep Dive):**
|
|
202
|
+
- 暂停当前story处理
|
|
203
|
+
- 分配给Tech Lead (Winston) 进行深度root cause分析
|
|
204
|
+
- 预计时间: 2-4小时的深度分析
|
|
205
|
+
- 结果: 要么找到fix,要么confirm需要选项A或B
|
|
206
|
+
|
|
207
|
+
**选项 D - 重新开始 (Fresh Start):**
|
|
208
|
+
- 回退所有代码更改到step-04开始前的状态
|
|
209
|
+
- 重新执行step-04到step-07
|
|
210
|
+
- 仅在其他选项都不可行时使用
|
|
211
|
+
- 添加至"lessons learned"文档
|
|
212
|
+
|
|
213
|
+
### 4. Story状态管理
|
|
214
|
+
|
|
215
|
+
**设置Story Meta字段:**
|
|
216
|
+
```
|
|
217
|
+
escalation_status: ESCALATED
|
|
218
|
+
escalation_date: {current_timestamp}
|
|
219
|
+
escalation_owner: {person_assigned}
|
|
220
|
+
recommended_action: [A/B/C/D]
|
|
221
|
+
estimated_resolution_time: [hours]
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### 5. 防止进度堵塞 (Prevent Sprint Blocking)
|
|
225
|
+
|
|
226
|
+
- 不允许story卡在此步骤超过{max_fix_iterations} + 4小时
|
|
227
|
+
- 自动移至Scrum Master队列以处理escalation
|
|
228
|
+
- 在sprint status中标记为"NEEDS_DECISION"
|
|
229
|
+
- 不将此issue计入sprint velocity(因为未完成)
|
|
230
|
+
|
|
231
|
+
### 6. 恢复进度 (Recovery Process)
|
|
232
|
+
|
|
233
|
+
一旦Escalation决策完成:
|
|
234
|
+
- 如果选择 A: Story移至 `BLOCKED` 状态,等待Architect反馈
|
|
235
|
+
- 如果选择 B: 回到step-08 (complete story),使用简化的AC集合
|
|
236
|
+
- 如果选择 C: Architect执行分析,结果完成后回到step-07
|
|
237
|
+
- 如果选择 D: Story重置到step-04,重新开始整个cycle
|
package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md
CHANGED
|
@@ -17,8 +17,8 @@ nextStepFile: "./step-09-cycle-check.md"
|
|
|
17
17
|
### 1. Final Validation
|
|
18
18
|
|
|
19
19
|
Before marking complete, verify all gates:
|
|
20
|
-
1. Read the COMPLETE story file at `{current_story_path}`
|
|
21
|
-
2. Verify ALL tasks and subtasks are marked [x]
|
|
20
|
+
1. **Fresh Read:** Read the COMPLETE story file at `{current_story_path}` directly from disk (not from cache or prior state). This is critical because step-07 may have modified the file (e.g., updated task checkboxes, changed story status), and you MUST verify the current on-disk state, not a stale in-memory version.
|
|
21
|
+
2. Verify ALL tasks and subtasks are marked [x], [X], or [✓] (case-insensitive, all formats accepted)
|
|
22
22
|
3. Verify ALL acceptance criteria have been tested and passed
|
|
23
23
|
4. Verify no unresolved HIGH or MEDIUM issues remain
|
|
24
24
|
5. Verify the full test suite passes
|
|
@@ -32,10 +32,12 @@ nextStepFile: null
|
|
|
32
32
|
- Key matches pattern: number-number-name (e.g., "1-2-user-auth")
|
|
33
33
|
- NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
|
|
34
34
|
- Status value equals "backlog"
|
|
35
|
+
- If found: Set `{found_status}` = "backlog"
|
|
35
36
|
5. If no "backlog" story is found, search again for the FIRST story where:
|
|
36
37
|
- Key matches the same pattern (not epic, not retrospective)
|
|
37
38
|
- Status value equals "ready-for-dev"
|
|
38
39
|
- *(Mirrors step-01's initial story selection: "backlog, or ready-for-dev if no backlog")*
|
|
40
|
+
- If found: Set `{found_status}` = "ready-for-dev"
|
|
39
41
|
|
|
40
42
|
### 3. Evaluate Next Story
|
|
41
43
|
|
|
@@ -43,6 +45,7 @@ nextStepFile: null
|
|
|
43
45
|
- Set `{current_story_key}` = found story key
|
|
44
46
|
- Set `{current_story_path}` = "" (will be set during creation/validation)
|
|
45
47
|
- Set `{fix_iteration}` = 0
|
|
48
|
+
- *(Note: `{found_status}` was already set in section 2 above — "backlog" or "ready-for-dev" — and is used in the progress checkpoint output below.)*
|
|
46
49
|
|
|
47
50
|
**3.5. Batch Mode Progress Checkpoint**
|
|
48
51
|
|
|
@@ -34,9 +34,10 @@ This uses **step-file architecture** for focused execution across a long-running
|
|
|
34
34
|
|
|
35
35
|
- `{pipeline_mode}` — "single" (one story) or "batch" (all backlog stories)
|
|
36
36
|
- `{current_story_key}` — Key of story being processed (e.g., "1-2-user-auth")
|
|
37
|
-
- `{current_story_path}` — Full path to current story file (derived in step-01 after resolving `{current_story_key}`; re-set in step-02 skip branch for batch cycles)
|
|
37
|
+
- `{current_story_path}` — Full path to current story file (derived in step-01 after resolving `{current_story_key}`; re-set in step-02 skip branch for batch cycles). **CRITICAL:** In batch mode, this variable is reset for each story iteration (step-09 → step-02 loop). Whenever re-reading the story file in subsequent steps (e.g., step-08 final validation, step-03 re-checks), always perform a FRESH read directly from disk using this path variable. Do NOT rely on cached/stale in-memory state from earlier steps in the same cycle, as intermediate steps (step-04, step-05, step-06, step-07) may have modified the file
|
|
38
38
|
- `{fix_iteration}` — Bug fix loop counter (max controlled by `{max_fix_iterations}`, default 5; reset per story)
|
|
39
39
|
- `{max_fix_iterations}` — Maximum fix-and-retest cycles per story (configurable via `max_fix_iterations` in config.yaml; default 5 if not set)
|
|
40
|
+
- `{fix_source}` — Origin of failures being fixed in step-07: "code-review" (step-05 routed here with unresolvable issues), "qa-testing" (step-06 routed here with test failures), or "mixed" (both code review and QA issues); set in step-07 section 2; determines post-fix routing (code-review/mixed → inline targeted re-check before step-08; qa-testing → step-08 directly)
|
|
40
41
|
- `{stories_completed}` — Count of stories completed in this pipeline run
|
|
41
42
|
- `{pipeline_status}` — Current pipeline phase for tracking
|
|
42
43
|
- `{validation_attempt}` — Story validation attempt counter (used in step-03, max 3; re-initialized at start of step-03 for each story)
|
|
@@ -46,6 +47,7 @@ This uses **step-file architecture** for focused execution across a long-running
|
|
|
46
47
|
- `{in_progress_count}` — Count of stories with status "in-progress" (initialized in step-01; refreshed in step-09)
|
|
47
48
|
- `{review_count}` — Count of stories with status "review" (initialized in step-01; refreshed in step-09)
|
|
48
49
|
- `{done_count}` — Count of stories with status "done" (initialized in step-01; refreshed in step-09)
|
|
50
|
+
- `{found_status}` — Status of the next processable story found during step-09 section 2 search: "backlog" or "ready-for-dev"; explicitly set alongside `{current_story_key}` when a story is selected; used in section 3.5 progress checkpoint output; local to step-09 and not persisted between stories
|
|
49
51
|
|
|
50
52
|
### Status Machine
|
|
51
53
|
|
|
@@ -3,37 +3,7 @@
|
|
|
3
3
|
# Edit this file to change what users see during the install process
|
|
4
4
|
|
|
5
5
|
# Display at the START of installation (after logo, before prompts)
|
|
6
|
-
startMessage:
|
|
7
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
8
|
-
|
|
9
|
-
🎉 V6 IS HERE! Welcome to XiaoMa Method V6 - Official Stable Release!
|
|
10
|
-
|
|
11
|
-
The XiaoMa Method is now a Platform powered by the XiaoMa Method Core and Module Ecosystem!
|
|
12
|
-
- Select and install modules during setup - customize your experience
|
|
13
|
-
- New XiaoMa Method for Agile AI-Driven Development (the evolution of V4)
|
|
14
|
-
- Exciting new modules available during installation, with community modules coming soon
|
|
15
|
-
- Documentation: https://docs.xiaoma-cli.org
|
|
16
|
-
|
|
17
|
-
🌟 XiaoMa is 100% free and open source.
|
|
18
|
-
- No gated Discord. No paywalls. No gated content.
|
|
19
|
-
- We believe in empowering everyone, not just those who can pay.
|
|
20
|
-
- Knowledge should be shared, not sold.
|
|
21
|
-
|
|
22
|
-
🎤 SPEAKING & MEDIA:
|
|
23
|
-
- Available for conferences, podcasts, and media appearances
|
|
24
|
-
- Topics: AI-Native Transformation, Spec and Context Engineering, XiaoMa Method
|
|
25
|
-
- For speaking inquiries or interviews, reach out to XiaoMa on Discord!
|
|
26
|
-
|
|
27
|
-
⭐ HELP US GROW:
|
|
28
|
-
- Star us on GitHub: https://github.com/xiaoma-code-org/XiaoMa-CLI/
|
|
29
|
-
- Subscribe on YouTube: https://www.youtube.com/@XiaoMaCode
|
|
30
|
-
- Free Community and Support: https://discord.gg/gk8jAdXWmj
|
|
31
|
-
- Donate: https://buymeacoffee.com/xiaoma
|
|
32
|
-
- Corporate Sponsorship available
|
|
33
|
-
|
|
34
|
-
Latest updates: https://github.com/xiaoma-code-org/XiaoMa-CLI/blob/main/CHANGELOG.md
|
|
35
|
-
|
|
36
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
6
|
+
startMessage: "欢迎使用 xiaoma 最新版,有任何问题请咨询 平台研发部-刘二杨"
|
|
37
7
|
|
|
38
8
|
# No end message - install summary and next steps are rendered by the installer
|
|
39
9
|
endMessage: ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
description = "Executes the {{name}} task from the
|
|
1
|
+
description = "Executes the {{name}} task from the XiaoMa Method."
|
|
2
2
|
prompt = """
|
|
3
|
-
Execute the
|
|
3
|
+
Execute the XiaoMa '{{name}}' task.
|
|
4
4
|
|
|
5
5
|
TASK INSTRUCTIONS:
|
|
6
6
|
1. LOAD the task file from {project-root}/{{bmadFolderName}}/{{path}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
description = "Executes the {{name}} tool from the
|
|
1
|
+
description = "Executes the {{name}} tool from the XiaoMa Method."
|
|
2
2
|
prompt = """
|
|
3
|
-
Execute the
|
|
3
|
+
Execute the XiaoMa '{{name}}' tool.
|
|
4
4
|
|
|
5
5
|
TOOL INSTRUCTIONS:
|
|
6
6
|
1. LOAD the tool file from {project-root}/{{bmadFolderName}}/{{path}}
|
|
@@ -25,17 +25,17 @@ const CLIUtils = {
|
|
|
25
25
|
|
|
26
26
|
// ASCII art logo
|
|
27
27
|
const logo = [
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
28
|
+
' ██╗ ██╗██╗ █████╗ ██████╗ ███╗ ███╗ █████╗',
|
|
29
|
+
' ╚██╗██╔╝██║██╔══██╗██╔═══██╗████╗ ████║██╔══██╗',
|
|
30
|
+
' ╚███╔╝ ██║███████║██║ ██║██╔████╔██║███████║',
|
|
31
|
+
' ██╔██╗ ██║██╔══██║██║ ██║██║╚██╔╝██║██╔══██║',
|
|
32
|
+
' ██╔╝ ██╗██║██║ ██║╚██████╔╝██║ ╚═╝ ██║██║ ██║',
|
|
33
|
+
' ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝',
|
|
34
34
|
]
|
|
35
35
|
.map((line) => color.yellow(line))
|
|
36
36
|
.join('\n');
|
|
37
37
|
|
|
38
|
-
const tagline = '
|
|
38
|
+
const tagline = ' AI-Driven Agile Development';
|
|
39
39
|
|
|
40
40
|
await prompts.box(`${logo}\n${tagline}`, `v${version}`, {
|
|
41
41
|
contentAlign: 'center',
|
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
# Pipeline Optimization Report
|
|
2
|
-
|
|
3
|
-
**Generated:** 2026-03-18
|
|
4
|
-
**Last Updated:** 2026-03-18 (Run #2 — Incremental Analysis)
|
|
5
|
-
**Scope:** auto-requirements-pipeline · auto-story-pipeline
|
|
6
|
-
**Run Type:** Incremental update (previous report found; all prior optimizations verified in-place)
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 1. 学习总结 — 项目整体架构
|
|
11
|
-
|
|
12
|
-
### 1.1 Agent 体系
|
|
13
|
-
|
|
14
|
-
| Agent | 名称 | 主要职责 | 触发 Pipeline |
|
|
15
|
-
|-------|------|---------|--------------|
|
|
16
|
-
| Analyst (Mary) | 业务分析师 | 需求分析、竞品研究、Requirements 挖掘 | auto-requirements-pipeline (AR) |
|
|
17
|
-
| Architect (Winston) | 架构师 | 架构分析、技术设计、系统决策 | auto-requirements-pipeline |
|
|
18
|
-
| PM (John) | 产品经理 | PRD创建/验证、Epic/Story拆解 | auto-requirements-pipeline |
|
|
19
|
-
| SM (Bob) | Scrum Master | Story创建、Sprint规划、流程协调 | auto-story-pipeline (ASP) |
|
|
20
|
-
| Dev (Amelia) | 开发者 | 代码实现、TDD、Bug修复 | auto-story-pipeline |
|
|
21
|
-
| QA (Quinn) | 质量保障 | 功能测试、E2E测试、验收标准验证 | auto-story-pipeline |
|
|
22
|
-
| UX Designer (Sally) | UX设计师 | 用户体验设计、界面规范 | — |
|
|
23
|
-
| Tech Writer (Paige) | 技术文档 | 文档编写、图表生成 | — |
|
|
24
|
-
| Quick Flow (Barry) | 快速开发 | 轻量级规格+实现一体化 | — |
|
|
25
|
-
|
|
26
|
-
### 1.2 Core Skill 体系
|
|
27
|
-
|
|
28
|
-
- **xiaoma-advanced-elicitation** — 高级需求挖掘技术
|
|
29
|
-
- **xiaoma-brainstorming** — 结构化头脑风暴
|
|
30
|
-
- **xiaoma-distillator** — 内容提炼与压缩
|
|
31
|
-
- **xiaoma-editorial-review-prose/structure** — 编辑质量审查(文字风格/文档结构)
|
|
32
|
-
- **xiaoma-review-adversarial-general / edge-case-hunter** — 对抗性代码审查与边界案例发现
|
|
33
|
-
- **xiaoma-shard-doc / xiaoma-index-docs** — 文档分片与索引
|
|
34
|
-
- **xiaoma-party-mode / xiaoma-help** — 协作模式和帮助系统
|
|
35
|
-
|
|
36
|
-
### 1.3 Workflow 体系(4个阶段)
|
|
37
|
-
|
|
38
|
-
| 阶段 | 核心工作流 |
|
|
39
|
-
|------|-----------|
|
|
40
|
-
| Phase 1 Analysis | auto-requirements-pipeline, xiaoma-create-product-brief, research |
|
|
41
|
-
| Phase 2 Planning | create-prd, xiaoma-edit-prd, xiaoma-validate-prd, xiaoma-create-ux-design |
|
|
42
|
-
| Phase 3 Solutioning | xiaoma-create-architecture, xiaoma-create-epics-and-stories, xiaoma-check-implementation-readiness |
|
|
43
|
-
| Phase 4 Implementation | auto-story-pipeline, xiaoma-create-story, xiaoma-dev-story, xiaoma-code-review, xiaoma-sprint-planning, xiaoma-sprint-status, xiaoma-correct-course, xiaoma-retrospective |
|
|
44
|
-
| 跨阶段 | xiaoma-document-project, xiaoma-generate-project-context, xiaoma-qa-generate-e2e-tests, xiaoma-quick-flow |
|
|
45
|
-
|
|
46
|
-
### 1.4 Step-File 架构模式
|
|
47
|
-
|
|
48
|
-
两个 pipeline 都采用相同的**step-file architecture**:每个步骤读取独立 `.md` 文件,防止长会话中的"上下文丢失"问题。状态通过变量(`{variable_name}`)在步骤间传递,文件 frontmatter 声明 `nextStepFile` 进行步骤链接。
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## 2. Pipeline 分析
|
|
53
|
-
|
|
54
|
-
### 2.1 auto-requirements-pipeline 分析
|
|
55
|
-
|
|
56
|
-
**路径:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/`
|
|
57
|
-
**步骤数:** 8步
|
|
58
|
-
**Agent 角色链:** Mary → Winston → John → John → John → Winston → Orchestrator
|
|
59
|
-
|
|
60
|
-
#### 步骤概览
|
|
61
|
-
|
|
62
|
-
| 步骤 | 职责 | Agent | 输出产物 | 质量控制 |
|
|
63
|
-
|------|------|-------|---------|---------|
|
|
64
|
-
| Step 01 | 初始化与验证 | Orchestrator | 无 | 前置条件检查 |
|
|
65
|
-
| Step 02 | 需求分析 | Analyst (Mary) | requirements-analysis.md | 8相分析 + 最多2次自检重试 |
|
|
66
|
-
| Step 03 | 架构分析 | Architect (Winston) | current-architecture-analysis.md | 6项质量标准 + 最多2次重试 |
|
|
67
|
-
| Step 04 | 创建PRD | PM (John) | prd.md | 委托 create-prd workflow (15步) |
|
|
68
|
-
| Step 05 | 验证PRD | PM (John) | prd.md (updated) | 委托 validate-prd workflow,最多3次迭代 |
|
|
69
|
-
| Step 06 | 创建 Epics/Stories | PM (John) | epics.md | 委托 create-epics-and-stories workflow |
|
|
70
|
-
| Step 07 | 创建架构设计 | Architect (Winston) | architecture.md | 委托 create-architecture workflow |
|
|
71
|
-
| Step 08 | 收尾 | Orchestrator | pipeline-status.json | Checklist 验证 |
|
|
72
|
-
|
|
73
|
-
#### 亮点设计
|
|
74
|
-
- **零跳过策略**:步骤间不允许跳过,通过"Automatically proceed"指令强制连续执行
|
|
75
|
-
- **双架构文档区分**:`current-architecture-analysis.md`(现有系统分析)vs `architecture.md`(新功能设计),设计清晰
|
|
76
|
-
- **Workflow 委托模式**:复杂步骤委托给已验证的子 workflow,保持 pipeline 轻量
|
|
77
|
-
- **Machine-readable 状态**:`pipeline-status.json` 使下游 (auto-story-pipeline) 可以程序化检查完成状态
|
|
78
|
-
|
|
79
|
-
#### 发现的问题(优化前)
|
|
80
|
-
|
|
81
|
-
| 问题 ID | 严重性 | 描述 |
|
|
82
|
-
|---------|--------|------|
|
|
83
|
-
| REQ-01 | HIGH | step-06 缺少 PM 角色切换(Switch to PM Role)章节,与其他步骤不一致 |
|
|
84
|
-
| REQ-02 | MEDIUM | workflow.md 状态变量缺少 `{max_validation_iterations}` 的说明(仅在 step-05 内定义) |
|
|
85
|
-
| REQ-03 | MEDIUM | step-08 pipeline-status.json 中迭代次数字段被错误地用字符串引号包裹(应为数字类型) |
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
### 2.2 auto-story-pipeline 分析
|
|
90
|
-
|
|
91
|
-
**路径:** `src/xmc/workflows/4-implementation/auto-story-pipeline/`
|
|
92
|
-
**步骤数:** 9步
|
|
93
|
-
**Agent 角色链:** Orchestrator → SM (Bob) → PM (John) → Dev (Amelia) → Adversarial Reviewer → QA (Quinn) → Orchestrator
|
|
94
|
-
|
|
95
|
-
#### 步骤概览
|
|
96
|
-
|
|
97
|
-
| 步骤 | 职责 | Agent | 主要操作 | 模式 |
|
|
98
|
-
|------|------|-------|---------|------|
|
|
99
|
-
| Step 01 | 初始化 | Orchestrator | 解析 sprint-status,确定 single/batch 模式 | 入口 |
|
|
100
|
-
| Step 02 | 创建 Story | SM (Bob) | 委托 create-story workflow | 可跳过(已存在时) |
|
|
101
|
-
| Step 03 | 验证 Story | PM (John) | 10步验证,最多3次自修复 | 质量门禁 |
|
|
102
|
-
| Step 04 | 开发 Story | Dev (Amelia) | TDD (Red-Green-Refactor),委托 dev-story | 核心实现 |
|
|
103
|
-
| Step 05 | 代码审查 | Adversarial Reviewer | 委托 code-review,自动修复 HIGH/MEDIUM | 质量门禁 |
|
|
104
|
-
| Step 06 | QA 测试 | QA (Quinn) | 真实数据测试,委托 qa-generate-e2e-tests | 验收测试 |
|
|
105
|
-
| Step 07 | 修复与重测 | Dev (Amelia) | 根源修复 + 回归测试(最多 max_fix_iterations 次) | 修复循环 |
|
|
106
|
-
| Step 08 | 完成 Story | Orchestrator | 更新状态、检查 Epic 完成度、生成摘要 | 收尾 |
|
|
107
|
-
| Step 09 | 循环检查 | Orchestrator | Single模式结束 / Batch模式选下一个 Story | 循环控制 |
|
|
108
|
-
|
|
109
|
-
#### 亮点设计
|
|
110
|
-
- **状态机驱动**:`backlog → ready-for-dev → in-progress → review → done`,每个状态有明确转换规则
|
|
111
|
-
- **Resume 能力**:step-01 支持 `ASP resume <story-key>` 恢复中断的故事
|
|
112
|
-
- **In-Progress 检查**:针对异常 in-progress 状态(无已完成任务)给出警告而非阻塞
|
|
113
|
-
- **Epic 完成度自动检查**:step-08 自动检测并更新 Epic 完成状态
|
|
114
|
-
- **Batch Progress Checkpoint**:批量模式下每个故事间输出进度摘要
|
|
115
|
-
|
|
116
|
-
#### 发现的问题(优化前)
|
|
117
|
-
|
|
118
|
-
| 问题 ID | 严重性 | 描述 |
|
|
119
|
-
|---------|--------|------|
|
|
120
|
-
| STORY-01 | HIGH | step-09 批量进度检查点显示的状态计数是 step-01 初始化时的过期数据,批量处理多个 story 后信息失真 |
|
|
121
|
-
| STORY-02 | HIGH | workflow.md 未文档化 `max_fix_iterations` 的可配置性(仅在 step-07 中提及可通过 config.yaml 配置) |
|
|
122
|
-
| STORY-03 | MEDIUM | step-07 未区分故障来源(代码审查 vs QA 测试),修复后直接跳转 step-08,代码审查触发的修复不经过二次验证 |
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## 3. 优化清单
|
|
127
|
-
|
|
128
|
-
### 3.1 已识别的所有优化点
|
|
129
|
-
|
|
130
|
-
| 优化 ID | 目标 Pipeline | 优先级 | 描述 | 受影响文件 |
|
|
131
|
-
|---------|--------------|--------|------|-----------|
|
|
132
|
-
| OPT-REQ-1 | auto-requirements | HIGH | step-06 缺少"Switch to PM Role"章节,一致性缺失 | step-06-create-epics.md |
|
|
133
|
-
| OPT-REQ-2 | auto-requirements | MEDIUM | workflow.md 缺少 `{max_validation_iterations}` 状态变量文档 | workflow.md |
|
|
134
|
-
| OPT-REQ-3 | auto-requirements | MEDIUM | step-08 JSON 迭代次数字段类型错误(字符串 vs 数字) | step-08-finalize.md |
|
|
135
|
-
| OPT-STORY-1 | auto-story | HIGH | step-09 批量进度检查点使用过期状态计数 | step-09-cycle-check.md |
|
|
136
|
-
| OPT-STORY-2 | auto-story | HIGH | workflow.md 缺少 `{max_fix_iterations}` 状态变量文档 | workflow.md |
|
|
137
|
-
| OPT-STORY-3 | auto-story | MEDIUM | step-07 缺少故障来源区分和基于来源的差异化路由 | step-07-fix-and-retest.md |
|
|
138
|
-
| OPT-REQ-4 | auto-requirements | LOW | step-05 Section 5 中 "Proceed to step 4" 措辞歧义,应为 "Proceed to section 6" | step-05-validate-prd.md |
|
|
139
|
-
| OPT-STORY-4 | auto-story | MEDIUM | step-01 Section 5 将 ready-for-dev 直接路由到 step-04,与批量模式的 step-02→step-03 路径不一致,绕过了验证门禁 | step-01-init-and-validate.md |
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
## 4. 已实施优化
|
|
144
|
-
|
|
145
|
-
### OPT-REQ-1 — step-06 新增 PM 角色切换章节
|
|
146
|
-
|
|
147
|
-
**文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-06-create-epics.md`
|
|
148
|
-
|
|
149
|
-
**问题:** step-04(Create PRD)和 step-05(Validate PRD)都有明确的"Switch to PM Role"章节,但 step-06(Create Epics)直接从"Load Required Context"开始,缺少角色切换,导致与同类步骤不一致。
|
|
150
|
-
|
|
151
|
-
**修改:**
|
|
152
|
-
- 在 `## EXECUTION SEQUENCE` 下新增 `### 1. Switch to PM Role` 章节,包含 John 的角色定义和职责说明
|
|
153
|
-
- 原有章节编号向后推移(原 §1→§2, §2→§3, §3→§4, §4→§5, §5→§6)
|
|
154
|
-
- 新章节明确指向 Epic/Story 拆解的目的:"break down the validated PRD into well-structured epics and user stories"
|
|
155
|
-
|
|
156
|
-
**兼容性:** 纯添加性修改,不影响委托逻辑和文件引用。
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
### OPT-REQ-2 — workflow.md 补充 `{max_validation_iterations}` 状态变量
|
|
161
|
-
|
|
162
|
-
**文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md`
|
|
163
|
-
|
|
164
|
-
**问题:** `{max_validation_iterations}` 变量仅在 step-05 内部定义,其他开发者或 LLM 阅读 workflow.md 顶层时无法了解这个变量的存在和含义。
|
|
165
|
-
|
|
166
|
-
**修改:**
|
|
167
|
-
- 在 State Variables 章节,紧跟 `{validation_iteration}` 之后新增 `{max_validation_iterations}` 条目
|
|
168
|
-
- 说明其默认值(3)以及为何比 analysis/architecture 的限制(2次)更高(因为委托了完整的 14步 validate-prd workflow)
|
|
169
|
-
|
|
170
|
-
**兼容性:** 纯文档补充,不影响任何执行逻辑。
|
|
171
|
-
|
|
172
|
-
---
|
|
173
|
-
|
|
174
|
-
### OPT-REQ-3 — step-08 JSON 迭代计数字段改为数字类型
|
|
175
|
-
|
|
176
|
-
**文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-08-finalize.md`
|
|
177
|
-
|
|
178
|
-
**问题:** `pipeline-status.json` 模板中:
|
|
179
|
-
```json
|
|
180
|
-
"iterations": {
|
|
181
|
-
"analysis": "{analysis_iteration}", // ❌ 字符串
|
|
182
|
-
"architecture": "{architecture_iteration}", // ❌ 字符串
|
|
183
|
-
"validation": "{validation_iteration}" // ❌ 字符串
|
|
184
|
-
}
|
|
185
|
-
```
|
|
186
|
-
这些值在运行时会被替换为数字,但被字符串引号包裹,导致下游工具(如 auto-story-pipeline)解析时得到字符串 "1" 而非数字 1,不利于程序化比较。
|
|
187
|
-
|
|
188
|
-
**修改:** 移除三个迭代次数字段的引号:
|
|
189
|
-
```json
|
|
190
|
-
"iterations": {
|
|
191
|
-
"analysis": {analysis_iteration}, // ✅ 数字
|
|
192
|
-
"architecture": {architecture_iteration}, // ✅ 数字
|
|
193
|
-
"validation": {validation_iteration} // ✅ 数字
|
|
194
|
-
}
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
**兼容性:** 修改 JSON 模板格式,运行时生成的 JSON 文件语义更正确。对已生成的历史文件无影响。
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
### OPT-STORY-1 — step-09 批量进度检查点刷新状态计数
|
|
202
|
-
|
|
203
|
-
**文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md`
|
|
204
|
-
|
|
205
|
-
**问题:** 在批量模式下处理第 N 个 story 时,section 3.5 的进度检查点输出的 `{backlog_count}`、`{ready_count}` 等计数仍是 step-01 初始化时的值,不反映处理过 N-1 个故事后的实际状态。
|
|
206
|
-
|
|
207
|
-
例如,初始状态有 5 个 backlog story。处理完第 1 个后,`{backlog_count}` 还是 5,但实际应该是 4。这会使批量运行过程的进度摘要完全失真。
|
|
208
|
-
|
|
209
|
-
**修改:** 在 section 3.5 "Batch Mode Progress Checkpoint" 的输出前,增加一个三步刷新序列:
|
|
210
|
-
1. 重新加载完整 `{sprint_status}` 文件
|
|
211
|
-
2. 重新计数所有状态类别,更新 5 个计数变量
|
|
212
|
-
3. 输出带 "(refreshed)" 标记的进度摘要
|
|
213
|
-
|
|
214
|
-
**兼容性:** 与现有批量逻辑完全兼容,仅增加了文件读取和计数步骤。不影响单故事模式。
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
### OPT-STORY-2 — workflow.md 补充 `{max_fix_iterations}` 状态变量
|
|
219
|
-
|
|
220
|
-
**文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md`
|
|
221
|
-
|
|
222
|
-
**问题:** State Variables 章节只有 `{fix_iteration}`,但没有说明:
|
|
223
|
-
1. 存在 `{max_fix_iterations}` 作为上限控制变量
|
|
224
|
-
2. 该变量可通过 `config.yaml` 的 `max_fix_iterations` 字段自定义
|
|
225
|
-
3. 各计数变量(`{backlog_count}` 等)何时被刷新
|
|
226
|
-
|
|
227
|
-
**修改:**
|
|
228
|
-
- 新增 `{max_fix_iterations}` 条目,说明默认值(5)和 config.yaml 配置方式
|
|
229
|
-
- 更新 `{fix_iteration}` 说明,注明被 `{max_fix_iterations}` 控制、每个 story 重置
|
|
230
|
-
- 更新 `{validation_attempt}` 说明,注明在 step-03 开始时重新初始化
|
|
231
|
-
- 更新 5 个状态计数变量的说明,注明刷新时机(step-01 初始化,step-09 批量检查点和最终收尾时刷新)
|
|
232
|
-
|
|
233
|
-
**兼容性:** 纯文档补充。
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
### OPT-STORY-3 — step-07 区分故障来源并差异化路由
|
|
238
|
-
|
|
239
|
-
**文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md`
|
|
240
|
-
|
|
241
|
-
**问题:** step-07 在修复后一律跳转 step-08(完成 story),无论问题是来自代码审查(step-05)还是 QA 测试(step-06)。对于代码审查触发的修复,修复后的代码没有经过任何验证即直接标记完成,存在质量风险。
|
|
242
|
-
|
|
243
|
-
**修改:**
|
|
244
|
-
|
|
245
|
-
**Section 2 新增故障来源分类:**
|
|
246
|
-
```
|
|
247
|
-
{fix_source} = "code-review" | "qa-testing" | "mixed"
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
**Section 6 差异化路由逻辑:**
|
|
251
|
-
- `{fix_source}` == "qa-testing":直接跳转 step-08(QA 已通过代码审查后的测试阶段)
|
|
252
|
-
- `{fix_source}` == "code-review" 或 "mixed":在跳转前执行**轻量级内联代码复查**(不需完整委托 code-review workflow,只需重新验证修复区域的 HIGH/MEDIUM 问题是否真正解决)。若复查发现新问题则循环回 step-07。
|
|
253
|
-
|
|
254
|
-
**NEXT STEP 更新:** 新增三个条件化的跳转路径,覆盖所有路由场景。
|
|
255
|
-
|
|
256
|
-
**兼容性:** 引入新变量 `{fix_source}`,修改了 section 6 逻辑和 NEXT STEP。不改变正常(无问题)执行路径。
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
### OPT-REQ-4 — step-05 Section 5 导航措辞修正
|
|
261
|
-
|
|
262
|
-
**文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md`
|
|
263
|
-
|
|
264
|
-
**问题:** Section 5(Validation Loop)中,当所有验证检查通过时,文本写的是 "If ALL checks pass: Proceed to step 4"。`step 4` 是歧义引用——它可能被 LLM 误解为:(a) 循环列表中的第4项(不存在),(b) 文件的 Section 4(Execute PRD Validation,即重新触发整个委托流程),或 (c) 下一节(Section 6 Validation Passed,这才是正确意图)。误解为 (b) 会导致无限重委托循环。
|
|
265
|
-
|
|
266
|
-
**修改:**
|
|
267
|
-
- 将 "Proceed to step 4" 改为 "Proceed to section 6 (Validation Passed)",明确指向正确的下一节,消除歧义。
|
|
268
|
-
|
|
269
|
-
**兼容性:** 纯措辞修正,不影响任何执行逻辑结构。
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
### OPT-STORY-4 — step-01 ready-for-dev 路由与批量模式对齐
|
|
274
|
-
|
|
275
|
-
**文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md`
|
|
276
|
-
|
|
277
|
-
**问题:** Section 5(Determine Starting Step)对 `ready-for-dev` 状态的注释是 "story already created and validated",并将其直接路由到 step-04(develop story),**绕过了 step-03 的验证门禁**。
|
|
278
|
-
|
|
279
|
-
但是,批量模式下(step-09 批量循环),`ready-for-dev` 的故事会经 step-02 路由到 step-03,再进入 step-04,这正是 step-09 注释明确说明的设计意图:
|
|
280
|
-
> "step-02's section 1 skip logic will detect 'ready-for-dev' stories, skip creation, and route them to step-03 (validate) before development begins"
|
|
281
|
-
|
|
282
|
-
两条路径不一致:
|
|
283
|
-
- **初始/Resume 模式**(step-01):ready-for-dev → step-04 ❌ 跳过验证
|
|
284
|
-
- **批量循环**(step-09→step-02→step-03→step-04):ready-for-dev → step-03 → step-04 ✅ 通过验证
|
|
285
|
-
|
|
286
|
-
`ready-for-dev` 表示 create-story workflow 已生成故事文件,但**尚未经过 pipeline 的 step-03 质量验证**。跳过该门禁使初始模式与批量模式的质量保障不等同。
|
|
287
|
-
|
|
288
|
-
**修改:**
|
|
289
|
-
1. Section 5 中将 `ready-for-dev` 路由从 "Skip to step-04" 改为 "Start at step-03 (validate story)",并更新注释说明原因
|
|
290
|
-
2. NEXT STEP 章节中新增 `ready-for-dev → step-03` 的跳转条目,并将 `in-progress` 的跳转条目从 "step-04 (story status == 'ready-for-dev' or 'in-progress')" 拆分为独立的两个条目
|
|
291
|
-
3. SUCCESS METRICS 更新路由映射说明(backlog→step-02, ready-for-dev→step-03, in-progress→step-04, review→step-05)
|
|
292
|
-
|
|
293
|
-
**兼容性:** 此修改会让所有通过 resume 或初始 single 模式处理的 `ready-for-dev` 故事额外经过 step-03 验证。这是质量提升,不是破坏性变更。故事文件不受影响;sprint-status.yaml 状态转换顺序不变。
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## 5. 测试结果
|
|
298
|
-
|
|
299
|
-
### 5.1 结构完整性测试
|
|
300
|
-
|
|
301
|
-
| 测试项 | 状态 | 备注 |
|
|
302
|
-
|--------|------|------|
|
|
303
|
-
| auto-requirements-pipeline 全部 8 个 step 文件存在 | ✅ PASS | step-01 至 step-08 全部验证 |
|
|
304
|
-
| auto-story-pipeline 全部 9 个 step 文件存在 | ✅ PASS | step-01 至 step-09 全部验证 |
|
|
305
|
-
| 所有 step 文件 frontmatter 含有 `name` 字段 | ✅ PASS | 两个 pipeline 全部 17 个文件通过 |
|
|
306
|
-
| step-06 section 编号连续(1→2→3→4→5→6) | ✅ PASS | 重编号正确 |
|
|
307
|
-
| workflow.md 新增状态变量拼写正确 | ✅ PASS | max_validation_iterations, max_fix_iterations |
|
|
308
|
-
| step-08 JSON 整数字段无字符串引号 | ✅ PASS | analysis/architecture/validation 三个字段 |
|
|
309
|
-
|
|
310
|
-
### 5.2 逻辑流程测试
|
|
311
|
-
|
|
312
|
-
**auto-requirements-pipeline 8步走查:**
|
|
313
|
-
|
|
314
|
-
| 步骤 | 前置条件 | 后置状态 | 跳转目标 | 状态 |
|
|
315
|
-
|------|---------|---------|---------|------|
|
|
316
|
-
| Step 01 | req.md + config.yaml 存在 | initialized | Step 02 | ✅ |
|
|
317
|
-
| Step 02 | req.md 可读 | requirements-analyzed | Step 03 | ✅ |
|
|
318
|
-
| Step 03 | src/ 目录(可选警告) | architecture-analyzed | Step 04 | ✅ |
|
|
319
|
-
| Step 04 | create-prd workflow 存在 | prd-created | Step 05 | ✅ |
|
|
320
|
-
| Step 05 | validate-prd workflow 存在;最多3次迭代 | prd-validated | Step 06 | ✅ |
|
|
321
|
-
| Step 06 | create-epics workflow 存在;新增 PM 角色切换 | epics-created | Step 07 | ✅ |
|
|
322
|
-
| Step 07 | create-architecture workflow 存在 | architecture-created | Step 08 | ✅ |
|
|
323
|
-
| Step 08 | 5个产物均存在;Checklist 执行;JSON 整数类型 | complete | HALT | ✅ |
|
|
324
|
-
|
|
325
|
-
**auto-story-pipeline 9步走查(batch 模式):**
|
|
326
|
-
|
|
327
|
-
| 步骤 | 前置条件 | 后置状态 | 跳转目标 | 状态 |
|
|
328
|
-
|------|---------|---------|---------|------|
|
|
329
|
-
| Step 01 | sprint-status.yaml + epics.md 存在 | initialized | Step 02/04/05(状态路由) | ✅ |
|
|
330
|
-
| Step 02 | current_story_key 已设置 | story-created | Step 03 | ✅ |
|
|
331
|
-
| Step 03 | story file 可读;validation_attempt 在步骤内重置为1 | story-validated | Step 04 | ✅ |
|
|
332
|
-
| Step 04 | dev-story workflow;TDD 流程 | development-complete | Step 05 | ✅ |
|
|
333
|
-
| Step 05 | code-review workflow;auto-fix HIGH/MEDIUM | code-review-complete | Step 06 或 Step 07 | ✅ |
|
|
334
|
-
| Step 06 | 真实数据测试;no mock | qa-testing-complete/failed | Step 08 或 Step 07 | ✅ |
|
|
335
|
-
| Step 07 | fix_source 已分类;max_fix_iterations 控制 | — | Step 08 或循环 Step 07 | ✅ |
|
|
336
|
-
| Step 08 | 全门禁通过;epic 完成检查 | story-completed | Step 09 | ✅ |
|
|
337
|
-
| Step 09 (batch) | sprint-status 刷新;找下一个 story | — | Step 02(循环)或 HALT | ✅ |
|
|
338
|
-
|
|
339
|
-
### 5.3 兼容性测试
|
|
340
|
-
|
|
341
|
-
| 测试项 | 状态 | 备注 |
|
|
342
|
-
|--------|------|------|
|
|
343
|
-
| Agent 菜单引用正确(analyst → AR, sm → ASP) | ✅ PASS | 触发器名称未被修改 |
|
|
344
|
-
| SKILL.md 入口文件完好 | ✅ PASS | 两个 pipeline 均指向 workflow.md |
|
|
345
|
-
| xiaoma-skill-manifest.yaml 未修改 | ✅ PASS | canonicalId 一致性保留 |
|
|
346
|
-
| checklist.md 与实际步骤匹配 | ✅ PASS | 需求 pipeline 8步覆盖,Story pipeline 覆盖全部产物 |
|
|
347
|
-
| 关联 workflow 路径引用未被破坏 | ✅ PASS | create-prd/validate-prd/create-epics/create-architecture 引用路径完整 |
|
|
348
|
-
|
|
349
|
-
### 5.4 Run #2 增量测试结果(2026-03-18)
|
|
350
|
-
|
|
351
|
-
**Run #1 优化验证(6项全部确认):**
|
|
352
|
-
|
|
353
|
-
| 优化 ID | 验证状态 | 验证方法 |
|
|
354
|
-
|---------|---------|---------|
|
|
355
|
-
| OPT-REQ-1 | ✅ 已实施 | 读取 step-06:Section 1 "Switch to PM Role" 确认存在 |
|
|
356
|
-
| OPT-REQ-2 | ✅ 已实施 | 读取 workflow.md:`{max_validation_iterations}` 条目在 State Variables 第5行 |
|
|
357
|
-
| OPT-REQ-3 | ✅ 已实施 | 读取 step-08:JSON 模板 `analysis/architecture/validation` 三字段无引号 |
|
|
358
|
-
| OPT-STORY-1 | ✅ 已实施 | 读取 step-09:Section 3.5 刷新逻辑 + Section 4.1 Finalization 刷新 |
|
|
359
|
-
| OPT-STORY-2 | ✅ 已实施 | 读取 workflow.md:`{max_fix_iterations}` 及所有状态计数变量的说明 |
|
|
360
|
-
| OPT-STORY-3 | ✅ 已实施 | 读取 step-07:`{fix_source}` 分类 + Section 6 差异化路由 |
|
|
361
|
-
|
|
362
|
-
**Run #2 新优化验证:**
|
|
363
|
-
|
|
364
|
-
| 测试项 | 状态 | 备注 |
|
|
365
|
-
|--------|------|------|
|
|
366
|
-
| step-05 Section 5 措辞已改为 "section 6 (Validation Passed)" | ✅ PASS | 读取文件第62行确认 |
|
|
367
|
-
| step-01 Section 5 ready-for-dev 路由已改为 "Start at step-03" | ✅ PASS | 读取文件第124行确认 |
|
|
368
|
-
| step-01 NEXT STEP 已新增 "IF starting at step-03" 独立条目 | ✅ PASS | 读取文件第138-139行确认 |
|
|
369
|
-
| step-01 "in-progress" 路由条目已从组合条目中拆分出来 | ✅ PASS | 读取文件第141-142行确认 |
|
|
370
|
-
| step-01 SUCCESS METRICS 路由映射说明已更新 | ✅ PASS | 读取文件最终确认 |
|
|
371
|
-
|
|
372
|
-
**全部 auto-requirements-pipeline 步骤完整性(增量确认):**
|
|
373
|
-
|
|
374
|
-
| 步骤 | frontmatter `name` | nextStepFile 指向正确 | 状态 |
|
|
375
|
-
|------|--------------------|-----------------------|------|
|
|
376
|
-
| step-01-init-and-validate | ✅ | step-02 | ✅ |
|
|
377
|
-
| step-02-requirements-analysis | ✅ | step-03 | ✅ |
|
|
378
|
-
| step-03-architecture-analysis | ✅ | step-04 | ✅ |
|
|
379
|
-
| step-04-create-prd | ✅ | step-05 | ✅ |
|
|
380
|
-
| step-05-validate-prd(已修正) | ✅ | step-06 | ✅ |
|
|
381
|
-
| step-06-create-epics(已优化) | ✅ | step-07 | ✅ |
|
|
382
|
-
| step-07-create-architecture | ✅ | step-08 | ✅ |
|
|
383
|
-
| step-08-finalize | ✅ | null(终止)| ✅ |
|
|
384
|
-
|
|
385
|
-
**全部 auto-story-pipeline 步骤路由一致性(增量确认):**
|
|
386
|
-
|
|
387
|
-
| 触发状态 | 初始/Resume 模式路由 | 批量循环模式路由 | 一致性 |
|
|
388
|
-
|---------|--------------------|--------------------|--------|
|
|
389
|
-
| backlog | step-02 | step-02(via step-09)| ✅ 一致 |
|
|
390
|
-
| ready-for-dev | step-03(本次修正后)| step-03(via step-02 skip)| ✅ 一致(修正前不一致) |
|
|
391
|
-
| in-progress | step-04 | step-04(via step-09 resume)| ✅ 一致 |
|
|
392
|
-
| review | step-05 | step-05(via step-09 resume)| ✅ 一致 |
|
|
393
|
-
|
|
394
|
-
---
|
|
395
|
-
|
|
396
|
-
## 6. 风险评估
|
|
397
|
-
|
|
398
|
-
| 风险 | 影响 | 缓解措施 |
|
|
399
|
-
|------|------|---------|
|
|
400
|
-
| OPT-STORY-3 引入 `{fix_source}` 新变量,旧版 LLM 可能不识别 | 中 | 轻量级内联复查设计(非强制委托);若 fix_source 无法确定,默认走最保守路径(code-review 路由) |
|
|
401
|
-
| step-07 的轻量级复查可能被 LLM 简化处理为"一律通过" | 低-中 | 步骤文件明确说明"do a focused inline verification of the fixed areas",要求针对具体问题复查,非全量审查 |
|
|
402
|
-
| step-09 刷新计数增加一次文件读取开销 | 极低 | 纯文件读取,无网络或计算开销;提升信息准确性的收益远大于成本 |
|
|
403
|
-
| OPT-REQ-3 JSON 类型修改在边缘情况下可能产生语法错误 | 低 | 若 iteration 变量未被正确替换(保持 `{analysis_iteration}` 字符串),JSON 会无效;但这与改变前相同,并非新引入的问题 |
|
|
404
|
-
| OPT-STORY-4 ready-for-dev 故事将额外经过 step-03 验证(Run #2 新增)| 低-极低 | 对于通过标准 create-story workflow 创建的故事,step-03 验证通常会通过(create-story 已内置质量控制)。极端情况下若 step-03 发现严重问题(readiness < 7/10),会增加修复次数,但这正是质量门禁的作用。已有 max 3 次自修复保障不无限阻塞。 |
|
|
405
|
-
|
|
406
|
-
---
|
|
407
|
-
|
|
408
|
-
## 7. 后续建议
|
|
409
|
-
|
|
410
|
-
### 7.1 短期(下一次分析周期)
|
|
411
|
-
|
|
412
|
-
1. **为 auto-requirements-pipeline 增加可选的 UX 设计步骤**
|
|
413
|
-
目前 pipeline 在 PRD→Epics 之间没有 UX 设计步骤。对于前端密集型项目,可以在 step-06 之前添加 `step-05b-create-ux-design.md`,当且仅当项目类型为 UI/frontend 时触发,委托给 `xiaoma-create-ux-design` workflow。
|
|
414
|
-
|
|
415
|
-
2. **为 auto-story-pipeline 增加 sprint-status 一致性验证**
|
|
416
|
-
batch 模式结束前,建议增加一个"Sprint Consistency Check":验证 story file 中的状态字段与 sprint-status.yaml 中的状态完全一致,防止部分写入导致的状态漂移。
|
|
417
|
-
|
|
418
|
-
3. **`pipeline-status.json` 被 auto-story-pipeline 读取的标准化**
|
|
419
|
-
step-01 in auto-story-pipeline 目前不读取 requirements pipeline 的 `pipeline-status.json`。建议在 step-01 的"Validate Prerequisites"中增加对 `pipeline-status.json` 的可选检查(如果存在,验证 requirements pipeline 已 complete),以防止在需求未完成时误启动 story pipeline。
|
|
420
|
-
|
|
421
|
-
### 7.2 中期(架构级改进)
|
|
422
|
-
|
|
423
|
-
4. **状态变量持久化**
|
|
424
|
-
当前所有状态变量(`{pipeline_status}`, `{steps_completed}` 等)仅存在于 LLM 上下文中,长会话中存在丢失风险。可以考虑将关键状态写入一个轻量的 `pipeline-run-state.json` 文件,支持从中断点恢复(类似 auto-requirements-pipeline 已有的 `pipeline-status.json`,但用于运行时状态而非完成状态)。
|
|
425
|
-
|
|
426
|
-
5. **批量模式进度持久化**
|
|
427
|
-
auto-story-pipeline 批量模式处理多个 story 时,若会话意外中断,需要从头重新选择起点。可以在 step-09 循环时将 `{stories_completed}` 和已处理的 story keys 写入状态文件,支持断点续批。
|
|
428
|
-
|
|
429
|
-
6. **Quality Gate 配置化**
|
|
430
|
-
目前多个质量门禁(validation score >= 7/10, max 3 validation attempts, max 5 fix iterations)是硬编码或半硬编码的。建议将这些阈值统一移至 `config.yaml`,允许项目级别的自定义。
|
|
431
|
-
|
|
432
|
-
### 7.3 长期(生态级改进)
|
|
433
|
-
|
|
434
|
-
7. **Pipeline 间的信号传递标准化**
|
|
435
|
-
当前两个 pipeline 的连接(requirements → story)是通过文档约定(用户手动运行 ASP)实现的。`pipeline-status.json` 为程序化连接奠定了基础,未来可以考虑一个"Master Pipeline Orchestrator",自动在 requirements pipeline 完成后触发 sprint planning 和 story pipeline。
|
|
436
|
-
|
|
437
|
-
8. **实现遥测与历史追踪**
|
|
438
|
-
目前每次运行都会覆盖输出产物。建议引入带时间戳的运行历史(如 `pipeline-runs/` 目录),记录每次运行的参数、迭代次数、成功/失败状态,支持跨版本的质量趋势分析。
|
|
439
|
-
|
|
440
|
-
---
|
|
441
|
-
|
|
442
|
-
---
|
|
443
|
-
|
|
444
|
-
## 8. 运行历史
|
|
445
|
-
|
|
446
|
-
| 运行次数 | 日期 | 类型 | 发现问题数 | 实施优化数 | 主要成果 |
|
|
447
|
-
|---------|------|------|----------|----------|---------|
|
|
448
|
-
| Run #1 | 2026-03-18 | 初始全量分析 | 6个 | 6个 | 建立基线:角色一致性、状态变量文档化、JSON类型修正、批量计数刷新、故障来源路由差异化 |
|
|
449
|
-
| Run #2 | 2026-03-18 | 增量分析 | 2个 | 2个 | 导航歧义修正(step-05)、ready-for-dev 路由一致性修正(step-01) |
|
|
450
|
-
|
|
451
|
-
**累计优化:8个 | 所有优化已验证在文件中实施 | 未发现破坏性变更**
|
|
452
|
-
|
|
453
|
-
---
|
|
454
|
-
|
|
455
|
-
*报告最后更新: 2026-03-18 (Run #2) | 下次分析建议: 实施后约2周进行增量分析*
|