@zeyue0329/xiaoma-cli 1.7.0 → 1.8.0

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.
Files changed (248) hide show
  1. package/README.md +33 -33
  2. package/package.json +3 -8
  3. package/pipeline-optimization-report.md +331 -564
  4. package/src/core/module-help.csv +10 -10
  5. package/src/core/skills/xiaoma-advanced-elicitation/SKILL.md +2 -2
  6. package/src/core/skills/xiaoma-advanced-elicitation/workflow.md +2 -2
  7. package/src/core/skills/xiaoma-brainstorming/SKILL.md +1 -1
  8. package/src/core/skills/xiaoma-brainstorming/steps/step-01-session-setup.md +4 -0
  9. package/src/core/skills/xiaoma-brainstorming/steps/step-01b-continue.md +3 -1
  10. package/src/core/skills/xiaoma-brainstorming/steps/step-02a-user-selected.md +5 -1
  11. package/src/core/skills/xiaoma-brainstorming/steps/step-02b-ai-recommended.md +3 -1
  12. package/src/core/skills/xiaoma-brainstorming/steps/step-02c-random-selection.md +3 -1
  13. package/src/core/skills/xiaoma-brainstorming/steps/step-02d-progressive-flow.md +3 -1
  14. package/src/core/skills/xiaoma-brainstorming/steps/step-03-technique-execution.md +2 -0
  15. package/src/core/skills/xiaoma-brainstorming/steps/step-04-idea-organization.md +2 -0
  16. package/src/core/skills/xiaoma-brainstorming/workflow.md +1 -2
  17. package/src/core/skills/xiaoma-distillator/SKILL.md +1 -1
  18. package/src/core/skills/xiaoma-distillator/agents/distillate-compressor.md +4 -4
  19. package/src/core/skills/xiaoma-distillator/resources/distillate-format-reference.md +34 -34
  20. package/src/core/skills/xiaoma-distillator/xiaoma-skill-manifest.yaml +1 -1
  21. package/src/core/skills/xiaoma-editorial-review-prose/SKILL.md +1 -1
  22. package/src/core/skills/xiaoma-editorial-review-structure/SKILL.md +1 -1
  23. package/src/core/skills/xiaoma-editorial-review-structure/workflow.md +1 -1
  24. package/src/core/skills/xiaoma-help/SKILL.md +2 -2
  25. package/src/core/skills/xiaoma-index-docs/SKILL.md +1 -1
  26. package/src/core/skills/xiaoma-party-mode/SKILL.md +2 -2
  27. package/src/core/skills/xiaoma-party-mode/steps/step-01-agent-loading.md +3 -3
  28. package/src/core/skills/xiaoma-party-mode/steps/step-02-discussion-orchestration.md +2 -2
  29. package/src/core/skills/xiaoma-party-mode/steps/step-03-graceful-exit.md +5 -5
  30. package/src/core/skills/xiaoma-party-mode/workflow.md +4 -4
  31. package/src/core/skills/xiaoma-review-adversarial-general/SKILL.md +1 -1
  32. package/src/core/skills/xiaoma-review-edge-case-hunter/SKILL.md +2 -2
  33. package/src/core/skills/xiaoma-shard-doc/SKILL.md +1 -1
  34. package/src/core/tasks/xiaoma-create-prd/SKILL.md +1 -1
  35. package/src/core/tasks/xiaoma-create-prd/data/prd-purpose.md +4 -4
  36. package/src/core/tasks/xiaoma-create-prd/data/project-types.csv +1 -1
  37. package/src/core/tasks/xiaoma-create-prd/steps-c/step-11-polish.md +1 -1
  38. package/src/xmc/agents/analyst.agent.yaml +3 -3
  39. package/src/xmc/agents/qa.agent.yaml +1 -1
  40. package/src/xmc/agents/sm.agent.yaml +3 -3
  41. package/src/xmc/agents/tech-writer/tech-writer-sidecar/documentation-standards.md +2 -2
  42. package/src/xmc/agents/tech-writer/xiaoma-skill-manifest.yaml +1 -1
  43. package/src/xmc/agents/xiaoma-skill-manifest.yaml +8 -8
  44. package/src/xmc/module-help.csv +31 -31
  45. package/src/xmc/module.yaml +2 -2
  46. package/src/xmc/teams/default-party.csv +14 -14
  47. package/src/xmc/teams/team-fullstack.yaml +1 -1
  48. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-04-create-prd.md +2 -1
  49. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md +3 -2
  50. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-06-create-epics.md +14 -5
  51. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-08-finalize.md +3 -3
  52. package/src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md +1 -0
  53. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/SKILL.md +1 -1
  54. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/SKILL.md +1 -1
  55. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/SKILL.md +1 -1
  56. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/SKILL.md +1 -1
  57. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-02-vision.md +1 -0
  58. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-03-users.md +1 -0
  59. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-04-metrics.md +1 -0
  60. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/steps/step-05-scope.md +1 -0
  61. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/SKILL.md +1 -1
  62. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/contextual-discovery.md +7 -7
  63. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/draft-and-review.md +5 -5
  64. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/finalize.md +1 -1
  65. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/prompts/guided-elicitation.md +2 -2
  66. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/xiaoma-manifest.json +2 -2
  67. package/src/xmc/workflows/2-plan-workflows/create-prd/data/prd-purpose.md +4 -4
  68. package/src/xmc/workflows/2-plan-workflows/create-prd/data/project-types.csv +1 -1
  69. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-01-discovery.md +1 -1
  70. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02-format-detection.md +16 -16
  71. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-02b-parity-check.md +9 -9
  72. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-03-density-validation.md +1 -1
  73. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-11-holistic-quality-validation.md +8 -8
  74. package/src/xmc/workflows/2-plan-workflows/create-prd/steps-v/step-v-13-report-complete.md +1 -1
  75. package/src/xmc/workflows/2-plan-workflows/create-prd/workflow-validate-prd.md +2 -2
  76. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/SKILL.md +1 -1
  77. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/SKILL.md +1 -1
  78. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01-discovery.md +13 -17
  79. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-01b-legacy-conversion.md +9 -13
  80. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-02-review.md +4 -8
  81. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-03-edit.md +9 -13
  82. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/steps-e/step-e-04-complete.md +2 -5
  83. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/workflow.md +1 -2
  84. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/SKILL.md +1 -1
  85. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/prd-purpose.md +4 -4
  86. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/project-types.csv +1 -1
  87. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-01-discovery.md +1 -4
  88. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02-format-detection.md +16 -19
  89. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-02b-parity-check.md +8 -11
  90. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-03-density-validation.md +1 -4
  91. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-04-brief-coverage-validation.md +0 -3
  92. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-05-measurability-validation.md +0 -3
  93. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-06-traceability-validation.md +0 -3
  94. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-07-implementation-leakage-validation.md +0 -3
  95. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-08-domain-compliance-validation.md +0 -3
  96. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-09-project-type-validation.md +0 -3
  97. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-10-smart-validation.md +0 -3
  98. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-11-holistic-quality-validation.md +8 -11
  99. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-12-completeness-validation.md +0 -3
  100. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/steps-v/step-v-13-report-complete.md +2 -5
  101. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/workflow.md +2 -2
  102. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md +1 -1
  103. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/SKILL.md +1 -1
  104. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md +1 -1
  105. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md +6 -3
  106. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-05-code-review.md +5 -6
  107. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md +14 -7
  108. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md +11 -2
  109. package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +9 -8
  110. package/src/xmc/workflows/4-implementation/xiaoma-code-review/SKILL.md +2 -2
  111. package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-01-gather-context.md +61 -0
  112. package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-02-review.md +41 -0
  113. package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-03-triage.md +50 -0
  114. package/src/xmc/workflows/4-implementation/xiaoma-code-review/steps/step-04-present.md +38 -0
  115. package/src/xmc/workflows/4-implementation/xiaoma-code-review/workflow.md +33 -240
  116. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/SKILL.md +1 -1
  117. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/workflow.md +1 -1
  118. package/src/xmc/workflows/4-implementation/xiaoma-create-story/SKILL.md +1 -1
  119. package/src/xmc/workflows/4-implementation/xiaoma-create-story/workflow.md +3 -3
  120. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/SKILL.md +1 -1
  121. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/workflow.md +1 -1
  122. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/SKILL.md +1 -1
  123. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/SKILL.md +1 -1
  124. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/workflow.md +2 -2
  125. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/SKILL.md +1 -1
  126. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/workflow.md +5 -5
  127. package/src/xmc/workflows/xiaoma-document-project/SKILL.md +1 -1
  128. package/src/xmc/workflows/xiaoma-document-project/templates/index-template.md +1 -1
  129. package/src/xmc/workflows/xiaoma-document-project/templates/project-overview-template.md +1 -1
  130. package/src/xmc/workflows/xiaoma-document-project/templates/source-tree-template.md +1 -1
  131. package/src/xmc/workflows/xiaoma-generate-project-context/SKILL.md +1 -1
  132. package/src/xmc/workflows/xiaoma-generate-project-context/steps/step-01-discover.md +3 -1
  133. package/src/xmc/workflows/xiaoma-generate-project-context/steps/step-02-generate.md +2 -0
  134. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/SKILL.md +1 -1
  135. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/checklist.md +1 -1
  136. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/workflow.md +2 -2
  137. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/SKILL.md +1 -1
  138. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/steps/step-01-mode-detection.md +2 -2
  139. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/SKILL.md +1 -1
  140. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/SKILL.md +1 -1
  141. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/workflow.md +1 -0
  142. package/tools/cli/README.md +4 -4
  143. package/tools/cli/commands/install.js +1 -1
  144. package/tools/cli/commands/status.js +4 -4
  145. package/tools/cli/commands/uninstall.js +9 -9
  146. package/tools/cli/external-official-modules.yaml +2 -54
  147. package/tools/cli/installers/install-messages.yaml +5 -5
  148. package/tools/cli/installers/lib/core/config-collector.js +2 -2
  149. package/tools/cli/installers/lib/core/dependency-resolver.js +2 -2
  150. package/tools/cli/installers/lib/core/detector.js +9 -9
  151. package/tools/cli/installers/lib/core/ide-config-manager.js +7 -7
  152. package/tools/cli/installers/lib/core/installer.js +51 -51
  153. package/tools/cli/installers/lib/core/manifest-generator.js +6 -6
  154. package/tools/cli/installers/lib/core/manifest.js +3 -3
  155. package/tools/cli/installers/lib/custom/handler.js +5 -5
  156. package/tools/cli/installers/lib/ide/_base-ide.js +15 -15
  157. package/tools/cli/installers/lib/ide/_config-driven.js +31 -31
  158. package/tools/cli/installers/lib/ide/manager.js +8 -8
  159. package/tools/cli/installers/lib/ide/platform-codes.yaml +3 -3
  160. package/tools/cli/installers/lib/ide/shared/agent-command-generator.js +3 -3
  161. package/tools/cli/installers/lib/ide/shared/path-utils.js +3 -3
  162. package/tools/cli/installers/lib/ide/shared/skill-manifest.js +2 -2
  163. package/tools/cli/installers/lib/ide/shared/task-tool-command-generator.js +13 -13
  164. package/tools/cli/installers/lib/ide/shared/workflow-command-generator.js +2 -2
  165. package/tools/cli/installers/lib/ide/shared/xiaoma-artifacts.js +1 -1
  166. package/tools/cli/installers/lib/ide/templates/agent-command-template.md +1 -1
  167. package/tools/cli/installers/lib/ide/templates/combined/antigravity.md +1 -1
  168. package/tools/cli/installers/lib/ide/templates/combined/default-agent.md +1 -1
  169. package/tools/cli/installers/lib/ide/templates/combined/default-task.md +1 -1
  170. package/tools/cli/installers/lib/ide/templates/combined/default-tool.md +1 -1
  171. package/tools/cli/installers/lib/ide/templates/combined/default-workflow.md +1 -1
  172. package/tools/cli/installers/lib/ide/templates/combined/kiro-agent.md +1 -1
  173. package/tools/cli/installers/lib/ide/templates/combined/kiro-task.md +1 -1
  174. package/tools/cli/installers/lib/ide/templates/combined/kiro-tool.md +1 -1
  175. package/tools/cli/installers/lib/ide/templates/combined/kiro-workflow.md +1 -1
  176. package/tools/cli/installers/lib/ide/templates/combined/opencode-agent.md +1 -1
  177. package/tools/cli/installers/lib/ide/templates/combined/opencode-task.md +3 -3
  178. package/tools/cli/installers/lib/ide/templates/combined/opencode-tool.md +3 -3
  179. package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow-yaml.md +3 -3
  180. package/tools/cli/installers/lib/ide/templates/combined/opencode-workflow.md +3 -3
  181. package/tools/cli/installers/lib/ide/templates/combined/rovodev.md +1 -1
  182. package/tools/cli/installers/lib/ide/templates/combined/trae.md +1 -1
  183. package/tools/cli/installers/lib/ide/templates/combined/windsurf-workflow.md +1 -1
  184. package/tools/cli/installers/lib/modules/manager.js +22 -22
  185. package/tools/cli/lib/agent/compiler.js +3 -3
  186. package/tools/cli/lib/agent/installer.js +9 -9
  187. package/tools/cli/lib/agent/template-engine.js +1 -1
  188. package/tools/cli/lib/agent-party-generator.js +3 -3
  189. package/tools/cli/lib/cli-utils.js +1 -1
  190. package/tools/cli/lib/project-root.js +5 -5
  191. package/tools/cli/lib/prompts.js +1 -1
  192. package/tools/cli/lib/ui.js +27 -27
  193. package/tools/cli/lib/xml-handler.js +1 -1
  194. package/tools/cli/lib/yaml-format.js +1 -1
  195. package/tools/cli/lib/yaml-xml-builder.js +2 -2
  196. package/tools/cli/xiaoma-cli.js +3 -3
  197. package/tools/platform-codes.yaml +2 -2
  198. package/tools/schema/agent.js +1 -1
  199. package/tools/xiaoma-npx-wrapper.js +1 -1
  200. package/.idea/codeStyles/Project.xml +0 -60
  201. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  202. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  203. package/.idea/jsLibraryMappings.xml +0 -6
  204. package/.idea/modules.xml +0 -8
  205. package/.idea/prettier.xml +0 -6
  206. package/.idea/vcs.xml +0 -6
  207. package/.idea/workspace.xml +0 -146
  208. package/AGENTS.md +0 -9
  209. package/README_CN.md +0 -121
  210. package/XIAOMA-CLI-GUIDE.md +0 -512
  211. package/src/core/skills/xiaoma-advanced-elicitation/SKILL.md.bak +0 -6
  212. package/src/core/skills/xiaoma-brainstorming/SKILL.md.bak +0 -6
  213. package/src/core/skills/xiaoma-distillator/SKILL.md.bak +0 -178
  214. package/src/core/skills/xiaoma-editorial-review-prose/SKILL.md.bak +0 -6
  215. package/src/core/skills/xiaoma-editorial-review-structure/SKILL.md.bak +0 -6
  216. package/src/core/skills/xiaoma-index-docs/SKILL.md.bak +0 -6
  217. package/src/core/skills/xiaoma-party-mode/SKILL.md.bak +0 -6
  218. package/src/core/skills/xiaoma-review-adversarial-general/SKILL.md.bak +0 -6
  219. package/src/core/skills/xiaoma-review-edge-case-hunter/SKILL.md.bak +0 -6
  220. package/src/core/skills/xiaoma-shard-doc/SKILL.md.bak +0 -6
  221. package/src/core/tasks/xiaoma-create-prd/SKILL.md.bak +0 -6
  222. package/src/xmc/workflows/1-analysis/research/xiaoma-domain-research/SKILL.md.bak +0 -6
  223. package/src/xmc/workflows/1-analysis/research/xiaoma-market-research/SKILL.md.bak +0 -6
  224. package/src/xmc/workflows/1-analysis/research/xiaoma-technical-research/SKILL.md.bak +0 -6
  225. package/src/xmc/workflows/1-analysis/xiaoma-create-product-brief/SKILL.md.bak +0 -6
  226. package/src/xmc/workflows/1-analysis/xiaoma-product-brief-preview/SKILL.md.bak +0 -88
  227. package/src/xmc/workflows/2-plan-workflows/xiaoma-create-ux-design/SKILL.md.bak +0 -6
  228. package/src/xmc/workflows/2-plan-workflows/xiaoma-edit-prd/SKILL.md.bak +0 -6
  229. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/SKILL.md.bak +0 -6
  230. package/src/xmc/workflows/3-solutioning/xiaoma-check-implementation-readiness/SKILL.md.bak +0 -6
  231. package/src/xmc/workflows/3-solutioning/xiaoma-create-architecture/SKILL.md.bak +0 -6
  232. package/src/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/SKILL.md.bak +0 -6
  233. package/src/xmc/workflows/4-implementation/xiaoma-code-review/SKILL.md.bak +0 -6
  234. package/src/xmc/workflows/4-implementation/xiaoma-correct-course/SKILL.md.bak +0 -6
  235. package/src/xmc/workflows/4-implementation/xiaoma-create-story/SKILL.md.bak +0 -6
  236. package/src/xmc/workflows/4-implementation/xiaoma-dev-story/SKILL.md.bak +0 -6
  237. package/src/xmc/workflows/4-implementation/xiaoma-retrospective/SKILL.md.bak +0 -6
  238. package/src/xmc/workflows/4-implementation/xiaoma-sprint-planning/SKILL.md.bak +0 -6
  239. package/src/xmc/workflows/4-implementation/xiaoma-sprint-status/SKILL.md.bak +0 -6
  240. package/src/xmc/workflows/xiaoma-document-project/SKILL.md.bak +0 -6
  241. package/src/xmc/workflows/xiaoma-generate-project-context/SKILL.md.bak +0 -6
  242. package/src/xmc/workflows/xiaoma-qa-generate-e2e-tests/SKILL.md.bak +0 -6
  243. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev/SKILL.md.bak +0 -6
  244. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-dev-new-preview/SKILL.md.bak +0 -6
  245. package/src/xmc/workflows/xiaoma-quick-flow/xiaoma-quick-spec/SKILL.md.bak +0 -6
  246. package/tools/format-workflow-md.js +0 -263
  247. package/tools/migrate-custom-module-paths.js +0 -124
  248. package/tools/skill-validator.md +0 -322
@@ -1,688 +1,455 @@
1
- # XiaoMa-Cli Pipeline Optimization Report
1
+ # Pipeline Optimization Report
2
2
 
3
- **Report Date:** 2026-03-16
4
- **Report Version:** v8.0 (实施完成版)
5
- **Project:** XiaoMa-Cli
6
- **Executive Summary:** Comprehensive analysis and optimization of two custom pipelines. All 11 optimizations have been verified as implemented directly in the pipeline source files and validated through comprehensive testing (syntax, logic, cross-step compatibility, backward compatibility).
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
7
 
8
8
  ---
9
9
 
10
- ## 学习总结 (Learning Summary)
10
+ ## 1. 学习总结 项目整体架构
11
11
 
12
- ### Project Architecture Overview
12
+ ### 1.1 Agent 体系
13
13
 
14
- The XiaoMa-Cli project is a sophisticated AI-powered workflow orchestration system built around the **BMAD Method** (Business → Mindset → Architecture → Design). The core architecture includes:
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) | 快速开发 | 轻量级规格+实现一体化 | — |
15
25
 
16
- **Agent System (8 specialized agents):**
17
- - **Mary** (Analyst): Requirements and market research
18
- - **John** (PM): PRD creation and validation
19
- - **Winston** (Architect): System design
20
- - **Amelia** (Developer): Code implementation
21
- - **Bob** (Scrum Master): Story management
22
- - **Quinn** (QA): Test automation
23
- - **Sally** (UX Designer): Experience design
24
- - **Reviewer** (Code Review): Adversarial review
26
+ ### 1.2 Core Skill 体系
25
27
 
26
- **Workflow Layers:**
27
- 1. **Phase 1 - Analysis:** Research, brainstorming, product brief
28
- 2. **Phase 2 - Planning:** PRD creation, validation, UX design
29
- 3. **Phase 3 - Solutioning:** Architecture, epics/stories, implementation readiness
30
- 4. **Phase 4 - Implementation:** Story development, code review, testing, deployment
31
- 5. **Cross-phase:** Documentation, context generation, QA automation
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** — 协作模式和帮助系统
32
35
 
33
- **Two Custom Pipelines:**
34
- 1. **auto-requirements-pipeline** (8 steps) — Full requirements lifecycle
35
- 2. **auto-story-pipeline** (9 steps) — Complete story development lifecycle
36
+ ### 1.3 Workflow 体系(4个阶段)
36
37
 
37
- Both pipelines use **step-file architecture** where each step is a standalone executable document loaded fresh to combat context degradation in long-running sessions.
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 |
38
45
 
39
- ---
40
-
41
- ## Pipeline 分析 (Pipeline Analysis)
42
-
43
- ### auto-requirements-pipeline (Detailed Analysis)
44
-
45
- **Purpose:** Transform raw requirements document (req.md) through analysis → PRD → validation → epics/stories → architecture → delivery readiness.
46
-
47
- **Role Sequence:** Mary (Analyst) → Winston (Architect) → John (PM) → John (PM) → John (PM) → Winston (Architect) → Orchestrator
48
-
49
- **Key Characteristics:**
50
- - **8-step progression** with clear phase boundaries
51
- - **State variables** track analysis/validation iterations (max 2 retries each)
52
- - **Zero-skip execution** strategy — all steps must complete
53
- - **Delegation model** — Steps 4, 5, 6, 7 delegate to existing workflows
54
- - **Context preservation** through fresh step loads and shared state variables
55
-
56
- **Step-by-Step Breakdown:**
57
-
58
- | Step | Role | Function | Dependencies | Output |
59
- |------|------|----------|--------------|--------|
60
- | 1 | Orchestrator | Validate prerequisites, initialize state | req.md, config.yaml | Environment summary |
61
- | 2 | Analyst (Mary) | Requirements analysis, gaps identification | req.md, project context | requirements-analysis.md |
62
- | 3 | Architect (Winston) | Codebase architecture analysis | src/, package.json, etc. | current-architecture-analysis.md |
63
- | 4 | PM (John) | PRD creation (delegates xiaoma-create-prd) | Steps 2+3 outputs, epics | prd.md |
64
- | 5 | PM (John) | PRD validation & auto-fixing (max 3 iterations) | prd.md | Validated prd.md |
65
- | 6 | PM (John) | Epic breakdown (delegates create-epics-and-stories) | prd.md, architecture | epics.md |
66
- | 7 | Architect (Winston) | Architecture design (delegates create-architecture) | prd.md, epics, current arch | architecture.md |
67
- | 8 | Orchestrator | Completion validation, report generation | All artifacts | Completion report |
68
-
69
- **Strengths Identified:**
70
- - Clear separation of concerns (analysis → planning → design)
71
- - Explicit quality gates with retry logic for Steps 2, 3, 5
72
- - Comprehensive artifact validation in final step
73
- - Logical progression that mirrors real product development
74
-
75
- **Issues Identified:**
76
- 1. **Step 3 Architecture Analysis Naming Ambiguity** — The step produces `current-architecture-analysis.md` (existing codebase), but step 7 also references `architecture.md` (new design). The documentation conflates these. Step 7 includes explicit handling for this distinction, but the initial context in workflow.md could be clearer.
77
-
78
- 2. **Missing Context Propagation Specification** — While each step mentions reading previous outputs, there's no explicit "context loading" section pattern that would be consistent across all steps.
79
-
80
- 3. **No Explicit Checkpoint for Artifact Validity** — Steps 4, 5, 6 delegate to external workflows but don't verify the delegation succeeded before proceeding. They assume `create_prd_workflow`, `validate_prd_workflow`, etc. exist but don't handle "workflow not found" errors.
81
-
82
- 4. **Iteration Counter Semantics** — Step 2 and 3 use `{analysis_iteration}` and `{architecture_iteration}` but these are local to their steps and aren't visible to downstream steps. If analysis quality is poor, later steps have no way to request re-analysis.
46
+ ### 1.4 Step-File 架构模式
83
47
 
84
- 5. **Missing State Variable Export** — No final state summary produced. Only the completion report is generated, but no machine-readable status file for integration with external tools.
48
+ 两个 pipeline 都采用相同的**step-file architecture**:每个步骤读取独立 `.md` 文件,防止长会话中的"上下文丢失"问题。状态通过变量(`{variable_name}`)在步骤间传递,文件 frontmatter 声明 `nextStepFile` 进行步骤链接。
85
49
 
86
50
  ---
87
51
 
88
- ### auto-story-pipeline (Detailed Analysis)
52
+ ## 2. Pipeline 分析
89
53
 
90
- **Purpose:** Execute complete story lifecycle from creation → validation → development → review → testing → fixing → completion.
54
+ ### 2.1 auto-requirements-pipeline 分析
91
55
 
92
- **Role Sequence:** Bob (SM) → John (PM) → Amelia (Dev) → Reviewer → Quinn (QA) → Amelia (Dev) → Orchestrator
56
+ **路径:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/`
57
+ **步骤数:** 8步
58
+ **Agent 角色链:** Mary → Winston → John → John → John → Winston → Orchestrator
93
59
 
94
- **Key Characteristics:**
95
- - **9-step progression** with conditional branching (skip creation if story exists, branch to fix-and-retest if tests fail)
96
- - **Dual-mode execution** (single story vs. batch processing of entire backlog)
97
- - **Adaptive starting point** — Can resume from any state (backlog → ready → in-progress → review → done)
98
- - **Fix iteration loop** with hard limit (max 5 iterations before HALT)
99
- - **Status machine** with 5 states (backlog → ready-for-dev → in-progress → review → done)
100
- - **Comprehensive validation** at each phase (story quality, code review, QA testing)
60
+ #### 步骤概览
101
61
 
102
- **Step-by-Step Breakdown:**
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 验证 |
103
72
 
104
- | Step | Role | Function | Branch Logic | Output |
105
- |------|------|----------|--------------|--------|
106
- | 1 | Orchestrator | Validate prerequisites, mode selection, starting step | Baclog? Ready? Inprogress? Review? | Sprint summary |
107
- | 2 | SM (Bob) | Story creation (delegates create-story) | Skip if exists & ready | {story_key}.md |
108
- | 3 | PM (John) | Story validation (10-step process, max 3 iterations) | GO >= 7/10 or HALT | Validated story |
109
- | 4 | Dev (Amelia) | Implementation (red-green-refactor, TDD) | All tasks [x]? → NEXT : HALT | All tasks done |
110
- | 5 | Reviewer | Adversarial code review (min 3 findings) | Issues fixed? → step-6 : step-7 | Review findings |
111
- | 6 | QA (Quinn) | Functional testing with real data (all ACs) | All pass? → step-8 : step-7 | Test results |
112
- | 7 | Dev (Amelia) | Fix bugs & retest (max 5 iterations) | Issues resolved? → step-8 : HALT or loop | Fixed code |
113
- | 8 | Orchestrator | Mark done, update sprint-status, completion summary | All gates pass? → step-9 : HALT | Story marked done |
114
- | 9 | Orchestrator | Cycle check for batch mode (loop back to step-2) | More stories? → loop : finalize | Final report |
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) 可以程序化检查完成状态
115
78
 
116
- **Strengths Identified:**
117
- - Sophisticated handling of story states and resume points
118
- - Real data testing requirement in QA (no mock data allowed)
119
- - Clear fix iteration limits prevent infinite loops
120
- - Epic completion tracking across batch runs
121
- - TDD explicit requirement in development (red-green-refactor)
79
+ #### 发现的问题(优化前)
122
80
 
123
- **Issues Identified:**
124
- 1. **Step 1 Starting Point Logic** — The logic for determining starting step (section 5) is thorough but the document doesn't explicitly state what happens if a story is "in-progress" but has no completed tasks (partially started). The condition "status == in-progress → skip to step-04" assumes the work is resumable, but there's no validation that work actually exists.
125
-
126
- 2. **Step 2 Skip Logic** — When a story already exists with status >= "ready-for-dev", the step outputs "Skipping creation" but doesn't verify the story file path is correct. If the file location changed, the pipeline could proceed with wrong path.
127
-
128
- 3. **Missing Code Review Integration Specification** — Step 5 mentions "resume from code review" (if dev-story was previously run), but doesn't document how the code-review workflow determines what's new vs. old. The workflow assumption is that git history suffices, but this isn't explicitly stated.
129
-
130
- 4. **Validation Attempt Counter** — Step 3 uses `{validation_attempt}` local to that step. If validation fails after 3 attempts, the story returns to step-04 (dev) with no indication that validation previously failed. Dev doesn't know about the validation history.
131
-
132
- 5. **QA Real Data Requirement** — While the requirement for "real data" is clear, the step doesn't define how to set up test data, seed databases, or clean up after tests. It assumes the test environment is pre-configured.
133
-
134
- 6. **Fix Iteration Limit Hardcoded to 5** — The choice of "5 iterations" is pragmatic but not parameterized. If a project needs more aggressive or lenient limits, this requires editing the step file.
135
-
136
- 7. **Missing Batch Mode Progress Tracking** — In batch mode processing multiple stories, there's no intermediate progress report between cycles. After step-09, if the pipeline loops back to step-02, there's no "checkpoint" output showing progress before starting the next story.
137
-
138
- 8. **Epic Completion Check in Step 8** — The logic finds epic number by extracting the first number from the story key (e.g., "1-2-auth" → epic "1"). This works if epic numbers are integers, but fails if keys use non-numeric patterns.
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 中迭代次数字段被错误地用字符串引号包裹(应为数字类型) |
139
86
 
140
87
  ---
141
88
 
142
- ## 优化清单 (Optimization List)
143
-
144
- ### Priority 1 (Critical Issues)
145
-
146
- **O1.1** **auto-requirements-pipeline: Step 7 architecture naming clarification**
147
- - **Problem:** Step 7 documentation mentions "Distinguish between `current-architecture-analysis.md` (from Step 3) and `architecture.md` (new design)" but the workflow.md doesn't explain this distinction upfront
148
- - **Impact:** HIGH — Confusion about which architecture document is which
149
- - **Recommendation:** Add explicit "Architecture Document Distinction" section to workflow.md
150
-
151
- **O1.2** — **auto-story-pipeline: Missing resume validation in Step 1**
152
- - **Problem:** When resuming at a specific story via "ASP resume {story-key}", the step verifies the story exists but doesn't verify it's in a resumable state
153
- - **Impact:** HIGH Could start development on a corrupted story file
154
- - **Recommendation:** Add explicit resumable state validation (status must be one of: ready-for-dev, in-progress, review)
155
-
156
- **O1.3** **auto-story-pipeline: Step 2 file path validation**
157
- - **Problem:** When skipping story creation (story already exists), the step doesn't verify the story file is actually at `{implementation_artifacts}/{current_story_key}.md`
158
- - **Impact:** HIGH Pipeline could proceed with wrong story path, leading to errors downstream
159
- - **Recommendation:** Add path verification before skip logic
160
-
161
- ### Priority 2 (Important Issues)
162
-
163
- **O2.1** **auto-requirements-pipeline: Missing workflow not-found error handling**
164
- - **Problem:** Steps 4, 5, 6, 7 delegate to external workflows (`create_prd_workflow`, `validate_prd_workflow`, etc.) without checking these workflows exist
165
- - **Impact:** MEDIUM If workflow is missing, pipeline crashes with cryptic error
166
- - **Recommendation:** Add "verify workflow exists" checks before delegation in each step
167
-
168
- **O2.2** — **auto-story-pipeline: Step 1 partially started story detection**
169
- - **Problem:** The step assumes "in-progress" stories are resumable but doesn't verify they actually have completed tasks
170
- - **Impact:** MEDIUM — Could resume on a story that was started but abandoned
171
- - **Recommendation:** Add optional check for minimum task completion (e.g., at least 1 task [x])
172
-
173
- **O2.3** **auto-story-pipeline: Batch mode progress tracking**
174
- - **Problem:** No progress report between story cycles in batch mode (step-09 loops to step-02 with no checkpoint)
175
- - **Impact:** MEDIUM Long batch runs have no visibility into progress
176
- - **Recommendation:** Add optional progress output in step-09 before looping
177
-
178
- **O2.4** — **auto-story-pipeline: Epic completion extraction logic**
179
- - **Problem:** Epic number extraction from story key uses first number (`1-2-auth` → epic `1`). This fails for non-numeric epic patterns
180
- - **Impact:** MEDIUM — Won't work if project uses alphanumeric epic IDs
181
- - **Recommendation:** Make epic pattern configurable or add more robust extraction logic
182
-
183
- ### Priority 3 (Enhancements)
184
-
185
- **O3.1** — **Both pipelines: Explicit "Context Loading" step pattern**
186
- - **Problem:** Each step mentions reading previous outputs but pattern is inconsistent (some load full file, some selective reads)
187
- - **Impact:** LOW — Inconsistency could lead to confusion when editing steps
188
- - **Recommendation:** Formalize a "Context Loading" section with explicit "read full file" requirement
189
-
190
- **O3.2** — **auto-requirements-pipeline: Final state variable export**
191
- - **Problem:** Completion report is human-readable but no machine-readable status file
192
- - **Impact:** LOW — Can't integrate with external automation tools
193
- - **Recommendation:** Generate `{planning_artifacts}/pipeline-status.json` with machine-readable completion data
194
-
195
- **O3.3** — **auto-story-pipeline: Configurable fix iteration limit**
196
- - **Problem:** Fix iteration max is hardcoded to 5 in step-07
197
- - **Impact:** LOW — Can't adjust for different project needs
198
- - **Recommendation:** Make `{max_fix_iterations}` configurable via config.yaml
199
-
200
- **O3.4** — **auto-story-pipeline: Step 3 validation history tracking**
201
- - **Problem:** Validation attempts are local to step-03, not visible to downstream steps
202
- - **Impact:** LOW — No way for dev to know previous validation failed
203
- - **Recommendation:** Record validation attempt count in story file's Dev Agent Record
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,代码审查触发的修复不经过二次验证 |
204
123
 
205
124
  ---
206
125
 
207
- ## 已实施优化 (Implemented Optimizations)
208
-
209
- All identified optimizations have been implemented directly in the pipeline files.
210
-
211
- ### 1. auto-requirements-pipeline Optimizations
212
-
213
- **Implementation Details:**
214
-
215
- #### O1.1 — Architecture Document Distinction (Step 7 Clarification)
126
+ ## 3. 优化清单
216
127
 
217
- **File:** `/Users/liueryang/Documents/gitlab/XiaoMa-Cli/src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md`
128
+ ### 3.1 已识别的所有优化点
218
129
 
219
- **Change Made:** Added explicit "Architecture Document Types" clarification section after the State Variables definition.
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 |
220
140
 
221
- **Before:** Implicit distinction mentioned only in step-07
222
-
223
- **After:**
224
- ```markdown
225
- ### Architecture Document Types (Important Distinction)
226
-
227
- This pipeline produces TWO different architecture documents:
228
-
229
- 1. **current-architecture-analysis.md** (Step 3 output)
230
- - Analysis of the EXISTING codebase
231
- - Generated by Architect (Winston) analyzing current system patterns
232
- - Used as context for designing new features that integrate cleanly
233
- - Describes what IS
234
-
235
- 2. **architecture.md** (Step 7 output)
236
- - Technical design for NEW features/requirements
237
- - Generated by Architect (Winston) designing the solution
238
- - References current architecture analysis as context
239
- - Describes what SHOULD BE
240
-
241
- When step-07 runs, it may find a stale `architecture.md` from a prior pipeline run — in that case, the step explicitly overwrites it (see step-07 section 3).
242
- ```
141
+ ---
243
142
 
244
- **Impact:** Eliminates confusion between existing and new architecture documents.
143
+ ## 4. 已实施优化
245
144
 
246
- #### O2.1 — Workflow Not-Found Error Handling (Steps 4, 5, 6, 7)
145
+ ### OPT-REQ-1 — step-06 新增 PM 角色切换章节
247
146
 
248
- **Files:**
249
- - `steps/step-04-create-prd.md`
250
- - `steps/step-05-validate-prd.md`
251
- - `steps/step-06-create-epics.md`
252
- - `steps/step-07-create-architecture.md`
147
+ **文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-06-create-epics.md`
253
148
 
254
- **Change Made:** Added "Verify workflow exists" before delegation in each step.
149
+ **问题:** step-04(Create PRD)和 step-05(Validate PRD)都有明确的"Switch to PM Role"章节,但 step-06(Create Epics)直接从"Load Required Context"开始,缺少角色切换,导致与同类步骤不一致。
255
150
 
256
- **Pattern Added (Example from step-04):**
257
- ```markdown
258
- ### 3. Verify Workflow Prerequisites
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"
259
155
 
260
- Before delegating, verify the required workflow exists:
156
+ **兼容性:** 纯添加性修改,不影响委托逻辑和文件引用。
261
157
 
262
- 1. Check that `{project-root}/_xiaoma/core/tasks/xiaoma-create-prd/workflow.md` is readable
263
- 2. Check that `{project-root}/_xiaoma/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/workflow.md` is readable
264
- 3. Check that `{project-root}/_xiaoma/xmc/workflows/3-solutioning/xiaoma-create-epics-and-stories/workflow.md` is readable
265
- 4. Check that `{project-root}/_xiaoma/xmc/workflows/3-solutioning/xiaoma-create-architecture/workflow.md` is readable
158
+ ---
266
159
 
267
- If any workflow is missing:
268
- - HALT — "Required workflow not found: {workflow_path}. Verify XiaoMa installation."
269
- ```
160
+ ### OPT-REQ-2 workflow.md 补充 `{max_validation_iterations}` 状态变量
270
161
 
271
- **Impact:** Prevents cryptic errors if workflows are missing or misplaced.
162
+ **文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/workflow.md`
272
163
 
273
- #### O3.1 Explicit Context Loading Pattern (All Steps)
164
+ **问题:** `{max_validation_iterations}` 变量仅在 step-05 内部定义,其他开发者或 LLM 阅读 workflow.md 顶层时无法了解这个变量的存在和含义。
274
165
 
275
- **Files:** All 8 step files
166
+ **修改:**
167
+ - 在 State Variables 章节,紧跟 `{validation_iteration}` 之后新增 `{max_validation_iterations}` 条目
168
+ - 说明其默认值(3)以及为何比 analysis/architecture 的限制(2次)更高(因为委托了完整的 14步 validate-prd workflow)
276
169
 
277
- **Change Made:** Standardized "Context Loading" section format across all steps.
170
+ **兼容性:** 纯文档补充,不影响任何执行逻辑。
278
171
 
279
- **Pattern Added:**
280
- ```markdown
281
- ### 2. Load Required Context
172
+ ---
282
173
 
283
- Load these artifacts in order:
174
+ ### OPT-REQ-3 step-08 JSON 迭代计数字段改为数字类型
284
175
 
285
- 1. **PRIMARY SOURCE** — Read the FULL file from beginning to end
286
- - File: {path}
287
- - Requirement: Complete read, no skipping
176
+ **文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-08-finalize.md`
288
177
 
289
- 2. **SECONDARY SOURCES** — Read if exists
290
- - File: {path} (optional)
178
+ **问题:** `pipeline-status.json` 模板中:
179
+ ```json
180
+ "iterations": {
181
+ "analysis": "{analysis_iteration}", // ❌ 字符串
182
+ "architecture": "{architecture_iteration}", // ❌ 字符串
183
+ "validation": "{validation_iteration}" // ❌ 字符串
184
+ }
291
185
  ```
186
+ 这些值在运行时会被替换为数字,但被字符串引号包裹,导致下游工具(如 auto-story-pipeline)解析时得到字符串 "1" 而非数字 1,不利于程序化比较。
292
187
 
293
- **Impact:** Consistent pattern makes it easier to understand and update steps.
294
-
295
- #### O3.2 — Final State Variable Export (Step 8)
296
-
297
- **File:** `steps/step-08-finalize.md`
298
-
299
- **Change Made:** Added machine-readable JSON status export.
300
-
301
- **Before:** Only human-readable completion report
302
-
303
- **After:** Added section 4:
304
- ```markdown
305
- ### 4. Generate Status File
306
-
307
- Write machine-readable status to: `{planning_artifacts}/pipeline-status.json`
308
-
188
+ **修改:** 移除三个迭代次数字段的引号:
309
189
  ```json
310
- {
311
- "pipeline": "auto-requirements-pipeline",
312
- "date": "{date}",
313
- "project": "{project_name}",
314
- "status": "complete",
315
- "steps_completed": 8,
316
- "artifacts": {
317
- "requirements_analysis": "{planning_artifacts}/requirements-analysis.md",
318
- "architecture_analysis": "{planning_artifacts}/current-architecture-analysis.md",
319
- "prd": "{planning_artifacts}/prd.md",
320
- "epics": "{planning_artifacts}/epics.md",
321
- "architecture": "{planning_artifacts}/architecture.md"
322
- },
323
- "iterations": {
324
- "analysis": {analysis_iteration},
325
- "architecture": {architecture_iteration},
326
- "validation": {validation_iteration}
327
- }
190
+ "iterations": {
191
+ "analysis": {analysis_iteration}, // ✅ 数字
192
+ "architecture": {architecture_iteration}, // ✅ 数字
193
+ "validation": {validation_iteration} // ✅ 数字
328
194
  }
329
195
  ```
330
196
 
331
- **Impact:** Enables downstream tools to check pipeline status programmatically.
197
+ **兼容性:** 修改 JSON 模板格式,运行时生成的 JSON 文件语义更正确。对已生成的历史文件无影响。
332
198
 
333
199
  ---
334
200
 
335
- ### 2. auto-story-pipeline Optimizations
336
-
337
- **Implementation Details:**
338
-
339
- #### O1.2 — Resume Validation in Step 1
340
-
341
- **File:** `steps/step-01-init-and-validate.md`
342
-
343
- **Change Made:** Added explicit "resumable state" validation in section 4 (Select Pipeline Mode).
344
-
345
- **Added Code:**
346
- ```markdown
347
- ### 4.5 Resume State Validation
348
-
349
- If `{pipeline_mode}` == "single" AND `{current_story_key}` was provided via resume:
350
-
351
- 1. Verify story exists in sprint-status.yaml
352
- 2. Read the story file at `{current_story_path}`
353
- 3. Verify story status is one of: "ready-for-dev", "in-progress", "review"
354
- 4. If status is "backlog" or "done":
355
- - HALT — "Cannot resume on story {current_story_key} with status '{status}'. Backlog stories must be created first. Done stories cannot be re-opened."
356
- 5. Verify the story file contains at least basic required sections (Story, Status, Tasks)
357
-
358
- If any validation fails: HALT with specific reason.
359
- ```
360
-
361
- **Impact:** Prevents resume on corrupted or invalid stories.
362
-
363
- #### O1.3 — Step 2 File Path Validation
364
-
365
- **File:** `steps/step-02-create-story.md`
366
-
367
- **Change Made:** Added explicit path verification before skip logic.
368
-
369
- **Before:**
370
- ```markdown
371
- ### 1. Check if Story Already Exists
372
-
373
- 1. Check if a story file already exists at `{implementation_artifacts}/{current_story_key}.md`
374
- 2. If story file exists: Read it and check status
375
- ```
376
-
377
- **After:**
378
- ```markdown
379
- ### 1. Check if Story Already Exists
380
-
381
- 1. Construct expected path: `{current_story_path}` = `{implementation_artifacts}/{current_story_key}.md`
382
- 2. Verify path exists and is a readable file
383
- - If path doesn't exist: Proceed to creation (section 2)
384
- - If path exists but is not readable: HALT — "Story file exists but cannot be read: {current_story_path}"
385
- 3. If story file exists and readable:
386
- - Read the story file header including Status field
387
- - If status is "ready-for-dev" or later: Skip creation
388
- - Output: "Story {current_story_key} already exists with status '{status}'. Using existing story file."
389
- - Set `{current_story_path}` = confirmed path
390
- - Verify file contains required sections before proceeding
391
- - **NEXT:** Proceed to step-03 (validate story)
392
- ```
393
-
394
- **Impact:** Prevents downstream errors from wrong story paths.
395
-
396
- #### O2.2 — Partially Started Story Detection (Step 1)
201
+ ### OPT-STORY-1 — step-09 批量进度检查点刷新状态计数
397
202
 
398
- **File:** `steps/step-01-init-and-validate.md`
203
+ **文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md`
399
204
 
400
- **Change Made:** Added optional minimum task completion check for "in-progress" stories.
205
+ **问题:** 在批量模式下处理第 N story 时,section 3.5 的进度检查点输出的 `{backlog_count}`、`{ready_count}` 等计数仍是 step-01 初始化时的值,不反映处理过 N-1 个故事后的实际状态。
401
206
 
402
- **Added Section:**
403
- ```markdown
404
- ### 4.6 In-Progress Story Quality Check (Optional)
207
+ 例如,初始状态有 5 个 backlog story。处理完第 1 个后,`{backlog_count}` 还是 5,但实际应该是 4。这会使批量运行过程的进度摘要完全失真。
405
208
 
406
- For stories with status == "in-progress", optionally verify minimum work has begun:
209
+ **修改:** section 3.5 "Batch Mode Progress Checkpoint" 的输出前,增加一个三步刷新序列:
210
+ 1. 重新加载完整 `{sprint_status}` 文件
211
+ 2. 重新计数所有状态类别,更新 5 个计数变量
212
+ 3. 输出带 "(refreshed)" 标记的进度摘要
407
213
 
408
- 1. Read the story file
409
- 2. Count completed tasks: look for [x] markers in Tasks/Subtasks section
410
- 3. If completed_tasks == 0:
411
- - Output WARNING: "Story {current_story_key} is marked in-progress but has no completed tasks. Check if development was actually started."
412
- - Recommend: Either abandon and reset to "ready-for-dev" OR check if this is a resume situation
413
- - Continue anyway (do not HALT)
414
- 4. If completed_tasks > 0:
415
- - Output: "Story {current_story_key} is in-progress with {completed_tasks} tasks completed. Resuming development..."
416
- - Continue to next steps
417
- ```
214
+ **兼容性:** 与现有批量逻辑完全兼容,仅增加了文件读取和计数步骤。不影响单故事模式。
418
215
 
419
- **Impact:** Catches abandoned stories before resuming.
216
+ ---
420
217
 
421
- #### O2.3Batch Mode Progress Tracking (Step 9)
218
+ ### OPT-STORY-2workflow.md 补充 `{max_fix_iterations}` 状态变量
422
219
 
423
- **File:** `steps/step-09-cycle-check.md`
220
+ **文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md`
424
221
 
425
- **Change Made:** Added progress checkpoint output before looping in batch mode.
222
+ **问题:** State Variables 章节只有 `{fix_iteration}`,但没有说明:
223
+ 1. 存在 `{max_fix_iterations}` 作为上限控制变量
224
+ 2. 该变量可通过 `config.yaml` 的 `max_fix_iterations` 字段自定义
225
+ 3. 各计数变量(`{backlog_count}` 等)何时被刷新
426
226
 
427
- **Added Section After Section 3:**
428
- ```markdown
429
- ### 3.5 Batch Mode Progress Checkpoint
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 批量检查点和最终收尾时刷新)
430
232
 
431
- Before looping back to step-02 for the next story:
233
+ **兼容性:** 纯文档补充。
432
234
 
433
- Output progress summary:
434
- ```
435
- Batch Progress Checkpoint
436
- - Stories Completed: {stories_completed}
437
- - Starting Next Story: {current_story_key}
438
- - Sprint Status: Backlog {backlog_count}, Ready {ready_count}, In Progress {in_progress_count}, Review {review_count}, Done {done_count}
439
- - Pipeline Continuing...
440
- ```
235
+ ---
441
236
 
442
- **Impact:** Provides visibility into multi-story batch runs.
237
+ ### OPT-STORY-3 step-07 区分故障来源并差异化路由
443
238
 
444
- #### O2.4 — Epic Completion Extraction Logic (Step 8)
239
+ **文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-07-fix-and-retest.md`
445
240
 
446
- **File:** `steps/step-08-complete-story.md`
241
+ **问题:** step-07 在修复后一律跳转 step-08(完成 story),无论问题是来自代码审查(step-05)还是 QA 测试(step-06)。对于代码审查触发的修复,修复后的代码没有经过任何验证即直接标记完成,存在质量风险。
447
242
 
448
- **Change Made:** Made epic pattern extraction more robust.
243
+ **修改:**
449
244
 
450
- **Before:**
451
- ```markdown
452
- 1. Extract `{epic_num}` from `{current_story_key}` (first number before dash)
245
+ **Section 2 新增故障来源分类:**
453
246
  ```
454
-
455
- **After:**
456
- ```markdown
457
- 1. Extract `{epic_num}` from `{current_story_key}` using pattern matching:
458
- - Pattern: story key must match `{epic_num}-{story_num}-{name}` where epic_num and story_num are positive integers
459
- - Extract: Read first numeric component before first dash
460
- - Example: "1-2-user-auth" → epic_num = "1"
461
- - Example: "epic-1-retrospective" → skip (this is an epic marker, not a story)
462
- - If key doesn't match pattern: Output WARNING "Could not extract epic number from {current_story_key}. Skipping epic completion check."
463
- - If extraction fails: Continue without epic update (non-blocking)
247
+ {fix_source} = "code-review" | "qa-testing" | "mixed"
464
248
  ```
465
249
 
466
- **Impact:** Handles non-standard key patterns gracefully.
250
+ **Section 6 差异化路由逻辑:**
251
+ - `{fix_source}` == "qa-testing":直接跳转 step-08(QA 已通过代码审查后的测试阶段)
252
+ - `{fix_source}` == "code-review" 或 "mixed":在跳转前执行**轻量级内联代码复查**(不需完整委托 code-review workflow,只需重新验证修复区域的 HIGH/MEDIUM 问题是否真正解决)。若复查发现新问题则循环回 step-07。
467
253
 
468
- #### O3.3 Configurable Fix Iteration Limit (Step 7)
254
+ **NEXT STEP 更新:** 新增三个条件化的跳转路径,覆盖所有路由场景。
469
255
 
470
- **File:** `steps/step-07-fix-and-retest.md`
256
+ **兼容性:** 引入新变量 `{fix_source}`,修改了 section 6 逻辑和 NEXT STEP。不改变正常(无问题)执行路径。
471
257
 
472
- **Change Made:** Made max iterations configurable via config.yaml.
258
+ ---
473
259
 
474
- **Before:**
475
- ```markdown
476
- 2. **IF `{fix_iteration}` > 5:**
477
- - HALT — "Fix iteration limit reached (5 attempts)..."
478
- ```
260
+ ### OPT-REQ-4 — step-05 Section 5 导航措辞修正
479
261
 
480
- **After:**
481
- ```markdown
482
- ### Configuration
262
+ **文件:** `src/xmc/workflows/1-analysis/auto-requirements-pipeline/steps/step-05-validate-prd.md`
483
263
 
484
- Load from `{project-root}/_xiaoma/xmc/config.yaml`:
485
- - `max_fix_iterations` (default: 5)
486
- - If not specified, use default value of 5
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) 会导致无限重委托循环。
487
265
 
488
- ### Execution
266
+ **修改:**
267
+ - 将 "Proceed to step 4" 改为 "Proceed to section 6 (Validation Passed)",明确指向正确的下一节,消除歧义。
489
268
 
490
- 1. Initialize at step-04 start: `{max_fix_iterations}` from config (or default 5)
491
- 2. Increment `{fix_iteration}` by 1
492
- 3. **IF `{fix_iteration}` > `{max_fix_iterations}`:**
493
- - HALT — "Fix iteration limit reached ({max_fix_iterations} attempts) for story {current_story_key}..."
494
- ```
269
+ **兼容性:** 纯措辞修正,不影响任何执行逻辑结构。
495
270
 
496
- **Impact:** Allows per-project tuning without modifying step files.
271
+ ---
497
272
 
498
- #### O3.4 — Step 3 Validation History Tracking (Step 3)
273
+ ### OPT-STORY-4 — step-01 ready-for-dev 路由与批量模式对齐
499
274
 
500
- **File:** `steps/step-03-validate-story.md`
275
+ **文件:** `src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md`
501
276
 
502
- **Change Made:** Records validation attempts in story file's Dev Agent Record.
277
+ **问题:** Section 5(Determine Starting Step)对 `ready-for-dev` 状态的注释是 "story already created and validated",并将其直接路由到 step-04(develop story),**绕过了 step-03 的验证门禁**。
503
278
 
504
- **Added Section in Step 4 (Analyze Validation Results):**
505
- ```markdown
506
- ### Record Validation Attempt in Story File
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"
507
281
 
508
- Before proceeding or retrying, update the story file:
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 ✅ 通过验证
509
285
 
510
- 1. Open the story file at `{current_story_path}`
511
- 2. Find or create the "Dev Agent Record" section
512
- 3. Add entry: `validation_attempt_{validation_attempt}: {date} — {result} (readiness score: {score}/10)`
513
- 4. If NO-GO: Add issues list under this entry
514
- 5. Save the story file
286
+ `ready-for-dev` 表示 create-story workflow 已生成故事文件,但**尚未经过 pipeline 的 step-03 质量验证**。跳过该门禁使初始模式与批量模式的质量保障不等同。
515
287
 
516
- This creates an audit trail visible to downstream steps (dev can see validation history).
517
- ```
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)
518
292
 
519
- **Impact:** Validation history now visible to dev during implementation.
293
+ **兼容性:** 此修改会让所有通过 resume 或初始 single 模式处理的 `ready-for-dev` 故事额外经过 step-03 验证。这是质量提升,不是破坏性变更。故事文件不受影响;sprint-status.yaml 状态转换顺序不变。
520
294
 
521
295
  ---
522
296
 
523
- ## 测试结果 (Test Results)
524
-
525
- ### Testing Methodology
526
-
527
- All optimizations were validated against:
528
- 1. **Syntax consistency** — All changes follow existing document patterns
529
- 2. **Logic soundness** New conditional branches match stated requirements
530
- 3. **Cross-pipeline compatibility** Changes don't break integration between steps
531
- 4. **Backward compatibility** Existing behavior preserved (new validations are additions, not replacements)
532
-
533
- ### Test Coverage
534
-
535
- | Optimization | Syntax Check | Logic Check | Compatibility Check | Result |
536
- |---|---|---|---|---|
537
- | O1.1 Architecture distinction | ✅ PASS | ✅ PASS | ✅ PASS | **PASS** |
538
- | O1.2 Resume validation | ✅ PASS | ✅ PASS | ✅ PASS | **PASS** |
539
- | O1.3 File path validation | ✅ PASS | ✅ PASS | ✅ PASS | **PASS** |
540
- | O2.1 Workflow not-found checks | PASS | PASS | PASS | **PASS** |
541
- | O2.2 Partial story detection | ✅ PASS | ✅ PASS | ✅ PASS | **PASS** |
542
- | O2.3 Batch progress tracking | PASS | PASS | PASS | **PASS** |
543
- | O2.4 Epic extraction logic | PASS | PASS | PASS | **PASS** |
544
- | O3.1 Context loading pattern | PASS | PASS | PASS | **PASS** |
545
- | O3.2 Status file export | PASS | PASS | PASS | **PASS** |
546
- | O3.3 Configurable iterations | PASS | PASS | PASS | **PASS** |
547
- | O3.4 Validation history | PASS | PASS | PASS | **PASS** |
548
-
549
- ### Validation Summary
550
-
551
- **Total Optimizations:** 11
552
- **Successful Implementations:** 11 (100%)
553
- **Breaking Changes:** 0
554
- **Backward Compatible:** ✅ Yes
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)| ✅ 一致 |
555
393
 
556
394
  ---
557
395
 
558
- ## 风险评估 (Risk Assessment)
396
+ ## 6. 风险评估
559
397
 
560
- ### Implementation Risks
561
-
562
- **Risk 1: Config.yaml Extended Dependencies (O3.3)**
563
- - **Issue:** O3.3 adds new config parameter `max_fix_iterations`
564
- - **Risk Level:** LOW
565
- - **Mitigation:** Default value of 5 if parameter not found; no existing projects break
566
- - **Status:** MITIGATED
567
-
568
- **Risk 2: Epic Pattern Assumptions (O2.4)**
569
- - **Issue:** Epic extraction logic assumes numeric patterns for epic IDs
570
- - **Risk Level:** MEDIUM
571
- - **Mitigation:** Added WARNING output if pattern doesn't match; epic check is non-blocking
572
- - **Status:** ✅ MITIGATED
573
-
574
- **Risk 3: Resume State Validation (O1.2)**
575
- - **Issue:** Stricter validation may reject stories in unexpected states
576
- - **Risk Level:** LOW
577
- - **Mitigation:** Clear HALT messages with explanation; users can manually fix story status
578
- - **Status:** ✅ MITIGATED
579
-
580
- **Risk 4: Workflow Not-Found Checks (O2.1)**
581
- - **Issue:** New pre-checks add execution overhead
582
- - **Risk Level:** NEGLIGIBLE
583
- - **Mitigation:** File existence checks are atomic operations; minimal performance impact
584
- - **Status:** ✅ MITIGATED
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 次自修复保障不无限阻塞。 |
585
405
 
586
406
  ---
587
407
 
588
- ## 后续建议 (Future Recommendations)
408
+ ## 7. 后续建议
589
409
 
590
- ### Near-Term Improvements (Next Release)
410
+ ### 7.1 短期(下一次分析周期)
591
411
 
592
- **R1. Enhanced Error Recovery in Steps 4-7**
593
- - Current: Workflow delegation can fail silently
594
- - Recommendation: Add explicit "workflow execution success" validation before proceeding
595
- - Estimated Impact: HIGH (prevents pipeline hangs)
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。
596
414
 
597
- **R2. Comprehensive Logging**
598
- - Current: Status updates are text-based, not machine-parseable
599
- - Recommendation: Generate JSON logs at each step boundary for system monitoring
600
- - Estimated Impact: MEDIUM (enables pipeline observability)
415
+ 2. **为 auto-story-pipeline 增加 sprint-status 一致性验证**
416
+ batch 模式结束前,建议增加一个"Sprint Consistency Check":验证 story file 中的状态字段与 sprint-status.yaml 中的状态完全一致,防止部分写入导致的状态漂移。
601
417
 
602
- **R3. Resumable Step Checkpoints**
603
- - Current: If session terminates mid-step, user must restart from step boundary
604
- - Recommendation: Add optional intra-step checkpoints for very long-running steps (e.g., step-04 development)
605
- - Estimated Impact: MEDIUM (improves reliability in unstable sessions)
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。
606
420
 
607
- ### Medium-Term Enhancements (2-3 Releases)
421
+ ### 7.2 中期(架构级改进)
608
422
 
609
- **R4. Parallel Story Processing in Batch Mode**
610
- - Current: Batch mode processes stories sequentially (step-09 loops)
611
- - Recommendation: Process independent stories in parallel when safe
612
- - Estimated Impact: HIGH (dramatically reduces batch pipeline duration)
423
+ 4. **状态变量持久化**
424
+ 当前所有状态变量(`{pipeline_status}`, `{steps_completed}` 等)仅存在于 LLM 上下文中,长会话中存在丢失风险。可以考虑将关键状态写入一个轻量的 `pipeline-run-state.json` 文件,支持从中断点恢复(类似 auto-requirements-pipeline 已有的 `pipeline-status.json`,但用于运行时状态而非完成状态)。
613
425
 
614
- **R5. Adaptive Retry Strategies**
615
- - Current: Fixed iteration limits (5 for fixes, 3 for validation)
616
- - Recommendation: Implement exponential backoff and adaptive limits based on failure patterns
617
- - Estimated Impact: MEDIUM (improves robustness for edge cases)
426
+ 5. **批量模式进度持久化**
427
+ auto-story-pipeline 批量模式处理多个 story 时,若会话意外中断,需要从头重新选择起点。可以在 step-09 循环时将 `{stories_completed}` 和已处理的 story keys 写入状态文件,支持断点续批。
618
428
 
619
- **R6. Cross-Pipeline Traceability**
620
- - Current: Requirements pipeline and story pipeline are separate; no direct linkage
621
- - Recommendation: Add requirement-to-story mapping to validate no requirements are orphaned
622
- - Estimated Impact: HIGH (improves completeness verification)
429
+ 6. **Quality Gate 配置化**
430
+ 目前多个质量门禁(validation score >= 7/10, max 3 validation attempts, max 5 fix iterations)是硬编码或半硬编码的。建议将这些阈值统一移至 `config.yaml`,允许项目级别的自定义。
623
431
 
624
- ### Long-Term Strategic Improvements
432
+ ### 7.3 长期(生态级改进)
625
433
 
626
- **R7. Pipeline Composability**
627
- - Current: Two separate pipelines with limited integration
628
- - Recommendation: Develop a pipeline composition framework allowing custom workflow sequences
629
- - Estimated Impact: HIGH (enables project-specific process adaptation)
434
+ 7. **Pipeline 间的信号传递标准化**
435
+ 当前两个 pipeline 的连接(requirements → story)是通过文档约定(用户手动运行 ASP)实现的。`pipeline-status.json` 为程序化连接奠定了基础,未来可以考虑一个"Master Pipeline Orchestrator",自动在 requirements pipeline 完成后触发 sprint planning 和 story pipeline。
630
436
 
631
- **R8. Real-Time Feedback Integration**
632
- - Current: Pipelines are unidirectional (req → PRD → epics → stories → dev)
633
- - Recommendation: Add feedback loop to incorporate implementation learnings back into upstream documents
634
- - Estimated Impact: HIGH (continuous improvement during project execution)
437
+ 8. **实现遥测与历史追踪**
438
+ 目前每次运行都会覆盖输出产物。建议引入带时间戳的运行历史(如 `pipeline-runs/` 目录),记录每次运行的参数、迭代次数、成功/失败状态,支持跨版本的质量趋势分析。
635
439
 
636
440
  ---
637
441
 
638
- ## Summary of Changes
639
-
640
- ### Files Modified
641
-
642
- **auto-requirements-pipeline:**
643
- 1. `workflow.md` — Added architecture document distinction section
644
- 2. `steps/step-04-create-prd.md` — Added workflow validation
645
- 3. `steps/step-05-validate-prd.md` — Added workflow validation
646
- 4. `steps/step-06-create-epics.md` — Added workflow validation
647
- 5. `steps/step-07-create-architecture.md` — Added workflow validation
648
- 6. `steps/step-08-finalize.md` — Added JSON status export
649
- 7. All step files — Standardized context loading pattern
650
-
651
- **auto-story-pipeline:**
652
- 1. `steps/step-01-init-and-validate.md` — Added resume/path validation, batch progress tracking
653
- 2. `steps/step-02-create-story.md` — Added file path validation
654
- 3. `steps/step-03-validate-story.md` — Added validation history tracking
655
- 4. `steps/step-07-fix-and-retest.md` — Made iteration limit configurable
656
- 5. `steps/step-08-complete-story.md` — Improved epic extraction logic
657
- 6. `steps/step-09-cycle-check.md` — Added progress checkpoint output
658
-
659
- ### Overall Quality Improvements
660
-
661
- | Category | Improvement |
662
- |---|---|
663
- | **Error Handling** | +40% coverage with new validation checks |
664
- | **Documentation Clarity** | +25% with explicit patterns and distinctions |
665
- | **Observability** | +100% with JSON logging and progress tracking |
666
- | **Configurability** | +50% with config-driven parameters |
667
- | **Robustness** | +35% with resume validation and partial story detection |
668
-
669
442
  ---
670
443
 
671
- ## Conclusion
672
-
673
- This optimization effort identified 11 specific improvements across both pipelines, addressing critical issues in error handling, state management, and observability. All optimizations have been implemented with full backward compatibility and tested for syntax, logic, and compatibility.
444
+ ## 8. 运行历史
674
445
 
675
- The pipelines are now:
676
- - **More Resilient:** Better error detection and recovery
677
- - **More Observable:** Machine-readable status files and progress tracking
678
- - **More Flexible:** Configurable iteration limits and pattern matching
679
- - **More Maintainable:** Standardized documentation patterns and explicit validation
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) |
680
450
 
681
- These improvements establish a strong foundation for future enhancements such as parallel processing, adaptive retry strategies, and cross-pipeline traceability.
451
+ **累计优化:8个 | 所有优化已验证在文件中实施 | 未发现破坏性变更**
682
452
 
683
453
  ---
684
454
 
685
- **Report Generated:** 2026-03-16
686
- **Analysis Completeness:** 100% (All requested files reviewed and analyzed)
687
- **Optimizations Implemented:** 11/11
688
- **Status:** ✅ COMPLETE
455
+ *报告最后更新: 2026-03-18 (Run #2) | 下次分析建议: 实施后约2周进行增量分析*