hatch3r 1.0.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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +437 -0
  3. package/agents/hatch3r-a11y-auditor.md +126 -0
  4. package/agents/hatch3r-architect.md +160 -0
  5. package/agents/hatch3r-ci-watcher.md +123 -0
  6. package/agents/hatch3r-context-rules.md +97 -0
  7. package/agents/hatch3r-dependency-auditor.md +164 -0
  8. package/agents/hatch3r-devops.md +138 -0
  9. package/agents/hatch3r-docs-writer.md +97 -0
  10. package/agents/hatch3r-implementer.md +162 -0
  11. package/agents/hatch3r-learnings-loader.md +108 -0
  12. package/agents/hatch3r-lint-fixer.md +104 -0
  13. package/agents/hatch3r-perf-profiler.md +123 -0
  14. package/agents/hatch3r-researcher.md +642 -0
  15. package/agents/hatch3r-reviewer.md +81 -0
  16. package/agents/hatch3r-security-auditor.md +119 -0
  17. package/agents/hatch3r-test-writer.md +134 -0
  18. package/commands/hatch3r-agent-customize.md +146 -0
  19. package/commands/hatch3r-api-spec.md +49 -0
  20. package/commands/hatch3r-benchmark.md +50 -0
  21. package/commands/hatch3r-board-fill.md +504 -0
  22. package/commands/hatch3r-board-init.md +315 -0
  23. package/commands/hatch3r-board-pickup.md +672 -0
  24. package/commands/hatch3r-board-refresh.md +198 -0
  25. package/commands/hatch3r-board-shared.md +369 -0
  26. package/commands/hatch3r-bug-plan.md +410 -0
  27. package/commands/hatch3r-codebase-map.md +1182 -0
  28. package/commands/hatch3r-command-customize.md +94 -0
  29. package/commands/hatch3r-context-health.md +112 -0
  30. package/commands/hatch3r-cost-tracking.md +139 -0
  31. package/commands/hatch3r-dep-audit.md +171 -0
  32. package/commands/hatch3r-feature-plan.md +379 -0
  33. package/commands/hatch3r-healthcheck.md +307 -0
  34. package/commands/hatch3r-hooks.md +282 -0
  35. package/commands/hatch3r-learn.md +217 -0
  36. package/commands/hatch3r-migration-plan.md +51 -0
  37. package/commands/hatch3r-onboard.md +56 -0
  38. package/commands/hatch3r-project-spec.md +1153 -0
  39. package/commands/hatch3r-recipe.md +179 -0
  40. package/commands/hatch3r-refactor-plan.md +426 -0
  41. package/commands/hatch3r-release.md +328 -0
  42. package/commands/hatch3r-roadmap.md +556 -0
  43. package/commands/hatch3r-rule-customize.md +114 -0
  44. package/commands/hatch3r-security-audit.md +370 -0
  45. package/commands/hatch3r-skill-customize.md +93 -0
  46. package/commands/hatch3r-workflow.md +377 -0
  47. package/dist/cli/hooks-ZOTFDEA3.js +59 -0
  48. package/dist/cli/index.d.ts +2 -0
  49. package/dist/cli/index.js +3584 -0
  50. package/github-agents/hatch3r-docs-agent.md +46 -0
  51. package/github-agents/hatch3r-lint-agent.md +41 -0
  52. package/github-agents/hatch3r-security-agent.md +54 -0
  53. package/github-agents/hatch3r-test-agent.md +66 -0
  54. package/hooks/hatch3r-ci-failure.md +10 -0
  55. package/hooks/hatch3r-file-save.md +11 -0
  56. package/hooks/hatch3r-post-merge.md +10 -0
  57. package/hooks/hatch3r-pre-commit.md +11 -0
  58. package/hooks/hatch3r-pre-push.md +10 -0
  59. package/hooks/hatch3r-session-start.md +10 -0
  60. package/mcp/mcp.json +62 -0
  61. package/package.json +84 -0
  62. package/prompts/hatch3r-bug-triage.md +155 -0
  63. package/prompts/hatch3r-code-review.md +131 -0
  64. package/prompts/hatch3r-pr-description.md +173 -0
  65. package/rules/hatch3r-accessibility-standards.md +77 -0
  66. package/rules/hatch3r-accessibility-standards.mdc +75 -0
  67. package/rules/hatch3r-agent-orchestration.md +160 -0
  68. package/rules/hatch3r-api-design.md +176 -0
  69. package/rules/hatch3r-api-design.mdc +176 -0
  70. package/rules/hatch3r-browser-verification.md +73 -0
  71. package/rules/hatch3r-browser-verification.mdc +73 -0
  72. package/rules/hatch3r-ci-cd.md +70 -0
  73. package/rules/hatch3r-ci-cd.mdc +68 -0
  74. package/rules/hatch3r-code-standards.md +102 -0
  75. package/rules/hatch3r-code-standards.mdc +100 -0
  76. package/rules/hatch3r-component-conventions.md +102 -0
  77. package/rules/hatch3r-component-conventions.mdc +102 -0
  78. package/rules/hatch3r-data-classification.md +85 -0
  79. package/rules/hatch3r-data-classification.mdc +83 -0
  80. package/rules/hatch3r-dependency-management.md +17 -0
  81. package/rules/hatch3r-dependency-management.mdc +15 -0
  82. package/rules/hatch3r-error-handling.md +17 -0
  83. package/rules/hatch3r-error-handling.mdc +15 -0
  84. package/rules/hatch3r-feature-flags.md +112 -0
  85. package/rules/hatch3r-feature-flags.mdc +112 -0
  86. package/rules/hatch3r-git-conventions.md +47 -0
  87. package/rules/hatch3r-git-conventions.mdc +45 -0
  88. package/rules/hatch3r-i18n.md +90 -0
  89. package/rules/hatch3r-i18n.mdc +90 -0
  90. package/rules/hatch3r-learning-consult.md +29 -0
  91. package/rules/hatch3r-learning-consult.mdc +27 -0
  92. package/rules/hatch3r-migrations.md +17 -0
  93. package/rules/hatch3r-migrations.mdc +15 -0
  94. package/rules/hatch3r-observability.md +165 -0
  95. package/rules/hatch3r-observability.mdc +165 -0
  96. package/rules/hatch3r-performance-budgets.md +109 -0
  97. package/rules/hatch3r-performance-budgets.mdc +109 -0
  98. package/rules/hatch3r-secrets-management.md +76 -0
  99. package/rules/hatch3r-secrets-management.mdc +74 -0
  100. package/rules/hatch3r-security-patterns.md +211 -0
  101. package/rules/hatch3r-security-patterns.mdc +211 -0
  102. package/rules/hatch3r-testing.md +89 -0
  103. package/rules/hatch3r-testing.mdc +87 -0
  104. package/rules/hatch3r-theming.md +51 -0
  105. package/rules/hatch3r-theming.mdc +51 -0
  106. package/rules/hatch3r-tooling-hierarchy.md +92 -0
  107. package/rules/hatch3r-tooling-hierarchy.mdc +79 -0
  108. package/skills/hatch3r-a11y-audit/SKILL.md +131 -0
  109. package/skills/hatch3r-agent-customize/SKILL.md +75 -0
  110. package/skills/hatch3r-api-spec/SKILL.md +66 -0
  111. package/skills/hatch3r-architecture-review/SKILL.md +96 -0
  112. package/skills/hatch3r-bug-fix/SKILL.md +129 -0
  113. package/skills/hatch3r-ci-pipeline/SKILL.md +76 -0
  114. package/skills/hatch3r-command-customize/SKILL.md +67 -0
  115. package/skills/hatch3r-context-health/SKILL.md +76 -0
  116. package/skills/hatch3r-cost-tracking/SKILL.md +65 -0
  117. package/skills/hatch3r-dep-audit/SKILL.md +82 -0
  118. package/skills/hatch3r-feature/SKILL.md +129 -0
  119. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +150 -0
  120. package/skills/hatch3r-incident-response/SKILL.md +86 -0
  121. package/skills/hatch3r-issue-workflow/SKILL.md +139 -0
  122. package/skills/hatch3r-logical-refactor/SKILL.md +73 -0
  123. package/skills/hatch3r-migration/SKILL.md +76 -0
  124. package/skills/hatch3r-perf-audit/SKILL.md +114 -0
  125. package/skills/hatch3r-pr-creation/SKILL.md +85 -0
  126. package/skills/hatch3r-qa-validation/SKILL.md +86 -0
  127. package/skills/hatch3r-recipe/SKILL.md +67 -0
  128. package/skills/hatch3r-refactor/SKILL.md +86 -0
  129. package/skills/hatch3r-release/SKILL.md +93 -0
  130. package/skills/hatch3r-rule-customize/SKILL.md +70 -0
  131. package/skills/hatch3r-skill-customize/SKILL.md +67 -0
  132. package/skills/hatch3r-visual-refactor/SKILL.md +89 -0
@@ -0,0 +1,504 @@
1
+ ---
2
+ id: hatch3r-board-fill
3
+ type: command
4
+ description: Create GitHub epics and issues from todo.md, reorganize the board with dependency analysis, readiness assessment, and implementation ordering.
5
+ ---
6
+ # Board Fill -- Create Epics & Issues from todo.md + Board Reorganization
7
+
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.
9
+
10
+ ---
11
+
12
+ ## Integration with GitHub Agentic Workflows
13
+
14
+ hatch3r's board commands operate as the **implementation orchestration layer** above GitHub Agentic Workflows. While GitHub's agentic workflows handle continuous automation (triage, testing, documentation), hatch3r's board commands orchestrate the full delivery pipeline:
15
+
16
+ - **board-init** sets up the project management structure that agentic workflows operate within
17
+ - **board-fill** creates the work items that agentic workflows can triage and label
18
+ - **board-pickup** orchestrates the implementation -> review -> merge pipeline that goes beyond what generic agentic workflows provide
19
+
20
+ GitHub Agentic Workflows and hatch3r are complementary: use agentic workflows for continuous background automation, use hatch3r board commands for structured delivery orchestration.
21
+
22
+ ---
23
+
24
+ ## Shared Context
25
+
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.
27
+
28
+ ## Token-Saving Directives
29
+
30
+ Follow the **Token-Saving Directives** in `hatch3r-board-shared`.
31
+
32
+ ---
33
+
34
+ ## Workflow
35
+
36
+ Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
37
+
38
+ ### Step 1: Read and Parse todo.md
39
+
40
+ 1. Read `todo.md` at the project root.
41
+ 2. Parse each non-empty line as a separate todo item. Strip leading `- ` or `* ` markers.
42
+ 3. Present the parsed list numbered.
43
+
44
+ **ASK:** "Here are the items I found in todo.md. Which items should I process? (all / specific numbers / exclude specific numbers)"
45
+
46
+ ---
47
+
48
+ ### Step 1.5: Full Board Scan
49
+
50
+ Scan the entire board to build an inventory of all existing work. This scan feeds into all subsequent steps. **Cache everything retrieved here.**
51
+
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`).
54
+ 3. Categorize every open issue:
55
+ - **Epic** -- has sub-issues
56
+ - **Sub-issue** -- is a child of an epic
57
+ - **Standalone** -- neither parent nor child
58
+ 4. For each issue, note presence of: `has-dependencies` label, `## Dependencies` section, required labels (`type:*`, `priority:*`, `area:*`, `executor:*`), acceptance criteria, documentation references, `## Implementation Order` (epics only).
59
+ 5. Present a board health summary:
60
+
61
+ ```
62
+ Board Health:
63
+ Total open issues: N (X epics, Y sub-issues, Z standalone)
64
+ Missing dependency metadata: #N, #M ...
65
+ Missing required labels: #N — no priority, no area ...
66
+ Potential epic grouping candidates: #N + #M (shared theme) ...
67
+ ```
68
+
69
+ **ASK:** "Here is the current board state. I will process the selected todo.md items AND reorganize existing issues. Before I continue: are there any items on the board that are stale, misprioritized, or missing context I should know about? Continue?"
70
+
71
+ ---
72
+
73
+ ### Step 2: Duplicate Detection
74
+
75
+ #### 2a. New Items vs. Existing Board
76
+
77
+ For each selected todo item:
78
+
79
+ 1. `search_issues` with keywords derived from the item.
80
+ 2. Compare against cached board inventory semantically.
81
+ 3. Classify: **Duplicate** / **Partial overlap** / **No match**.
82
+
83
+ Present findings in a table and ask.
84
+
85
+ **ASK:** "These items appear already covered. Skip / create anyway / add as sub-issue? For partial overlaps, create new or link?"
86
+
87
+ #### 2b. Existing Board Cross-Deduplication
88
+
89
+ Compare existing open issues pairwise for semantic duplicates. Present any findings.
90
+
91
+ **ASK (only if duplicates found):** "These existing issues overlap. Merge / keep both / convert one to sub-issue?"
92
+
93
+ ---
94
+
95
+ ### Step 2.5: Item-Level Triage Questioning
96
+
97
+ 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
+
99
+ #### 2.5a. Assess Clarity
100
+
101
+ For each remaining item, score its clarity across six dimensions:
102
+
103
+ | Dimension | What to check |
104
+ | ---------------------- | ----------------------------------------------------------------------------------------------------- |
105
+ | **Scope / Definition** | Does the item describe what "done" looks like? Are boundaries (in/out of scope) clear? |
106
+ | **Value / Why** | Is the motivation stated? Can you articulate the user problem it solves? |
107
+ | **Unknowns / Spikes** | Are there open design decisions, research questions, or unvalidated assumptions? |
108
+ | **External Blockers** | Might there be dependencies on external teams, services, approvals, or resources invisible to the AI? |
109
+ | **Size / Decomposition** | Could the item reasonably be a single issue, or does it span multiple deliverables? |
110
+ | **User / Stakeholder** | Is the affected user or stakeholder identifiable? Is the current workaround known? |
111
+
112
+ Categorize each item into a confidence tier:
113
+
114
+ - **Clear** -- all dimensions answered by the todo text, linked docs, or codebase context. Skip questioning for this item.
115
+ - **Ambiguous** -- 1-2 dimensions unclear. Ask targeted questions for the specific gaps.
116
+ - **Vague** -- 3+ dimensions unclear. Deep probing required across multiple dimensions.
117
+
118
+ #### 2.5b. Triage by Theme
119
+
120
+ Batch items that share a theme (same area, feature domain, or epic grouping candidate) and triage them together. This avoids repetitive questions and lets the user provide shared context once.
121
+
122
+ For each batch, present the items and their clarity assessment, then ask **only about the unclear dimensions**. Do not ask questions the todo text already answers.
123
+
124
+ **Question templates by dimension** (adapt to context, do not use verbatim):
125
+
126
+ - **Scope / Definition:** "What does 'done' look like for [item]? What's explicitly out of scope? Is there an MVP slice vs. a full version?"
127
+ - **Value / Why:** "Why is this important now? What user problem does it solve? What's the cost of deferring?"
128
+ - **Unknowns / Spikes:** "Are there open questions or design decisions that need resolving first? Should we create a spike/research issue before the implementation issue?"
129
+ - **External Blockers:** "Are there dependencies on external teams, services, environments, approvals, or resources I can't see from the codebase?"
130
+ - **Size / Decomposition:** "This seems like it could be multiple deliverables. Should we break it down? What's the smallest shippable increment?"
131
+ - **User / Stakeholder:** "Who is primarily affected? What's their current workaround (if any)?"
132
+
133
+ **ASK:** Present the clarity assessment table and triage questions per batch. Example:
134
+
135
+ ```
136
+ Triage — Distribution & Growth items:
137
+
138
+ | # | Item | Clarity | Gaps |
139
+ |---|--------------------------|---------|-------------------------------|
140
+ | 1 | Documentation site | Vague | Scope, Size, Unknowns |
141
+ | 2 | Claude Code plugin | Ambiguous | Scope |
142
+ | 3 | Landing page | Ambiguous | Value, Scope |
143
+
144
+ Questions:
145
+ 1. Documentation site: What pages/sections are essential for v1? Is this a full static site (Docusaurus/etc.) or a README expansion? Are there content gaps that need authoring vs. sections that can be auto-generated from existing docs?
146
+ 2. Claude Code plugin: What does "package for marketplace" entail beyond what's already built? Any marketplace-specific requirements you're aware of?
147
+ 3. Landing page: What's the primary conversion goal (GitHub stars, installs, sign-ups)? Is there existing copy/branding to work from?
148
+ ```
149
+
150
+ #### 2.5c. Capture Structured Triage Context
151
+
152
+ Store the user's answers as **Triage Context** for each item. This context feeds into all subsequent steps:
153
+
154
+ - **Step 3** uses it for classification (priority from stated urgency, risk from stated unknowns, executor from stated complexity).
155
+ - **Step 4** uses it to guide codebase exploration and documentation reads toward areas the user highlighted.
156
+ - **Step 5** uses it for grouping and decomposition decisions.
157
+ - **Step 5.6** uses it to validate readiness substantively.
158
+ - **Step 6** uses it to draft acceptance criteria grounded in the user's actual requirements.
159
+
160
+ Format per item (internal, not shown to user):
161
+
162
+ ```
163
+ Item: {original todo text}
164
+ Scope: {user's stated scope / definition of done}
165
+ Value: {user's stated motivation / user problem}
166
+ Unknowns: {open questions, spike needs} or "None"
167
+ External Blockers: {stated blockers} or "None"
168
+ Decomposition: {user's stated breakdown / MVP slice} or "Single issue"
169
+ Stakeholder: {affected user / workaround} or "Not specified"
170
+ ```
171
+
172
+ If the user declines to answer a dimension ("skip", "not sure", "figure it out"), record that explicitly. These unresolved dimensions become readiness gaps in Step 5.6.
173
+
174
+ ---
175
+
176
+ ### Step 3: Issue Type & Executor Classification
177
+
178
+ For each remaining item, classify across all dimensions using the mapping tables below **combined with Triage Context from Step 2.5**. Triage answers take precedence over keyword heuristics when they conflict.
179
+
180
+ **Type:**
181
+
182
+ | Signal | Type | Label |
183
+ | ------------------------------- | ---------------- | --------------------------- |
184
+ | bug, broken, not working, fix | Bug Report | `type:bug` |
185
+ | add, implement, create, new | Feature Request | `type:feature` |
186
+ | refactor, simplify, clean up | Code Refactor | `type:refactor` |
187
+ | rework flow, change behavior | Logical Refactor | `type:refactor` |
188
+ | UI, visual, layout, dark mode | Visual Refactor | `type:refactor` + `area:ui` |
189
+ | test, QA, validate | QA Validation | `type:qa` |
190
+ | docs, document, README | Documentation | `type:docs` |
191
+ | CI, CD, pipeline, deploy, infra | Infrastructure | `type:infra` |
192
+
193
+ If the user flagged unresolved unknowns or research needs in triage, consider whether the item (or part of it) should be a **spike** sub-issue (`type:spike`) that produces a decision/design before the implementation issue can be created. Present spike candidates explicitly.
194
+
195
+ **Executor:** `executor:agent` (clear criteria, bounded scope) / `executor:human` (decisions, infra, external setup) / `executor:hybrid` (agent implements after human direction). Use triage context: if the user stated the item requires decisions, external coordination, or judgment calls, lean toward `executor:human` or `executor:hybrid` regardless of keyword signals.
196
+
197
+ **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
+
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.
200
+
201
+ **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
+
203
+ Present the full classification table with all label categories. Flag any items where triage answers shifted the classification away from what keyword signals alone would suggest.
204
+
205
+ **ASK:** "Confirm or adjust the type, executor, priority, area, and risk for any item. For items flagged as potential spikes, confirm whether to create a spike sub-issue or proceed directly to implementation."
206
+
207
+ ---
208
+
209
+ ### Step 4: Retrieve Application Context
210
+
211
+ #### 4a. Project Documentation
212
+
213
+ 1. Read project documentation relevant to the areas touched by the todo items (e.g., specs, ADRs, design docs).
214
+ 2. Prefer reading TOC/headers first (first ~30 lines), then expand only relevant sections. Do NOT read full document bodies unless necessary.
215
+ 3. Read ADRs or architectural documents if items touch architectural decisions.
216
+
217
+ #### 4b. Codebase Exploration
218
+
219
+ Use explore subagents or direct file reads to understand the current state of source areas touched by the todo items.
220
+
221
+ #### 4b.5. Consult Project Learnings
222
+
223
+ 1. If `/.agents/learnings/` exists, scan for learnings relevant to the areas touched by the todo items.
224
+ 2. Match by `area` and `tags` in learning frontmatter against the area labels assigned in Step 3.
225
+ 3. Surface relevant learnings in the Context Summary output:
226
+ - **Pitfalls** for areas being touched (highest priority -- include specific warnings)
227
+ - **Patterns** that could inform issue scoping or acceptance criteria
228
+ - **Decisions** that constrain how issues should be approached
229
+ 4. If no learnings directory exists, skip silently.
230
+
231
+ #### 4c. External Research (When Needed)
232
+
233
+ For items referencing external libraries, frameworks, or services not fully covered by local docs:
234
+
235
+ Follow the project's tooling hierarchy for external knowledge augmentation (Context7 MCP for library docs, web research for current events).
236
+
237
+ Skip if all items are purely internal (no external library involvement).
238
+
239
+ #### Output
240
+
241
+ Present a brief **Context Summary**: key constraints from documentation, current implementation state, external findings (if any).
242
+
243
+ ---
244
+
245
+ ### Step 5: Propose Grouping (Epics vs. Standalone)
246
+
247
+ **Grouping philosophy:** Minimize standalone issues to near-zero. Group aggressively into epics. Standalone only if topically isolated from every other issue AND substantial enough to stand alone.
248
+
249
+ #### 5a. Group New Items
250
+
251
+ 1. **Absorb into existing epics first.**
252
+ 2. **Form new epics** from 2+ items sharing any connection (area, subsystem, category).
253
+ 3. **Adopt orphans** into broad thematic epics (e.g., "Security & Auth Hardening", "Infrastructure & Tooling").
254
+ 4. **Standalone only as last resort.**
255
+
256
+ #### 5b. Regroup Existing Standalone Issues
257
+
258
+ Evaluate existing standalones for grouping into existing or new epics. Same aggressive philosophy.
259
+
260
+ #### 5c. Decomposition Check
261
+
262
+ After grouping, evaluate whether any individual item is too large to be a single issue. Use the Size/Decomposition answers from Triage Context (Step 2.5) and the following signals:
263
+
264
+ 1. **User said to break down** -- the user explicitly stated the item spans multiple deliverables or suggested an MVP slice. Decompose into sub-issues per the user's guidance.
265
+ 2. **Multiple areas touched** -- the item requires changes across 3+ distinct areas/subsystems. Split along area boundaries.
266
+ 3. **Multiple acceptance criteria clusters** -- if the item's likely acceptance criteria fall into distinct, independently shippable groups, split into one issue per group.
267
+ 4. **Ambiguous scope with no user clarification** -- if scope was flagged as unclear in triage and the user declined to narrow it, flag the item as needing further breakdown and propose a decomposition.
268
+
269
+ For each item flagged for decomposition, propose specific sub-issues with one-line descriptions. Items already grouped into an epic become sub-issues of that epic; standalone items that decompose become a new epic with sub-issues.
270
+
271
+ Present grouping proposals (from 5a + 5b) and decomposition proposals (from 5c) together.
272
+
273
+ **ASK:** "Confirm grouping and decomposition, or: move items between groups / merge-split epics / convert epic↔standalone / reject decomposition / reject existing regrouping. Are there items here that still feel too large for a single issue?"
274
+
275
+ ---
276
+
277
+ ### Step 5.5: Dependency Analysis & Implementation Order
278
+
279
+ > **Note on `status:blocked`:** Do NOT mark dependency-blocked issues as `status:blocked`. Reserve `status:blocked` for external blockers only.
280
+
281
+ #### 5.5a. Infer Dependencies
282
+
283
+ For every open issue, determine blocking relationships using:
284
+
285
+ 1. Explicit references ("Depends on", "Blocked by", "After #N").
286
+ 2. Semantic analysis (A creates what B consumes → A blocks B).
287
+ 3. Epic internal ordering.
288
+ 4. Area overlap -- use **soft** dependencies (`Recommended after #N`) for issues that share `area:*` labels but have no true producer/consumer relationship. Soft dependencies advise sequential work to reduce merge conflicts but do not block pickup.
289
+ 5. Cross-epic dependencies.
290
+
291
+ Write each dependency into the issue's `## Dependencies` section using the format defined in the Dependency Data Model (`hatch3r-board-shared`): `Blocked by #N` for hard, `Recommended after #N` for soft.
292
+
293
+ #### 5.5b. Build the Dependency DAG
294
+
295
+ Directed graph: nodes = issues, edges = "blocked by". Validate: no cycles, identify orphans. Compute topological ordering.
296
+
297
+ #### 5.5c. Determine Implementation Order
298
+
299
+ 1. Within epics: topological order, then priority at same level. Mark parallel items.
300
+ 2. Across board: interleave by priority at each topological depth.
301
+ 3. Identify parallel lanes.
302
+
303
+ #### 5.5d. Present
304
+
305
+ Present the dependency graph, parallel groups, and implementation order by priority lane. Draft `## Dependencies` sections for each issue. For epics, derive `## Implementation Order` sections from the sub-issues' `## Dependencies` DAG (see Dependency Data Model in `hatch3r-board-shared`).
306
+
307
+ **ASK:** "Confirm or adjust dependencies and implementation order. Are there dependencies I can't see from the code -- external teams, environments, approvals, or sequencing constraints?"
308
+
309
+ ---
310
+
311
+ ### Step 5.6: Readiness Assessment
312
+
313
+ #### Readiness Criteria
314
+
315
+ Every issue must pass both **structural** and **substantive** criteria before it can be marked `status:ready`.
316
+
317
+ **Structural criteria (all must hold):**
318
+
319
+ 1. `## Dependencies` section present.
320
+ 2. Issue appears in an `## Implementation Order` section or has a global position.
321
+ 3. All required labels: one `type:*`, one `priority:*`, 1+ `area:*`, one `executor:*`, one `risk:*`.
322
+ 4. Acceptance criteria present.
323
+ 5. Issue body follows template structure.
324
+
325
+ **Substantive criteria (all must hold):**
326
+
327
+ 6. **Acceptance criteria are specific and testable** -- each criterion describes a verifiable outcome an implementer can confirm. Reject vague criteria (e.g., "Documentation is complete") in favor of measurable ones (e.g., "Getting-started guide covers install, first-run, and deployment with working code examples").
328
+ 7. **Scope is bounded** -- the issue body defines what is explicitly out of scope, or states "No scope exclusions." An issue with unbounded scope is not ready.
329
+ 8. **No unresolved unknowns** -- if Triage Context (Step 2.5) surfaced open questions or spike needs for this item, they must be resolved (user answered them) or a spike sub-issue must exist to address them before implementation begins. Items with recorded "not sure" / unanswered dimensions that affect implementability are not ready.
330
+ 9. **Effort is estimable** -- the issue is scoped narrowly enough that a developer could reasonably estimate it. If the issue is too vague or too large to estimate, it needs further decomposition or clarification.
331
+
332
+ #### Process
333
+
334
+ Evaluate each open issue at `status:triage`. Do not downgrade issues already at `status:ready`/`in-progress`/`in-review`.
335
+
336
+ 1. **Classify:** For each `status:triage` issue, check all readiness criteria (structural + substantive). Classify as Ready (all met) or Not Ready (list specific gaps).
337
+ 2. **Resolve gaps:**
338
+ - **Structural gaps -- resolve inline:** Missing labels, missing `## Dependencies`, missing implementation order position, or body not following template can be inferred and applied by the AI (same as before).
339
+ - **Substantive gaps -- ask the user:** Vague acceptance criteria, unbounded scope, unresolved unknowns, and non-estimable effort cannot be reliably resolved by the AI alone. For each substantive gap, ask the user for the missing information. Do not fabricate scope boundaries, acceptance criteria precision, or spike resolutions.
340
+ - **Missing labels:** Infer from issue content, codebase context, and classification tables in Step 3. Apply the inferred labels.
341
+ - **Missing `## Dependencies` section:** Infer from the dependency DAG built in Step 5.5. Write the section (use `None` if the issue has no blockers).
342
+ - **Missing acceptance criteria:** Draft from Triage Context answers (Step 2.5), issue body, and codebase context. If triage answers are insufficient, ask the user.
343
+ - **Missing implementation order position:** Assign based on the topological ordering from Step 5.5.
344
+ - **Body does not follow template:** Restructure the body to match the template for its type (see Step 6).
345
+ 3. **Present resolved gaps for confirmation:**
346
+
347
+ **ASK:** "I resolved the following gaps to bring issues to `status:ready`:
348
+
349
+ | Issue | Gap | Type | Resolution |
350
+ |-------|-----|------|------------|
351
+ | #N | missing priority label | Structural | Inferred `priority:p2` (default, no urgency signals) |
352
+ | #M | vague acceptance criteria | Substantive | Need your input -- what specifically must be true for this to be done? |
353
+ | #K | unresolved unknowns | Substantive | Triage flagged open questions: [list]. Create spike sub-issue, or can you answer now? |
354
+ | ... | ... | ... | ... |
355
+
356
+ For substantive gaps marked 'Need your input', please provide the missing information. Confirm or adjust structural resolutions."
357
+
358
+ 4. **Re-evaluate:** After user confirmation/adjustment, re-check all criteria. If any issue still has gaps (e.g., user rejected a resolution without providing an alternative), ask for the specific missing information and repeat from step 2. **Do not proceed until every `status:triage` issue meets all readiness criteria (structural + substantive).**
359
+ 5. **Mark ready:** Once all criteria are met, mark all evaluated issues `status:ready`.
360
+
361
+ ---
362
+
363
+ ### Step 6: Refine Issue Content
364
+
365
+ Issue bodies must follow the structure for their type. Use this condensed reference:
366
+
367
+ | Type | Body sections |
368
+ | ------------------------------ | --------------------------------------------------------------------------------------------------------- |
369
+ | Bug Report | Summary, Steps to Reproduce, Expected/Actual Behavior, Acceptance Criteria, Scope, References, Dependencies |
370
+ | Feature Request | Summary, Motivation, Proposed Solution, Acceptance Criteria, Scope, References, Dependencies |
371
+ | Code/Logical/Visual Refactor | Summary, Current State, Proposed Change, Acceptance Criteria, Scope, References, Dependencies |
372
+ | QA Validation | Summary, Test Scope, Pass/Fail Criteria, Coverage Targets, Scope, Dependencies |
373
+ | Documentation / Infrastructure | Use Feature Request structure |
374
+
375
+ **Epics** get: Overview (2-3 sentences), Sub-issues checklist, Acceptance criteria ("done when all sub-issues resolved"), all classified labels.
376
+
377
+ **Sub-issues** get: Problem/Goal, Acceptance criteria, Scope, Parent epic reference, all classified labels.
378
+
379
+ **Standalone** issues follow the sub-issue pattern without parent reference.
380
+
381
+ #### Acceptance Criteria Sourcing
382
+
383
+ Acceptance criteria must be grounded in the user's stated requirements, not AI inference from the todo text alone. Source AC in this priority order:
384
+
385
+ 1. **Triage Context (Step 2.5)** -- the user's answers to Scope/Definition and Value/Why questions are the primary source. If the user stated what "done" looks like, translate that directly into testable criteria.
386
+ 2. **User-stated edge cases or constraints** -- if the user mentioned failure modes, performance requirements, compatibility needs, or stakeholder expectations during triage, include them as criteria.
387
+ 3. **Codebase context (Step 4)** -- existing tests, interfaces, contracts, and architectural patterns that constrain the implementation inform technical criteria.
388
+ 4. **AI inference** -- only as a supplement for criteria the above sources don't cover. Flag AI-inferred criteria distinctly so the user can validate them.
389
+
390
+ Each acceptance criterion must be **specific and testable**: an implementer reading it can determine pass/fail without ambiguity. Prefer "API returns 400 with validation error for missing required fields" over "API validates input properly."
391
+
392
+ #### Scope Section
393
+
394
+ Every issue body (except epics) must include a `## Scope` section with:
395
+
396
+ - **In scope:** What this issue covers, derived from the user's triage answers.
397
+ - **Out of scope:** What this issue explicitly does not cover. Use the user's stated boundaries from triage, or "No exclusions" if the user confirmed the scope is self-evident.
398
+
399
+ #### Presenting Drafted Issues (Token-Efficient Two-Tier Format)
400
+
401
+ Do NOT render full issue bodies for every issue. Use this two-tier approach to minimize token output:
402
+
403
+ **Tier 1 -- Compact summary table (always shown):**
404
+
405
+ Present all drafted issues in a single table:
406
+
407
+ ```
408
+ | # | Title | Type | Pri | AC | Scope (1-line) | Flags |
409
+ |---|-------|------|-----|----|----------------|-------|
410
+ | 1 | OAuth2 PKCE flow | feature | P1 | 4 | Auth module only | [2 inferred AC] |
411
+ | 2 | Fix rate limiter | bug | P0 | 2 | middleware | -- |
412
+ | 3 | Update API docs | docs | P3 | 3 | REST endpoints | -- |
413
+ ```
414
+
415
+ Column definitions:
416
+
417
+ - **AC** = count of acceptance criteria for this issue
418
+ - **Scope (1-line)** = single phrase summarizing the scope boundary
419
+ - **Flags** = items needing user attention: `[N inferred AC]` (AI-inferred acceptance criteria that need validation), `[scope TBD]` (scope not yet bounded), `[spike needed]` (unresolved unknowns). Use `--` when no flags.
420
+
421
+ **Tier 2 -- Expand on demand (only when requested):**
422
+
423
+ After the table, present the ASK. Only render full issue bodies for the specific numbers the user requests. If no flags exist on any issue, the user may confirm without expanding.
424
+
425
+ **ASK:** "Here is the issue summary. Items flagged with [inferred AC] contain AI-drafted acceptance criteria that need your validation. Enter issue numbers to see full details (e.g., '1, 3'), or confirm to proceed with all as drafted."
426
+
427
+ ---
428
+
429
+ ### Step 7: Create & Update Issues via GitHub MCP
430
+
431
+ #### 7a. Create New Issues
432
+
433
+ Execute in dependency order (parents before children):
434
+
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.
439
+
440
+ #### 7b. Update Existing Issues (Board Reorganization)
441
+
442
+ For issues needing updates (from Steps 5, 5.5, 5.6):
443
+
444
+ 1. **Add/update `## Dependencies`:** Read current body, append/replace section, update via `issue_write`. Add `has-dependencies` label.
445
+ 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.
447
+ 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.
450
+
451
+ #### 7c. Present Summary
452
+
453
+ ```
454
+ New Issues Created:
455
+ | Type | Title | Issue # | Executor | Parent | Status |
456
+
457
+ Existing Issues Updated:
458
+ | Issue # | Title | Updates Applied |
459
+
460
+ Board Summary: N created, M updated, X marked ready, Y still triage, Z parallel lanes
461
+ ```
462
+
463
+ ---
464
+
465
+ ### Step 7.5: Refresh Board Dashboard
466
+
467
+ **This step is mandatory. Do not skip.**
468
+
469
+ 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.
471
+ 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.
474
+
475
+ Do NOT re-fetch all issues; use cached data.
476
+
477
+ ---
478
+
479
+ ### Step 8: Cleanup
480
+
481
+ **ASK:** "All issues created. Should I remove processed items from `todo.md`? (yes / no / only created ones)"
482
+
483
+ If yes, edit `todo.md` to remove lines for created issues. Preserve skipped/excluded lines.
484
+
485
+ ---
486
+
487
+ ## Error Handling
488
+
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.
492
+ - Never create an issue without user confirmation in Step 6.
493
+
494
+ ## Guardrails
495
+
496
+ - **Never create issues for topics already covered** without explicit user approval.
497
+ - **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).
499
+ - **Keep issue bodies concise.** Acceptance criteria must be grounded in user-stated requirements from triage, not fabricated from the todo text alone.
500
+ - **No dependency cycles.** Flag and resolve before proceeding.
501
+ - **Never downgrade issue status.** Only upgrade `status:triage` → `status:ready`.
502
+ - **Always perform the full board scan** in Step 1.5.
503
+ - **Preserve existing issue body content** when appending sections.
504
+ - **Board Overview is auto-maintained.** Exclude it from all analysis. One board overview issue at a time.