@zeyue0329/xiaoma-cli 1.11.0 → 1.13.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 (81) hide show
  1. package/.playwright-cli/console-2026-05-13T06-36-26-793Z.log +2 -0
  2. package/.playwright-cli/page-2026-05-13T06-36-27-725Z.yml +1 -0
  3. package/CLAUDE.md +25 -7
  4. package/XiaoMa-CLI-2026H2-/350/277/255/344/273/243/350/247/204/345/210/222.pptx +0 -0
  5. package/demo/xiaoma-bug-circle-resolve/SKILL.md +6 -0
  6. package/demo/xiaoma-bug-circle-resolve/workflow.md +254 -0
  7. package/demo/xiaoma-bug-resolve/SKILL.md +6 -0
  8. package/demo/xiaoma-bug-resolve/workflow.md +269 -0
  9. package/demo/xiaoma-prd-saas-zh/README.md +57 -0
  10. package/demo/xiaoma-prd-saas-zh/domain-research.md +128 -0
  11. package/demo/xiaoma-prd-saas-zh/epics.md +303 -0
  12. package/demo/xiaoma-prd-saas-zh/market-research-2026-q1.md +183 -0
  13. package/demo/xiaoma-prd-saas-zh/prd-bad-examples.md +268 -0
  14. package/demo/xiaoma-prd-saas-zh/prd.md +409 -0
  15. package/demo/xiaoma-prd-saas-zh/product-brief.md +97 -0
  16. package/demo/xiaoma-prd-saas-zh/validation-report.md +279 -0
  17. package/docs/roadshow/01-/351/241/271/347/233/256/346/246/202/350/247/210/344/270/216/346/236/266/346/236/204.md +189 -0
  18. package/docs/roadshow/02-/346/231/272/350/203/275/344/275/223/347/263/273/347/273/237/350/257/246/350/247/243.md +464 -0
  19. package/docs/roadshow/03-/346/231/272/350/203/275/344/275/223/344/272/244/344/272/222/346/265/201/347/250/213/345/233/276.md +334 -0
  20. package/docs/roadshow/04-/345/267/245/344/275/234/346/265/201/346/211/247/350/241/214/350/257/246/350/247/243.md +1038 -0
  21. package/docs/roadshow/05-/346/212/200/346/234/257/345/256/236/347/216/260/344/270/216/345/210/233/346/226/260/344/272/256/347/202/271.md +205 -0
  22. package/docs/roadshow/06-/350/267/257/346/274/224/346/200/273/347/273/223/344/270/216/346/274/224/347/244/272/345/273/272/350/256/256.md +167 -0
  23. package/media/doc1_fig1.png +0 -0
  24. package/media/doc1_fig2.png +0 -0
  25. package/media/doc1_fig3.png +0 -0
  26. package/media/doc1_fig4.png +0 -0
  27. package/media/doc2_fig1.png +0 -0
  28. package/media/doc2_fig2.png +0 -0
  29. package/media/doc2_fig3.png +0 -0
  30. package/media/doc2_fig4.png +0 -0
  31. package/media/doc3_fig1.png +0 -0
  32. package/media/doc3_fig2.png +0 -0
  33. package/media/doc3_fig3.png +0 -0
  34. package/media/doc3_fig4.png +0 -0
  35. package/media/doc4_fig1.png +0 -0
  36. package/media/doc4_fig2.png +0 -0
  37. package/media/doc4_fig3.png +0 -0
  38. package/media/doc5_fig1.png +0 -0
  39. package/media/doc5_fig2.png +0 -0
  40. package/media/doc5_fig3.png +0 -0
  41. package/package.json +1 -1
  42. package/patent-disclosure-optimized/SKILL.md +416 -0
  43. package/patent-disclosure-optimized/references/disclosure-template.md +84 -0
  44. package/patent-disclosure-optimized/references/docx-format-spec.md +183 -0
  45. package/patent-disclosure-optimized/references/mining-principles.md +168 -0
  46. package/patent-disclosure-optimized/scripts/md2docx.js +777 -0
  47. package/src/core/tasks/xiaoma-create-prd/data/prd-purpose.md +157 -0
  48. package/src/core/tasks/xiaoma-create-prd/data/upstream-input-contract.md +168 -0
  49. package/src/core/tasks/xiaoma-create-prd/templates/prd-skeleton-reference.md +428 -0
  50. package/src/core/tasks/xiaoma-create-prd/templates/prd-template.md +101 -3
  51. package/src/xmc/agents/sm.agent.yaml +9 -1
  52. package/src/xmc/workflows/2-plan-workflows/xiaoma-validate-prd/data/prd-quality-rubric.csv +14 -0
  53. package/src/xmc/workflows/4-implementation/auto-story-pipeline/SKILL.md +1 -1
  54. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-01-init-and-validate.md +10 -13
  55. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-02-create-story.md +0 -1
  56. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-08-complete-story.md +3 -4
  57. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-finalize.md +69 -0
  58. package/src/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md +9 -14
  59. package/src/xmc/workflows/4-implementation/auto-story-pipeline/xiaoma-skill-manifest.yaml +1 -1
  60. package/src/xmc/workflows/4-implementation/auto-story-pipeline-batch/SKILL.md +6 -0
  61. package/src/xmc/workflows/4-implementation/auto-story-pipeline-batch/workflow.md +333 -0
  62. package/src/xmc/workflows/4-implementation/auto-story-pipeline-batch/xiaoma-skill-manifest.yaml +3 -0
  63. package/src/xmc/workflows/5-full-pipeline/auto-full-pipeline/steps/step-01-init-and-validate.md +2 -2
  64. package/src/xmc/workflows/5-full-pipeline/auto-full-pipeline/steps/step-04-run-story-pipeline.md +30 -41
  65. package/src/xmc/workflows/5-full-pipeline/auto-full-pipeline/steps/step-05-finalize.md +2 -2
  66. package/src/xmc/workflows/5-full-pipeline/auto-full-pipeline/workflow.md +7 -9
  67. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/SKILL.md +6 -0
  68. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/checklist.md +43 -0
  69. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-01-init-and-validate.md +155 -0
  70. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-02-create-epics.md +156 -0
  71. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-03-bridge-sprint-planning.md +143 -0
  72. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-04-batch-create-stories.md +309 -0
  73. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/steps/step-05-finalize.md +311 -0
  74. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/workflow.md +105 -0
  75. package/src/xmc/workflows/5-full-pipeline/auto-prd-to-stories/xiaoma-skill-manifest.yaml +3 -0
  76. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_1_/351/235/242/345/220/221AI/346/231/272/350/203/275/344/275/223/347/232/204/345/244/232/351/200/232/351/201/223/344/276/235/350/265/226_20260318.md +483 -0
  77. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_2_/345/237/272/344/272/216/351/205/215/347/275/256/351/251/261/345/212/250/347/232/204/350/267/250/345/271/263/345/217/260IDE/346/231/272/350/203/275_20260318.md +592 -0
  78. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_3_AI/346/231/272/350/203/275/344/275/223/345/243/260/346/230/216/345/274/217/345/256/232/344/271/211/347/232/204/347/274/226/350/257/221/346/265/201/346/260/264_20260318.md +624 -0
  79. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_4_/345/237/272/344/272/216/345/223/210/345/270/214/346/214/207/347/272/271/347/232/204/346/231/272/350/203/275/344/275/223/351/231/204/345/261/236/350/265/204/346/272/220/351/200/211_20260318.md +628 -0
  80. package//344/270/223/345/210/251/344/272/244/345/272/225/344/271/246_5_AI/346/231/272/350/203/275/344/275/223/350/247/246/345/217/221/346/214/207/344/273/244/347/232/204/345/244/215/345/220/210/346/240/274/345/274/217/346/240/241_20260318.md +652 -0
  81. package/src/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md +0 -147
@@ -5,7 +5,6 @@ nextStepFile: "./step-03-validate-story.md"
5
5
  input_variables:
6
6
  - "epic_key"
7
7
  - "story_template"
8
- - "batch_mode"
9
8
  output_variables:
10
9
  - "created_story"
11
10
  - "story_details"
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: "step-08-complete-story"
3
3
  description: "Mark story as done, update sprint-status, and generate completion summary"
4
- nextStepFile: "./step-09-cycle-check.md"
4
+ nextStepFile: "./step-09-finalize.md"
5
5
  ---
6
6
 
7
7
  # Step 8 of 9: Complete Story
@@ -88,14 +88,13 @@ Pipeline Phases Completed:
88
88
  ### 6. Pipeline Status Update
89
89
 
90
90
  - Set `{pipeline_status}` = "story-completed"
91
- - Reset `{fix_iteration}` = 0 (for next story if batch mode)
92
91
  - Set `{steps_completed}` = `{steps_completed}` + 1
93
92
 
94
93
  ---
95
94
 
96
95
  ## NEXT STEP
97
96
 
98
- **NEXT:** Read fully and follow: `{project-root}/_xiaoma/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-cycle-check.md`
97
+ **NEXT:** Read fully and follow: `{project-root}/_xiaoma/xmc/workflows/4-implementation/auto-story-pipeline/steps/step-09-finalize.md`
99
98
 
100
99
  ---
101
100
 
@@ -112,4 +111,4 @@ Pipeline Phases Completed:
112
111
  - Marking story done without verifying all gates
113
112
  - Not updating sprint-status.yaml
114
113
  - Not checking epic-level completion
115
- - Not resetting fix_iteration for next story
114
+ - Not generating completion summary
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: "step-09-finalize"
3
+ description: "Finalize the single-story pipeline run and output completion report."
4
+ nextStepFile: null
5
+ ---
6
+
7
+ # Step 9 of 9: Pipeline Finalization
8
+
9
+ **Goal:** Generate the final completion report for this single-story pipeline run.
10
+
11
+ **Role:** Pipeline Orchestrator
12
+
13
+ ---
14
+
15
+ ## EXECUTION SEQUENCE
16
+
17
+ ### 1. Refresh Sprint Status
18
+
19
+ 1. Load the FULL file: `{sprint_status}`
20
+ 2. Read ALL lines from beginning to end — do not skip any content
21
+ 3. Recount all stories by current status:
22
+ - `{backlog_count}` — Stories with status "backlog"
23
+ - `{ready_count}` — Stories with status "ready-for-dev"
24
+ - `{in_progress_count}` — Stories with status "in-progress"
25
+ - `{review_count}` — Stories with status "review"
26
+ - `{done_count}` — Stories with status "done"
27
+
28
+ ### 2. Generate Final Report
29
+
30
+ Output:
31
+ ```
32
+ Auto Story Pipeline — COMPLETE
33
+
34
+ Pipeline Summary:
35
+ - Mode: single
36
+ - Story Processed: {current_story_key}
37
+ - Steps Executed: {steps_completed}
38
+ - Pipeline Status: finalized
39
+
40
+ Sprint Status (current):
41
+ - Backlog: {backlog_count} remaining
42
+ - Ready for Dev: {ready_count}
43
+ - In Progress: {in_progress_count}
44
+ - In Review: {review_count}
45
+ - Done: {done_count}
46
+
47
+ The automated story development pipeline has finished.
48
+ ```
49
+
50
+ **IF `{backlog_count}` == 0 AND `{ready_count}` == 0 AND `{in_progress_count}` == 0 AND `{review_count}` == 0:**
51
+ - Output: "All stories in the sprint are complete! Consider running epic-retrospective (ER) to review the work."
52
+
53
+ **IF `{backlog_count}` > 0 OR `{ready_count}` > 0:**
54
+ - Output: "There are still {backlog_count + ready_count} pending stories. Run ASPB (`/xiaoma-auto-story-pipeline-batch`) to process all remaining stories in batch mode, or run ASP again to process the next story."
55
+
56
+ **HALT** — Pipeline complete.
57
+
58
+ ---
59
+
60
+ ## SUCCESS METRICS
61
+
62
+ - Final sprint status refreshed from disk
63
+ - Comprehensive completion report generated
64
+ - User informed of remaining stories and next steps
65
+
66
+ ## FAILURE MODES
67
+
68
+ - Not refreshing sprint status before generating report
69
+ - Skipping final report generation
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: auto-story-pipeline
3
- description: "Automated end-to-end story development pipeline: create → validate → develop → review → test → fix → done. Use when the user says 'run auto pipeline', 'automate story development', or 'auto story pipeline'"
3
+ description: "Automated end-to-end story development pipeline (single story): create → validate → develop → review → test → fix → done. Use when the user says 'run auto pipeline', 'automate story development', or 'auto story pipeline'. For batch processing of all stories, use xiaoma-auto-story-pipeline-batch (ASPB) instead."
4
4
  ---
5
5
 
6
6
  # Auto Story Pipeline Workflow
7
7
 
8
- **Goal:** Execute the complete automated story development lifecycle — from story creation through validation, development, code review, testing, bug fixing, and final delivery — as a single continuous pipeline.
8
+ **Goal:** Execute the complete automated story development lifecycle for a **single story** — from story creation through validation, development, code review, testing, bug fixing, and final delivery — as a single continuous pipeline.
9
9
 
10
10
  **Your Role:** Pipeline Orchestrator. You switch expert roles at each phase:
11
11
  - **SM (xiaomin)** — Story creation and sprint coordination
@@ -19,6 +19,8 @@ description: "Automated end-to-end story development pipeline: create → valida
19
19
  - Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution until the pipeline is COMPLETE or a HALT condition is triggered
20
20
  - Each step file loads fresh to combat "lost in the middle" context degradation
21
21
 
22
+ > **Note:** This workflow processes a **single story** (or resumes a specific story). For batch processing of all backlog stories, use the **Auto Story Pipeline Batch** skill (`ASPB` or `/xiaoma-auto-story-pipeline-batch`), which uses Agent subprocess isolation for each story.
23
+
22
24
  ---
23
25
 
24
26
  ## WORKFLOW ARCHITECTURE
@@ -32,22 +34,15 @@ This uses **step-file architecture** for focused execution across a long-running
32
34
 
33
35
  ### State Variables
34
36
 
35
- - `{pipeline_mode}` — "single" (one story) or "batch" (all backlog stories)
37
+ - `{pipeline_mode}` — "single" (process next backlog story) or "resume" (resume a specific story by key)
36
38
  - `{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). **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
- - `{fix_iteration}` — Bug fix loop counter (max controlled by `{max_fix_iterations}`, default 5; reset per story)
39
+ - `{current_story_path}` — Full path to current story file (derived in step-01 after resolving `{current_story_key}`). 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, as intermediate steps (step-04, step-05, step-06, step-07) may have modified the file
40
+ - `{fix_iteration}` — Bug fix loop counter (max controlled by `{max_fix_iterations}`, default 5)
39
41
  - `{max_fix_iterations}` — Maximum fix-and-retest cycles per story (configurable via `max_fix_iterations` in config.yaml; default 5 if not set)
40
42
  - `{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)
41
- - `{stories_completed}` — Count of stories completed in this pipeline run
42
43
  - `{pipeline_status}` — Current pipeline phase for tracking
43
- - `{validation_attempt}` — Story validation attempt counter (used in step-03, max 3; re-initialized at start of step-03 for each story)
44
- - `{steps_completed}` — Count of pipeline step files executed in this run (initialized to 0 in step-01; accumulates across all stories in batch mode)
45
- - `{backlog_count}` — Count of stories with status "backlog" (initialized in step-01; refreshed in step-09 batch checkpoints and final finalization)
46
- - `{ready_count}` — Count of stories with status "ready-for-dev" (initialized in step-01; refreshed in step-09)
47
- - `{in_progress_count}` — Count of stories with status "in-progress" (initialized in step-01; refreshed in step-09)
48
- - `{review_count}` — Count of stories with status "review" (initialized in step-01; refreshed in step-09)
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
44
+ - `{validation_attempt}` — Story validation attempt counter (used in step-03, max 3; re-initialized at start of step-03)
45
+ - `{steps_completed}` — Count of pipeline step files executed in this run (initialized to 0 in step-01)
51
46
 
52
47
  ### Status Machine
53
48
 
@@ -1,3 +1,3 @@
1
1
  canonicalId: xiaoma-auto-story-pipeline
2
2
  type: workflow
3
- description: "Automated end-to-end story development pipeline. Use when the user says 'run auto pipeline', 'automate story development', or 'auto story pipeline'"
3
+ description: "Automated end-to-end story development pipeline (single story). Use when the user says 'run auto pipeline', 'automate story development', or 'auto story pipeline'. For batch processing, use xiaoma-auto-story-pipeline-batch (ASPB)."
@@ -0,0 +1,6 @@
1
+ ---
2
+ name: auto-story-pipeline-batch
3
+ description: "Batch automated story development pipeline with Agent subprocess isolation. Processes ALL backlog stories sequentially, each in an independent Agent context. Use when the user says 'batch story pipeline', 'ASB', 'auto story batch', or 'batch auto pipeline'"
4
+ ---
5
+
6
+ Follow the instructions in [workflow.md](workflow.md).
@@ -0,0 +1,333 @@
1
+ ---
2
+ name: auto-story-pipeline-batch
3
+ description: "Batch automated story development pipeline with Agent subprocess isolation. Each story is processed in an independent Agent context to prevent context bloat. Use when the user says 'batch story pipeline', 'ASPB', 'auto story batch', or 'batch auto pipeline'"
4
+ ---
5
+
6
+ # Auto Story Pipeline — Batch Mode (Agent Subprocess Isolation)
7
+
8
+ **Goal:** Execute the complete automated story development lifecycle for ALL backlog stories — processing each story in an **independent Agent subprocess** to prevent context bloat and ensure isolation. Fully automatic from start to finish, zero human intervention until the queue is empty.
9
+
10
+ **Your Role:** Pipeline Batch Scheduler. You coordinate the batch loop, delegating each story's full lifecycle (create → validate → develop → review → test → fix → done) to independent Agent subprocesses. You stay lightweight — query queue, launch Agent, read results, continue or finalize.
11
+
12
+ - Communicate all responses in {communication_language} and generate all documents in {document_output_language}
13
+ - Absolutely DO NOT stop because of "milestones", "significant progress", or "session boundaries". Continue in a single execution until ALL stories are processed or a HALT condition is triggered
14
+ - **Fully automatic, no human intervention** — From start to finish, user needs no commands
15
+
16
+ ---
17
+
18
+ ## Core Architecture: Agent-Isolated Processing
19
+
20
+ **Why this architecture:** Each story is delegated to an **independent Agent subprocess**. Agents naturally have isolated context spaces, releasing upon completion without polluting the main conversation. The main conversation only handles lightweight scheduling loops.
21
+
22
+ ```
23
+ Main conversation (scheduler, minimal context)
24
+ ├── Agent #1 → Process Story A (isolated context, released after completion)
25
+ ├── Agent #2 → Process Story B (isolated context, released after completion)
26
+ ├── Agent #3 → Process Story C (isolated context, released after completion)
27
+ └── ...until queue is empty
28
+ ```
29
+
30
+ ### Core Rules (Strictly Follow)
31
+
32
+ 1. **Each story processed by independent Agent** — Use Agent tool to launch general-purpose subprocess, pass complete story info and processing instructions to Agent, Agent independently completes the full story lifecycle (step-02 through step-08)
33
+ 2. **Main loop stays lightweight** — Main conversation only: query sprint-status → launch Agent → read Agent results → query remaining → continue or end
34
+ 3. **Serial processing** — Process one story at a time, wait for Agent completion before next, avoid concurrent modification conflicts
35
+ 4. **Fully automatic, no human intervention** — From start to finish, user needs no commands
36
+
37
+ ---
38
+
39
+ ## INITIALIZATION
40
+
41
+ ### Configuration Loading
42
+
43
+ Load config from `{project-root}/_xiaoma/xmc/config.yaml` and resolve:
44
+
45
+ - `project_name`, `user_name`
46
+ - `communication_language`, `document_output_language`
47
+ - `user_skill_level`
48
+ - `planning_artifacts`, `implementation_artifacts`
49
+ - `max_fix_iterations` (default: 5 if not set)
50
+ - `date` as system-generated current datetime
51
+
52
+ ### Paths
53
+
54
+ - `story_pipeline_path` = `{project-root}/_xiaoma/xmc/workflows/4-implementation/auto-story-pipeline`
55
+ - `sprint_status` = `{implementation_artifacts}/sprint-status.yaml`
56
+ - `validation_checklist` = `{story_pipeline_path}/checklist.md`
57
+
58
+ ### Related Workflows (Passed to Agent)
59
+
60
+ These paths will be passed to each Agent subprocess so it can delegate to existing workflow logic:
61
+
62
+ - `create_story_workflow` = `{project-root}/_xiaoma/xmc/workflows/4-implementation/xiaoma-create-story/workflow.md`
63
+ - `dev_story_workflow` = `{project-root}/_xiaoma/xmc/workflows/4-implementation/xiaoma-dev-story/workflow.md`
64
+ - `code_review_workflow` = `{project-root}/_xiaoma/xmc/workflows/4-implementation/xiaoma-code-review/workflow.md`
65
+ - `qa_test_workflow` = `{project-root}/_xiaoma/xmc/workflows/xiaoma-qa-generate-e2e-tests/workflow.md`
66
+
67
+ ### Context
68
+
69
+ - `project_context` = `**/project-context.md` (load if exists)
70
+
71
+ ---
72
+
73
+ ## WORKFLOW
74
+
75
+ <workflow>
76
+
77
+ <step n="1" goal="Validate environment, analyze sprint status, and display overview">
78
+
79
+ ### 1.1 Validate Prerequisites
80
+
81
+ Check that the following required artifacts exist:
82
+
83
+ 1. **Epics File** — `{planning_artifacts}/*epic*.md` must exist
84
+ - If missing: HALT — "No epics file found. Run the planning workflow first to create epics."
85
+
86
+ 2. **Sprint Status File** — `{sprint_status}` must exist
87
+ - If missing:
88
+ a. Output INFO — "sprint-status.yaml not found. Auto-generating via Sprint Planning..."
89
+ b. Read and follow the sprint-planning workflow: `{project-root}/_xiaoma/xmc/workflows/4-implementation/xiaoma-sprint-planning/workflow.md`
90
+ c. After sprint-planning completes, verify `{sprint_status}` now exists
91
+ d. If still missing: HALT — "Failed to auto-generate sprint-status.yaml. Run Sprint Planning (SP) manually."
92
+
93
+ 3. **Planning Artifacts** — At least one of `{planning_artifacts}/*prd*.md` or `{planning_artifacts}/*architecture*.md` should exist
94
+ - If missing: Output warning but continue — "Planning documents not found. Story creation may have limited context."
95
+
96
+ ### 1.2 Analyze Sprint Status
97
+
98
+ 1. Load the FULL file: `{sprint_status}`
99
+ 2. Read ALL lines from beginning to end — do not skip any content
100
+ 3. Parse the `development_status` section completely
101
+ 4. Count stories by status:
102
+ - `backlog_count` — Stories with status "backlog"
103
+ - `ready_count` — Stories with status "ready-for-dev"
104
+ - `in_progress_count` — Stories with status "in-progress"
105
+ - `review_count` — Stories with status "review"
106
+ - `done_count` — Stories with status "done"
107
+ 5. If `backlog_count` == 0 AND `ready_count` == 0:
108
+ - HALT — "No backlog or ready-for-dev stories found. All stories are either in-progress, in review, or done."
109
+
110
+ ### 1.3 Display Overview and Begin
111
+
112
+ **Output:**
113
+
114
+ ```
115
+ ===============================================
116
+ Auto Story Pipeline — Batch Mode
117
+ (Agent Subprocess Isolation)
118
+ ===============================================
119
+
120
+ Sprint Status Summary:
121
+ - Backlog: {backlog_count} stories
122
+ - Ready for Dev: {ready_count} stories
123
+ - In Progress: {in_progress_count} stories
124
+ - Review: {review_count} stories
125
+ - Done: {done_count} stories
126
+
127
+ Processing all {backlog_count + ready_count} pending stories sequentially.
128
+ Each story will be processed in an independent Agent subprocess.
129
+
130
+ Starting fully automatic batch processing...
131
+ -----------------------------------------------
132
+ ```
133
+
134
+ Initialize tracking variables:
135
+ - `stories_completed` = 0
136
+ - `stories_failed` = 0
137
+ - `failed_story_keys` = [] (empty list — tracks story keys that failed, to avoid infinite loops)
138
+ - `story_results` = [] (empty list — accumulates result summaries for the final report)
139
+
140
+ Enter Step 2 to start the batch loop.
141
+
142
+ </step>
143
+
144
+ <step n="2" goal="Loop: process each story in an independent Agent subprocess (fully automatic)">
145
+
146
+ <!-- Loop start: find the next processable story -->
147
+
148
+ ### 2.1 Find Next Processable Story
149
+
150
+ 1. Load the FULL file: `{sprint_status}` (always fresh read from disk)
151
+ 2. Read ALL lines from beginning to end
152
+ 3. Parse the `development_status` section completely
153
+ 4. Find the FIRST story (reading top to bottom) where:
154
+ - Key matches pattern: number-number-name (e.g., "1-2-user-auth")
155
+ - NOT an epic key (epic-X) or retrospective (epic-X-retrospective)
156
+ - Key is NOT in the `failed_story_keys` list (skip previously failed stories to avoid infinite loops)
157
+ - Status value equals "backlog"
158
+ 5. If no "backlog" story found, search again for the FIRST story with status "ready-for-dev" (also skipping `failed_story_keys`)
159
+ 6. If no processable story found: queue is empty, go to Step 3
160
+
161
+ ### 2.2 Output Progress
162
+
163
+ ```
164
+ Processing story: {current_story_key} (status: {current_story_status})
165
+ Stories completed so far: {stories_completed}
166
+ ```
167
+
168
+ ### 2.3 Launch Independent Agent Subprocess
169
+
170
+ <critical>
171
+
172
+ Use the Agent tool to launch a **general-purpose subprocess** to process this story.
173
+
174
+ The Agent's prompt MUST contain the following complete information for independent work:
175
+
176
+ **1. Story Information:**
177
+ - Story key: `{current_story_key}`
178
+ - Current status: `{current_story_status}` (backlog or ready-for-dev)
179
+ - Story file path: `{implementation_artifacts}/{current_story_key}.md`
180
+
181
+ **2. Configuration (inline all resolved values):**
182
+ - project_name: `{project_name}`
183
+ - user_name: `{user_name}`
184
+ - communication_language: `{communication_language}`
185
+ - document_output_language: `{document_output_language}`
186
+ - user_skill_level: `{user_skill_level}`
187
+ - planning_artifacts: `{planning_artifacts}`
188
+ - implementation_artifacts: `{implementation_artifacts}`
189
+ - sprint_status: `{sprint_status}`
190
+ - max_fix_iterations: `{max_fix_iterations}`
191
+ - date: current datetime
192
+
193
+ **3. Workflow Paths (for delegation):**
194
+ - create_story_workflow: `{create_story_workflow}`
195
+ - dev_story_workflow: `{dev_story_workflow}`
196
+ - code_review_workflow: `{code_review_workflow}`
197
+ - qa_test_workflow: `{qa_test_workflow}`
198
+ - validation_checklist: `{validation_checklist}`
199
+
200
+ **4. Project Context:**
201
+ - Include the content of project-context.md if it exists (pass the actual content, not just the path)
202
+
203
+ **5. Processing Instructions:**
204
+
205
+ Tell the Agent to execute the following steps sequentially for the story. The Agent should read and follow each step file from the story pipeline:
206
+
207
+ a. **IF story status is "backlog":** Read and follow `{story_pipeline_path}/steps/step-02-create-story.md` — Create the user story file
208
+ b. Read and follow `{story_pipeline_path}/steps/step-03-validate-story.md` — PM validation (quality gate, max 3 attempts)
209
+ c. Read and follow `{story_pipeline_path}/steps/step-04-develop-story.md` — Development implementation (TDD)
210
+ d. Read and follow `{story_pipeline_path}/steps/step-05-code-review.md` — Adversarial code review (auto-fix HIGH/MEDIUM issues)
211
+ e. Read and follow `{story_pipeline_path}/steps/step-06-test-story.md` — QA functional testing (real data, no mocks)
212
+ f. Read and follow `{story_pipeline_path}/steps/step-07-fix-and-retest.md` — Fix-and-retest loop if needed (max {max_fix_iterations} iterations)
213
+ g. Read and follow `{story_pipeline_path}/steps/step-08-complete-story.md` — Mark story done, update sprint-status.yaml
214
+
215
+ **Important instructions for the Agent:**
216
+ - Execute ALL steps in exact order; do NOT skip steps
217
+ - If story status is "ready-for-dev", skip step-02 (creation) and start at step-03 (validation)
218
+ - **CRITICAL: After completing step-08, STOP immediately. Do NOT continue to step-09-finalize.md.** Step-08's "NEXT STEP" section points to step-09, but you must ignore that instruction. Step-09 is for single-story mode finalization only. In batch mode, the main scheduler handles finalization. After step-08 completes, return the STORY_RESULT summary below and exit.
219
+ - Do NOT stop because of "milestones" or "significant progress" — continue until the story is DONE (step-08 completed) or a HALT condition is triggered
220
+ - Each step file loads fresh to combat context degradation — read each step file fully before executing
221
+ - When reading the story file in later steps, always perform a FRESH read from disk (the file may have been modified by earlier steps)
222
+ - Initialize `fix_iteration` = 0 and `validation_attempt` = 0 at the start
223
+
224
+ **6. Return Format:**
225
+ When done, return a structured summary:
226
+ ```
227
+ STORY_RESULT:
228
+ - story_key: {story_key}
229
+ - final_status: done | halted | failed
230
+ - fix_iterations_used: {count}
231
+ - validation_attempts: {count}
232
+ - files_modified: [list of files]
233
+ - summary: {one-line description of what was done}
234
+ - error: {error message if halted/failed, empty otherwise}
235
+ ```
236
+
237
+ </critical>
238
+
239
+ ### 2.4 Read Agent Result and Handle Errors
240
+
241
+ Read the Agent's returned processing result summary.
242
+
243
+ **IF the Agent succeeded (returned `final_status: done`):**
244
+ - Increment `stories_completed` counter
245
+ - Record the story result in `story_results` list
246
+
247
+ **IF the Agent failed or halted (returned `final_status: failed` or `halted`, or produced no result / error):**
248
+ - Increment `stories_failed` counter
249
+ - Add the story key to `failed_story_keys` list (prevents re-selecting this story in the next loop iteration)
250
+ - Record the failure result in `story_results` list (including error details)
251
+ - **Do NOT halt the batch** — continue to the next story
252
+ - Output: "Story {current_story_key} failed/halted. Skipping and continuing to next story."
253
+
254
+ ### 2.5 Output Progress
255
+
256
+ 1. Output brief one-line result for this story
257
+
258
+ ### 2.6 Refresh Sprint Status and Check Remaining
259
+
260
+ 1. Re-read `{sprint_status}` from disk (fresh read)
261
+ 2. Recount stories by status:
262
+ - Update `backlog_count`, `ready_count`, `in_progress_count`, `review_count`, `done_count`
263
+ 3. Output batch progress checkpoint:
264
+
265
+ ```
266
+ ===============================================
267
+ Batch Progress Checkpoint
268
+ ===============================================
269
+ - Stories Completed So Far: {stories_completed}
270
+ - Sprint Status (refreshed): Backlog {backlog_count} | Ready {ready_count} | In Progress {in_progress_count} | Review {review_count} | Done {done_count}
271
+ - Pipeline Continuing...
272
+ ===============================================
273
+ ```
274
+
275
+ 4. If `backlog_count` > 0 OR `ready_count` > 0: Continue loop — return to Step 2.1
276
+ 5. If `backlog_count` == 0 AND `ready_count` == 0: Queue is empty, go to Step 3
277
+
278
+ </step>
279
+
280
+ <step n="3" goal="Output final batch processing report">
281
+
282
+ ### 3.1 Refresh Sprint Status
283
+
284
+ 1. Load the FULL file: `{sprint_status}` (final fresh read)
285
+ 2. Recount all stories by status
286
+
287
+ ### 3.2 Generate Final Report
288
+
289
+ **Output:**
290
+
291
+ ```
292
+ ===============================================
293
+ Auto Story Pipeline (Batch) — COMPLETE
294
+ ===============================================
295
+
296
+ Pipeline Summary:
297
+ - Mode: Batch (Agent Subprocess Isolation)
298
+ - Stories Completed: {stories_completed}
299
+ - Pipeline Status: finalized
300
+
301
+ Stories Processed:
302
+ {for each completed story: key, final_status, fix_iterations_used, summary}
303
+
304
+ Sprint Status (current):
305
+ - Backlog: {backlog_count} remaining
306
+ - Ready for Dev: {ready_count}
307
+ - In Progress: {in_progress_count}
308
+ - In Review: {review_count}
309
+ - Done: {done_count}
310
+
311
+ The automated batch story development pipeline has finished.
312
+ ===============================================
313
+ ```
314
+
315
+ **IF `backlog_count` == 0 AND `ready_count` == 0 AND `in_progress_count` == 0 AND `review_count` == 0:**
316
+ - Output: "All stories in the sprint are complete! Consider running epic-retrospective (ER) to review the work."
317
+
318
+ **HALT** — Pipeline complete.
319
+
320
+ </step>
321
+
322
+ </workflow>
323
+
324
+ ---
325
+
326
+ ## Important Notes
327
+
328
+ 1. **Agent isolation is key** — Each story is processed in an independent Agent subprocess with isolated context. No `/clear` needed, no mutual interference between stories
329
+ 2. **Fully automatic** — User only calls once, then fully automatic until all stories are processed
330
+ 3. **Serial safety** — One story at a time, avoid concurrent modifications to the same codebase
331
+ 4. **Error tolerance** — If an Agent fails to process a story, the story status remains unchanged in sprint-status.yaml. The main loop records the failure and continues to the next story
332
+ 5. **Agent prompt quality** — The prompt passed to each Agent must include complete story info + all configuration paths + processing instructions + return format, enabling fully independent work
333
+ 6. **Reuses existing step files** — Agents read and follow the same step-02 through step-08 files from auto-story-pipeline, avoiding code duplication
@@ -0,0 +1,3 @@
1
+ canonicalId: auto-story-pipeline-batch
2
+ type: workflow
3
+ description: "Batch automated story development pipeline with Agent subprocess isolation. Each story is processed in an independent Agent context to prevent context bloat. Use when the user says 'batch story pipeline', 'ASB', 'auto story batch', or 'batch auto pipeline'"
@@ -40,8 +40,8 @@ Check that the following required artifacts and workflows exist:
40
40
  3. **Sprint Planning Workflow** — `{project-root}/_xiaoma/xmc/workflows/4-implementation/xiaoma-sprint-planning/workflow.md` must be readable
41
41
  - If missing: HALT — "Sprint Planning workflow not found. Verify XiaoMa installation is complete."
42
42
 
43
- 4. **Auto Story Pipeline** — `{project-root}/_xiaoma/xmc/workflows/4-implementation/auto-story-pipeline/workflow.md` must be readable
44
- - If missing: HALT — "Auto Story Pipeline workflow not found. Verify XiaoMa installation is complete."
43
+ 4. **Auto Story Pipeline Batch** — `{project-root}/_xiaoma/xmc/workflows/4-implementation/auto-story-pipeline-batch/workflow.md` must be readable
44
+ - If missing: HALT — "Auto Story Pipeline Batch workflow not found. Verify XiaoMa installation is complete."
45
45
 
46
46
  5. **Source Directory** — `src/` directory should exist (warning only if missing)
47
47
  - If missing: Output WARNING — "No `src/` directory found. Architecture analysis may be limited."