hatch3r 1.0.0 → 1.2.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 (144) hide show
  1. package/README.md +93 -322
  2. package/agents/hatch3r-a11y-auditor.md +24 -6
  3. package/agents/hatch3r-architect.md +20 -1
  4. package/agents/hatch3r-ci-watcher.md +31 -8
  5. package/agents/hatch3r-context-rules.md +14 -2
  6. package/agents/hatch3r-dependency-auditor.md +21 -5
  7. package/agents/hatch3r-devops.md +37 -6
  8. package/agents/hatch3r-docs-writer.md +19 -3
  9. package/agents/hatch3r-fixer.md +171 -0
  10. package/agents/hatch3r-implementer.md +84 -11
  11. package/agents/hatch3r-learnings-loader.md +69 -13
  12. package/agents/hatch3r-lint-fixer.md +19 -14
  13. package/agents/hatch3r-perf-profiler.md +18 -1
  14. package/agents/hatch3r-researcher.md +440 -5
  15. package/agents/hatch3r-reviewer.md +97 -5
  16. package/agents/hatch3r-security-auditor.md +23 -5
  17. package/agents/hatch3r-test-writer.md +21 -10
  18. package/checks/README.md +49 -0
  19. package/checks/code-quality.md +49 -0
  20. package/checks/performance.md +58 -0
  21. package/checks/security.md +58 -0
  22. package/checks/testing.md +53 -0
  23. package/commands/board/pickup-azure-devops.md +81 -0
  24. package/commands/board/pickup-delegation-multi.md +197 -0
  25. package/commands/board/pickup-delegation.md +100 -0
  26. package/commands/board/pickup-github.md +82 -0
  27. package/commands/board/pickup-gitlab.md +81 -0
  28. package/commands/board/pickup-modes.md +143 -0
  29. package/commands/board/pickup-post-impl.md +120 -0
  30. package/commands/board/shared-azure-devops.md +149 -0
  31. package/commands/board/shared-board-overview.md +215 -0
  32. package/commands/board/shared-github.md +169 -0
  33. package/commands/board/shared-gitlab.md +142 -0
  34. package/commands/hatch3r-agent-customize.md +40 -2
  35. package/commands/hatch3r-api-spec.md +294 -32
  36. package/commands/hatch3r-benchmark.md +386 -32
  37. package/commands/hatch3r-board-fill.md +161 -25
  38. package/commands/hatch3r-board-groom.md +595 -0
  39. package/commands/hatch3r-board-init.md +203 -46
  40. package/commands/hatch3r-board-pickup.md +79 -457
  41. package/commands/hatch3r-board-refresh.md +98 -27
  42. package/commands/hatch3r-board-shared.md +87 -238
  43. package/commands/hatch3r-bug-plan.md +16 -3
  44. package/commands/hatch3r-codebase-map.md +43 -10
  45. package/commands/hatch3r-command-customize.md +6 -0
  46. package/commands/hatch3r-context-health.md +5 -0
  47. package/commands/hatch3r-cost-tracking.md +5 -0
  48. package/commands/hatch3r-debug.md +426 -0
  49. package/commands/hatch3r-dep-audit.md +7 -1
  50. package/commands/hatch3r-feature-plan.md +74 -12
  51. package/commands/hatch3r-healthcheck.md +17 -1
  52. package/commands/hatch3r-hooks.md +16 -10
  53. package/commands/hatch3r-learn.md +15 -9
  54. package/commands/hatch3r-migration-plan.md +333 -33
  55. package/commands/hatch3r-onboard.md +327 -38
  56. package/commands/hatch3r-project-spec.md +46 -10
  57. package/commands/hatch3r-quick-change.md +336 -0
  58. package/commands/hatch3r-recipe.md +6 -0
  59. package/commands/hatch3r-refactor-plan.md +29 -13
  60. package/commands/hatch3r-release.md +13 -3
  61. package/commands/hatch3r-revision.md +395 -0
  62. package/commands/hatch3r-roadmap.md +18 -3
  63. package/commands/hatch3r-rule-customize.md +6 -0
  64. package/commands/hatch3r-security-audit.md +17 -1
  65. package/commands/hatch3r-skill-customize.md +6 -0
  66. package/commands/hatch3r-test-plan.md +532 -0
  67. package/commands/hatch3r-workflow.md +113 -38
  68. package/dist/cli/index.js +5184 -2593
  69. package/dist/cli/index.js.map +1 -0
  70. package/github-agents/hatch3r-docs-agent.md +1 -0
  71. package/github-agents/hatch3r-lint-agent.md +1 -0
  72. package/github-agents/hatch3r-security-agent.md +1 -0
  73. package/github-agents/hatch3r-test-agent.md +1 -0
  74. package/hooks/hatch3r-ci-failure.md +30 -0
  75. package/hooks/hatch3r-file-save.md +22 -0
  76. package/hooks/hatch3r-post-merge.md +23 -0
  77. package/hooks/hatch3r-pre-commit.md +23 -0
  78. package/hooks/hatch3r-pre-push.md +22 -0
  79. package/hooks/hatch3r-session-start.md +22 -0
  80. package/mcp/mcp.json +22 -3
  81. package/package.json +4 -7
  82. package/prompts/hatch3r-bug-triage.md +1 -0
  83. package/prompts/hatch3r-code-review.md +1 -0
  84. package/prompts/hatch3r-pr-description.md +1 -0
  85. package/rules/hatch3r-accessibility-standards.md +1 -0
  86. package/rules/hatch3r-agent-orchestration.md +326 -53
  87. package/rules/hatch3r-agent-orchestration.mdc +225 -0
  88. package/rules/hatch3r-api-design.md +4 -1
  89. package/rules/hatch3r-browser-verification.md +33 -1
  90. package/rules/hatch3r-browser-verification.mdc +29 -0
  91. package/rules/hatch3r-ci-cd.md +5 -1
  92. package/rules/hatch3r-ci-cd.mdc +4 -1
  93. package/rules/hatch3r-code-standards.md +18 -0
  94. package/rules/hatch3r-code-standards.mdc +10 -1
  95. package/rules/hatch3r-component-conventions.md +4 -1
  96. package/rules/hatch3r-data-classification.md +1 -0
  97. package/rules/hatch3r-deep-context.md +94 -0
  98. package/rules/hatch3r-deep-context.mdc +69 -0
  99. package/rules/hatch3r-dependency-management.md +13 -0
  100. package/rules/hatch3r-feature-flags.md +4 -1
  101. package/rules/hatch3r-git-conventions.md +1 -0
  102. package/rules/hatch3r-i18n.md +4 -1
  103. package/rules/hatch3r-learning-consult.md +4 -2
  104. package/rules/hatch3r-learning-consult.mdc +3 -2
  105. package/rules/hatch3r-migrations.md +12 -0
  106. package/rules/hatch3r-observability.md +293 -1
  107. package/rules/hatch3r-performance-budgets.md +5 -2
  108. package/rules/hatch3r-performance-budgets.mdc +1 -1
  109. package/rules/hatch3r-secrets-management.md +11 -3
  110. package/rules/hatch3r-secrets-management.mdc +10 -3
  111. package/rules/hatch3r-security-patterns.md +23 -3
  112. package/rules/hatch3r-security-patterns.mdc +8 -2
  113. package/rules/hatch3r-testing.md +1 -0
  114. package/rules/hatch3r-theming.md +4 -1
  115. package/rules/hatch3r-tooling-hierarchy.md +42 -15
  116. package/rules/hatch3r-tooling-hierarchy.mdc +27 -4
  117. package/skills/hatch3r-a11y-audit/SKILL.md +1 -0
  118. package/skills/hatch3r-agent-customize/SKILL.md +3 -0
  119. package/skills/hatch3r-api-spec/SKILL.md +1 -0
  120. package/skills/hatch3r-architecture-review/SKILL.md +6 -2
  121. package/skills/hatch3r-bug-fix/SKILL.md +4 -1
  122. package/skills/hatch3r-ci-pipeline/SKILL.md +1 -0
  123. package/skills/hatch3r-command-customize/SKILL.md +1 -0
  124. package/skills/hatch3r-context-health/SKILL.md +2 -1
  125. package/skills/hatch3r-cost-tracking/SKILL.md +1 -0
  126. package/skills/hatch3r-dep-audit/SKILL.md +6 -2
  127. package/skills/hatch3r-feature/SKILL.md +9 -2
  128. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +130 -21
  129. package/skills/hatch3r-incident-response/SKILL.md +11 -5
  130. package/skills/hatch3r-issue-workflow/SKILL.md +12 -7
  131. package/skills/hatch3r-logical-refactor/SKILL.md +1 -0
  132. package/skills/hatch3r-migration/SKILL.md +1 -0
  133. package/skills/hatch3r-perf-audit/SKILL.md +2 -1
  134. package/skills/hatch3r-pr-creation/SKILL.md +20 -10
  135. package/skills/hatch3r-qa-validation/SKILL.md +2 -1
  136. package/skills/hatch3r-recipe/SKILL.md +1 -0
  137. package/skills/hatch3r-refactor/SKILL.md +7 -1
  138. package/skills/hatch3r-release/SKILL.md +15 -11
  139. package/skills/hatch3r-rule-customize/SKILL.md +1 -0
  140. package/skills/hatch3r-skill-customize/SKILL.md +1 -0
  141. package/skills/hatch3r-visual-refactor/SKILL.md +1 -0
  142. package/dist/cli/hooks-ZOTFDEA3.js +0 -59
  143. package/rules/hatch3r-error-handling.md +0 -17
  144. package/rules/hatch3r-error-handling.mdc +0 -15
@@ -1,11 +1,23 @@
1
1
  ---
2
2
  id: hatch3r-board-fill
3
3
  type: command
4
- description: Create GitHub epics and issues from todo.md, reorganize the board with dependency analysis, readiness assessment, and implementation ordering.
4
+ description: Create epics and issues/work items from todo.md, reorganize the board with dependency analysis, readiness assessment, and implementation ordering. Supports GitHub, Azure DevOps, and GitLab.
5
+ tags: [board, team]
5
6
  ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ | Stage | Agent(s) | Parallel | Required |
11
+ |-------|----------|----------|----------|
12
+ | 1. Context Gathering | Explore sub-agents (codebase exploration) | Yes | When application context needed |
13
+ | 2. Issue Creation | Orchestrator (inline, GitHub MCP) | No | Yes |
14
+ | 3. Board Sync | Orchestrator (Projects v2 sync) | No | Yes |
15
+
16
+ All issue operations MUST follow the Board Sync Enforcement rules defined in `hatch3r-board-shared`.
17
+
6
18
  # Board Fill -- Create Epics & Issues from todo.md + Board Reorganization
7
19
 
8
- Create GitHub epics (with sub-issues) or standalone issues from items in `todo.md`, using the GitHub MCP tools against **{owner}/{repo}** (read from `/.agents/hatch.json` board config). Before creating anything, board-fill **triages each item through interactive questioning** to extract scope, intent, unknowns, and acceptance criteria from the user -- ensuring issues are genuinely ready for implementation, not just structurally complete. On every run, board-fill also performs a **full board reorganization**: grouping standalone issues into epics, decomposing oversized items, analyzing dependencies, setting implementation order, identifying parallel work, and marking issues as `status:ready` when all readiness criteria (structural + substantive) are met. AI proposes groupings, dependencies, and ordering; user confirms before anything is created or updated. Duplicate topics are detected and skipped.
20
+ Create epics (with sub-issues) or standalone issues/work items from items in `todo.md`, using the platform's CLI and MCP tools against **{owner}/{repo}** (read from `.agents/hatch.json` board config). The `platform` field determines whether to use GitHub Issues, Azure DevOps Work Items, or GitLab Issues. Before creating anything, board-fill **triages each item through interactive questioning** to extract scope, intent, unknowns, and acceptance criteria from the user -- ensuring issues are genuinely ready for implementation, not just structurally complete. On every run, board-fill also performs a **full board reorganization**: grouping standalone issues into epics, decomposing oversized items, analyzing dependencies, setting implementation order, identifying parallel work, and marking issues as `status:ready` when all readiness criteria (structural + substantive) are met. AI proposes groupings, dependencies, and ordering; user confirms before anything is created or updated. Duplicate topics are detected and skipped.
9
21
 
10
22
  ---
11
23
 
@@ -15,15 +27,18 @@ hatch3r's board commands operate as the **implementation orchestration layer** a
15
27
 
16
28
  - **board-init** sets up the project management structure that agentic workflows operate within
17
29
  - **board-fill** creates the work items that agentic workflows can triage and label
30
+ - **board-groom** refines existing work items as priorities, scope, and dependencies evolve over time
18
31
  - **board-pickup** orchestrates the implementation -> review -> merge pipeline that goes beyond what generic agentic workflows provide
19
32
 
33
+ For ongoing refinement of existing board items (re-prioritization, reclassification, re-scoping, archiving stale items, dependency cleanup), use `hatch3r-board-groom` instead of re-running board-fill.
34
+
20
35
  GitHub Agentic Workflows and hatch3r are complementary: use agentic workflows for continuous background automation, use hatch3r board commands for structured delivery orchestration.
21
36
 
22
37
  ---
23
38
 
24
39
  ## Shared Context
25
40
 
26
- **Read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, GitHub Context, Project Reference, Projects v2 sync procedure, and tooling directives. Cache all values for the duration of this run.
41
+ **Read the `hatch3r-board-shared` command at the start of the run.** It contains Board Configuration, Platform Detection, Platform Context, Board Sync Procedure, and tooling directives. Cache all values for the duration of this run.
27
42
 
28
43
  ## Token-Saving Directives
29
44
 
@@ -43,14 +58,37 @@ Execute these steps in order. **Do not skip any step.** Ask the user at every ch
43
58
 
44
59
  **ASK:** "Here are the items I found in todo.md. Which items should I process? (all / specific numbers / exclude specific numbers)"
45
60
 
61
+ #### 1a. Product Vision Input (Optional)
62
+
63
+ 1. Check if a product vision document exists at `.agents/product-vision.md`.
64
+ 2. If found, read and cache the vision document for use in Steps 2.5 and 4.
65
+ 3. If not found, check whether the user provided a vision statement inline with the board-fill invocation (e.g., as a quoted string or file path argument).
66
+ 4. If a vision is available from either source, note: "Product vision loaded — will use for triage context and issue scoping."
67
+ 5. If no vision is available, proceed without it. Do not prompt the user for one.
68
+
46
69
  ---
47
70
 
48
71
  ### Step 1.5: Full Board Scan
49
72
 
50
73
  Scan the entire board to build an inventory of all existing work. This scan feeds into all subsequent steps. **Cache everything retrieved here.**
51
74
 
52
- 1. Fetch ALL open issues using `list_issues` with `owner: {board.owner}`, `repo: {board.repo}`, `state: OPEN`. Paginate to retrieve every issue. **Exclude** any issue with the `meta:board-overview` label from all subsequent processing.
53
- 2. For each issue, fetch labels (`issue_read` with `method: get_labels`) and check for sub-issues (`issue_read` with `method: get_sub_issues`).
75
+ 1. **Platform-specific: Fetch all open issues/work items**
76
+
77
+ **If platform is `github`:**
78
+ - Fetch ALL open issues using `gh issue list -R {owner}/{repo} --state open --limit 500 --json number,title,labels,state,createdAt,updatedAt,body` (fall back to `list_issues` MCP with `owner: {board.owner}`, `repo: {board.repo}`, `state: OPEN`). Paginate to retrieve every issue.
79
+
80
+ **If platform is `azure-devops`:**
81
+ - Fetch ALL active work items: `az boards query --org https://dev.azure.com/{namespace} --project {project} --wiql "SELECT [System.Id], [System.Title], [System.State], [System.Tags], [System.CreatedDate], [System.ChangedDate] FROM WorkItems WHERE [System.State] <> 'Closed' AND [System.State] <> 'Removed'"` (fall back to `list_work_items` MCP).
82
+
83
+ **If platform is `gitlab`:**
84
+ - Fetch ALL open issues: `glab issue list -R {namespace}/{project} --state opened --per-page 100` (paginate to retrieve all).
85
+
86
+ **Exclude** any issue/work item with the `meta:board-overview` label/tag from all subsequent processing.
87
+
88
+ 2. For each issue, fetch labels and check for sub-issues:
89
+ - **GitHub:** `issue_read` with `method: get_labels` and `method: get_sub_issues`.
90
+ - **Azure DevOps:** Tags from `System.Tags` field; parent-child relations via `az boards work-item relation list --id N`.
91
+ - **GitLab:** Labels from issue data; related issues via `glab api projects/{project_id}/issues/{N}/links`.
54
92
  3. Categorize every open issue:
55
93
  - **Epic** -- has sub-issues
56
94
  - **Sub-issue** -- is a child of an epic
@@ -76,7 +114,10 @@ Board Health:
76
114
 
77
115
  For each selected todo item:
78
116
 
79
- 1. `search_issues` with keywords derived from the item.
117
+ 1. **Platform-specific: Search for existing matches**
118
+ - **GitHub:** `gh search issues -R {owner}/{repo} "{keywords}"` (fall back to `search_issues` MCP).
119
+ - **Azure DevOps:** `az boards query --wiql "SELECT [System.Id] FROM WorkItems WHERE [System.Title] CONTAINS '{keywords}'"` (fall back to `search_work_items` MCP).
120
+ - **GitLab:** `glab issue list -R {namespace}/{project} --search "{keywords}"`.
80
121
  2. Compare against cached board inventory semantically.
81
122
  3. Classify: **Duplicate** / **Partial overlap** / **No match**.
82
123
 
@@ -96,6 +137,17 @@ Compare existing open issues pairwise for semantic duplicates. Present any findi
96
137
 
97
138
  Before classifying items, extract the information needed to produce genuinely ready issues. Todo items are often terse one-liners; this step surfaces the user's actual intent, scope, and constraints that the AI cannot infer.
98
139
 
140
+ #### Vision-Aware Triage (Conditional)
141
+
142
+ If a product vision was loaded in Step 1a, apply these modifications to the triage process:
143
+
144
+ 1. **Derive context from the vision first.** For each triage dimension (Scope, Value, Unknowns, Size, Stakeholder), check whether the product vision document provides clear answers. Extract relevant goals, user segments, success metrics, and stated priorities from the vision.
145
+ 2. **Reduce questioning.** Only ask triage questions for dimensions that the vision does not clearly address. If the vision states the target user, value proposition, and scope boundaries for an item's domain, mark those dimensions as "Clear (from vision)" and skip the corresponding questions.
146
+ 3. **Reference vision goals explicitly.** When classifying items or asking remaining triage questions, cite the specific vision goal or statement that informs the classification (e.g., "Per the product vision goal 'Zero-config onboarding', this item aligns with...").
147
+ 4. **Greenfield streamlining.** For greenfield projects where the vision covers all major work areas, batch all items into a single triage pass. Present the vision-derived context for each item and ask the user to confirm or override in one prompt rather than per-item questioning.
148
+
149
+ If no product vision is available, proceed with the full triage process below.
150
+
99
151
  #### 2.5a. Assess Clarity
100
152
 
101
153
  For each remaining item, score its clarity across six dimensions:
@@ -196,7 +248,7 @@ If the user flagged unresolved unknowns or research needs in triage, consider wh
196
248
 
197
249
  **Priority:** `priority:p0` (critical/security) / `priority:p1` (broken, no workaround) / `priority:p2` (degraded, default) / `priority:p3` (cosmetic, nice-to-have). Use the user's stated urgency and impact from triage (Value/Why answers) to override keyword defaults. Default `p2` only when both the todo text AND triage answers are ambiguous; security defaults to `p1`+.
198
250
 
199
- **Area:** Read area labels from `board.areas` in `/.agents/hatch.json`. If the list is empty, infer areas from the repository's directory structure. Assign all relevant area labels.
251
+ **Area:** Read area labels from `board.areas` in `.agents/hatch.json`. If the list is empty, infer areas from the repository's directory structure. Assign all relevant area labels.
200
252
 
201
253
  **Risk:** `risk:low` (isolated, easy rollback) / `risk:med` (shared modules, moderate scope) / `risk:high` (architectural, security-critical). Incorporate triage context: if the user surfaced unknowns, external dependencies, or broad blast radius, escalate risk accordingly. Items with unresolved spikes default to `risk:med`+.
202
254
 
@@ -220,7 +272,7 @@ Use explore subagents or direct file reads to understand the current state of so
220
272
 
221
273
  #### 4b.5. Consult Project Learnings
222
274
 
223
- 1. If `/.agents/learnings/` exists, scan for learnings relevant to the areas touched by the todo items.
275
+ 1. If `.agents/learnings/` exists, scan for learnings relevant to the areas touched by the todo items.
224
276
  2. Match by `area` and `tags` in learning frontmatter against the area labels assigned in Step 3.
225
277
  3. Surface relevant learnings in the Context Summary output:
226
278
  - **Pitfalls** for areas being touched (highest priority -- include specific warnings)
@@ -236,9 +288,17 @@ Follow the project's tooling hierarchy for external knowledge augmentation (Cont
236
288
 
237
289
  Skip if all items are purely internal (no external library involvement).
238
290
 
291
+ #### 4d. Product Vision Context (When Available)
292
+
293
+ If a product vision was loaded in Step 1a:
294
+
295
+ 1. Include the product vision as **primary context** for issue scoping. Vision-stated goals, success metrics, target users, and scope boundaries take precedence over inferred context when drafting issue bodies and acceptance criteria.
296
+ 2. Map each todo item to the specific vision goal(s) it supports. Include this mapping in the Context Summary output so that Steps 5 and 6 can reference it.
297
+ 3. Flag any todo items that do not clearly map to a stated vision goal — these may represent scope creep or infrastructure work that supports the vision indirectly.
298
+
239
299
  #### Output
240
300
 
241
- Present a brief **Context Summary**: key constraints from documentation, current implementation state, external findings (if any).
301
+ Present a brief **Context Summary**: key constraints from documentation, current implementation state, external findings (if any), and product vision alignment (if vision is available).
242
302
 
243
303
  ---
244
304
 
@@ -428,25 +488,87 @@ After the table, present the ASK. Only render full issue bodies for the specific
428
488
 
429
489
  ### Step 7: Create & Update Issues via GitHub MCP
430
490
 
491
+ All issue operations in this command MUST follow the Board Sync Enforcement rules defined in `hatch3r-board-shared` and the **Batch Operations** directive. Every created/updated issue must be synced to the board immediately, with status, priority, and area fields populated.
492
+
493
+ #### 7-pre. Collect Batch Plan & Approve
494
+
495
+ Before executing any GitHub API calls, collect ALL planned operations into a single batch and get one user approval:
496
+
497
+ 1. **Collect all creation operations** into a table, ordered by dependency (epics first, then sub-issues, then standalone):
498
+
499
+ ```
500
+ | # | Title | Type | Labels | Epic Assignment | Status |
501
+ |---|-------|------|--------|-----------------|--------|
502
+ | 1 | {epic title} | Epic | {labels} | — | {status} |
503
+ | 2 | {sub-issue title} | Sub-issue | {labels} | → Epic #1 | {status} |
504
+ | 3 | {standalone title} | Standalone | {labels} | — | {status} |
505
+ ```
506
+
507
+ 2. **Collect all update operations** for existing issues (from Steps 5, 5.5, 5.6) into a second table:
508
+
509
+ ```
510
+ | Issue # | Title | Updates |
511
+ |---------|-------|---------|
512
+ | #{N} | {title} | {add dependencies, regroup under epic, mark ready, etc.} |
513
+ ```
514
+
515
+ 3. **Collect all post-creation operations** (sub-issue linking, Projects v2 board sync) into a count summary:
516
+
517
+ ```
518
+ Post-creation operations: {X} sub-issue links, {Y} board sync calls, {Z} status updates
519
+ ```
520
+
521
+ **ASK:** "Here is the full batch of GitHub operations. {N} issues to create, {M} issues to update, {P} post-creation operations. Confirm to execute all, or adjust?"
522
+
523
+ After the user confirms, execute all operations in 7a–7b below **without additional per-item prompts**. Report progress inline (e.g., "Created #N... Linked sub-issue #M...").
524
+
431
525
  #### 7a. Create New Issues
432
526
 
433
- Execute in dependency order (parents before children):
527
+ Execute in dependency order (parents before children). Do not prompt between operations — the batch was approved in 7-pre.
528
+
529
+ **Phase 1 — Create all issues/work items:**
530
+
531
+ **Platform-specific: Issue creation**
434
532
 
435
- 1. **Epics first:** `issue_write` with `method: create`, `owner: {board.owner}`, `repo: {board.repo}`. Include `## Dependencies` section and `has-dependencies` label. Record the returned `number` and internal numeric `id` field.
436
- 2. **Sub-issues:** Create each, then link via `sub_issue_write` with `method: add` using the parent `issue_number` and child's internal numeric `id` (NOT the issue number or node_id).
437
- 3. **Standalone issues:** Create with `## Dependencies` and `has-dependencies`.
438
- 4. **Add to project board + sync initial status:** For each created issue, run the full **Projects v2 Sync Procedure** from `hatch3r-board-shared` (gh CLI primary). This adds the item to the board, captures its item ID from the response, and sets the Projects v2 status to match the issue's `status:*` label (typically `status:ready` or `status:triage`). Use the label → option ID mapping from the sync procedure.
533
+ **If platform is `github`:**
534
+ 1. **Epics first:** `gh issue create -R {owner}/{repo} --title "..." --body "..." --label "..."` (fall back to `issue_write` MCP with `method: create`). Include `## Dependencies` section and `has-dependencies` label (per rule 7 of Board Sync Enforcement). Record the returned `number` and internal numeric `id` field.
535
+ 2. **Sub-issues:** Create each. Include `## Dependencies` section. Add `has-dependencies` label if the sub-issue has any dependency references (per rule 7 of Board Sync Enforcement). Record the returned `number` and internal numeric `id` field.
536
+ 3. **Standalone issues:** Create with `## Dependencies` and `has-dependencies` (when dependencies exist, per rule 7).
537
+
538
+ **If platform is `azure-devops`:**
539
+ 1. **Epics first:** `az boards work-item create --org https://dev.azure.com/{namespace} --project {project} --type "Epic" --title "..." --description "..." --fields "System.Tags=has-dependencies"` (fall back to `create_work_item` MCP). Record the returned work item `id`.
540
+ 2. **Sub-issues:** Create as User Stories or Tasks: `az boards work-item create --type "User Story" --title "..." --description "..."`. Record the returned `id`.
541
+ 3. **Standalone issues:** Create as User Stories with `## Dependencies` and `has-dependencies` tag.
542
+
543
+ **If platform is `gitlab`:**
544
+ 1. **Epics first:** `glab issue create -R {namespace}/{project} --title "..." --description "..." --label "has-dependencies"`. Record the returned issue number.
545
+ 2. **Sub-issues:** Create each. Record the returned issue number.
546
+ 3. **Standalone issues:** Create with `## Dependencies` and `has-dependencies` label.
547
+
548
+ **Phase 2 — Link sub-issues** (after all issues exist):
549
+
550
+ For each sub-issue, follow the **Sub-Issue Linking Procedure** from `hatch3r-board-shared`. Use the three-tier fallback chain (MCP native → CLI body-reference → comment trace) and record link status per child in the run cache under `link_results`.
551
+
552
+ **Phase 3 — Sync to board** (after all issues and links are created):
553
+
554
+ For each created issue, run the full **Board Sync Procedure** from `hatch3r-board-shared`. This adds the item to the board and sets the status to match the issue's `status:*` label (typically `status:ready` or `status:triage`).
439
555
 
440
556
  #### 7b. Update Existing Issues (Board Reorganization)
441
557
 
442
558
  For issues needing updates (from Steps 5, 5.5, 5.6):
443
559
 
444
- 1. **Add/update `## Dependencies`:** Read current body, append/replace section, update via `issue_write`. Add `has-dependencies` label.
560
+ 1. **Add/update `## Dependencies`:** Read current body, append/replace section, update via platform CLI or MCP. Add `has-dependencies` label/tag.
561
+ - **GitHub:** `gh issue edit N --body "..."` or `issue_write` MCP.
562
+ - **Azure DevOps:** `az boards work-item update --id N --description "..."`.
563
+ - **GitLab:** `glab issue update N --description "..."`.
445
564
  2. **Regenerate `## Implementation Order`** (epics only): Derive from the sub-issues' `## Dependencies` DAG (see Dependency Data Model in `hatch3r-board-shared`). Replace the existing section entirely -- do not manually edit it.
446
- 3. **Apply epic regrouping:** Link standalones to epics via `sub_issue_write`. Update epic body.
565
+ 3. **Apply epic regrouping:** Link standalones to epics using the **Sub-Issue Linking Procedure** from `hatch3r-board-shared`. Update epic body with the new sub-issue reference.
447
566
  4. **Mark `status:ready`:** Remove `status:triage`, add `status:ready`. Do not downgrade existing statuses.
448
- 5. **Add missing labels** if user opted to fill gaps.
449
- 6. **Sync Projects v2 Status:** For each issue whose status label was set or changed in this run (including issues newly marked `status:ready` in step 4 above), run the full **Projects v2 Sync Procedure** from `hatch3r-board-shared` (gh CLI primary). This ensures the Projects v2 board column matches the label. Skip issues already synced in Step 7a.4.
567
+ - **GitHub:** `gh issue edit N --remove-label "status:triage" --add-label "status:ready"`.
568
+ - **Azure DevOps:** `az boards work-item update --id N --state "Active" --fields "System.Tags=+status:ready;-status:triage"`.
569
+ - **GitLab:** `glab issue update N --unlabel "status::triage" --label "status::ready"`.
570
+ 5. **Add missing labels/tags** if user opted to fill gaps.
571
+ 6. **Sync Board Status:** For each issue whose status was set or changed in this run, run the full **Board Sync Procedure** from `hatch3r-board-shared`. This ensures the board view matches the label. Skip issues already synced in Phase 3.
450
572
 
451
573
  #### 7c. Present Summary
452
574
 
@@ -467,15 +589,29 @@ Board Summary: N created, M updated, X marked ready, Y still triage, Z parallel
467
589
  **This step is mandatory. Do not skip.**
468
590
 
469
591
  1. Search the cached board inventory for an open issue labeled `meta:board-overview`.
470
- 2. Compute Implementation Lanes using the **Lane Computation Algorithm** from `hatch3r-board-shared`. Use the cached dependency DAG from Step 5.5 as input.
592
+ 2. Compute Implementation Lanes using the **Lane Computation Algorithm** (steps 1-12) from `hatch3r-board-shared`. Use the cached dependency DAG from Step 5.5 as input. This includes inter-lane dependency computation, lane phasing, and the Lane Dependency Map.
471
593
  3. Assign models to all open issues using the **Model Selection Heuristic (Quality-First)** from `hatch3r-board-shared`.
472
- 4. **If found:** Regenerate the dashboard body using the **Board Overview Issue Format** template from `hatch3r-board-shared`, populated with cached board data updated with mutations from Step 7. Update the issue body via `gh issue edit` (fall back to `issue_write` MCP).
473
- 5. **If not found:** Create a new board overview issue using the **Board Overview Issue Format** template from `hatch3r-board-shared`, populated with current board data (all issues from this run plus existing board state). Label it `meta:board-overview` and add it to the project board.
594
+ 4. **If found:** Regenerate the dashboard body using the **Board Overview Issue Format** template from `hatch3r-board-shared`, populated with cached board data updated with mutations from Step 7. Update the issue body using platform CLI (fall back to MCP):
595
+ - **GitHub:** `gh issue edit {N} --body "..."` (fall back to `issue_write` MCP).
596
+ - **Azure DevOps:** `az boards work-item update --id {N} --description "..."`.
597
+ - **GitLab:** `glab issue update {N} --description "..."`.
598
+ 5. **If not found:** Create a new board overview issue using the **Board Overview Issue Format** template from `hatch3r-board-shared`, populated with current board data. Label/tag it `meta:board-overview` and sync to the board:
599
+ - **GitHub:** `gh issue create` or `issue_write` MCP, then add to project board.
600
+ - **Azure DevOps:** `az boards work-item create` with `meta:board-overview` tag.
601
+ - **GitLab:** `glab issue create` with `meta:board-overview` label.
474
602
 
475
603
  Do NOT re-fetch all issues; use cached data.
476
604
 
477
605
  ---
478
606
 
607
+ ### Step 7.8: End-of-Run Reconciliation
608
+
609
+ **This step is mandatory. Do not skip.**
610
+
611
+ Run the **End-of-Run Reconciliation Procedure** from `hatch3r-board-shared`. This verifies board sync, sub-issue links, label consistency, and PR linkage for all issues created or updated during this run. Output the reconciliation report before proceeding to Step 8.
612
+
613
+ ---
614
+
479
615
  ### Step 8: Cleanup
480
616
 
481
617
  **ASK:** "All issues created. Should I remove processed items from `todo.md`? (yes / no / only created ones)"
@@ -486,16 +622,16 @@ If yes, edit `todo.md` to remove lines for created issues. Preserve skipped/excl
486
622
 
487
623
  ## Error Handling
488
624
 
489
- - `search_issues` failure: retry once, then warn and proceed without dedup.
490
- - `issue_write` failure: report, skip that issue, continue. Summarize failures at end.
491
- - `sub_issue_write` failure: report but do not delete the created issue.
625
+ - **Search failure** (GitHub `search_issues` / Azure DevOps `az boards query` / GitLab `glab issue list --search`): retry once, then warn and proceed without dedup.
626
+ - **Issue/work item creation failure** (GitHub `issue_write` / Azure DevOps `az boards work-item create` / GitLab `glab issue create`): report, skip that issue, continue. Summarize failures at end.
627
+ - **Sub-issue linking failure** (GitHub `sub_issue_write` / Azure DevOps relation add / GitLab issue link): report but do not delete the created issue.
492
628
  - Never create an issue without user confirmation in Step 6.
493
629
 
494
630
  ## Guardrails
495
631
 
496
632
  - **Never create issues for topics already covered** without explicit user approval.
497
633
  - **Never skip ASK checkpoints.**
498
- - **Use correct labels** from the label taxonomy defined in `/.agents/hatch.json` (type, priority, area, risk, executor, status, has-dependencies, meta labels).
634
+ - **Use correct labels** from the label taxonomy defined in `.agents/hatch.json` (type, priority, area, risk, executor, status, has-dependencies, meta labels).
499
635
  - **Keep issue bodies concise.** Acceptance criteria must be grounded in user-stated requirements from triage, not fabricated from the todo text alone.
500
636
  - **No dependency cycles.** Flag and resolve before proceeding.
501
637
  - **Never downgrade issue status.** Only upgrade `status:triage` → `status:ready`.