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
@@ -0,0 +1,336 @@
1
+ ---
2
+ id: hatch3r-quick-change
3
+ type: command
4
+ description: Lightweight command for small changes not worth tracking on the board. Adaptive ceremony with inline or sub-agent implementation, batch support, and soft scope guards.
5
+ tags: [core, implementation]
6
+ ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ | Stage | Agent(s) | Parallel | Required |
11
+ |-------|----------|----------|----------|
12
+ | 1. Scale Assessment | Orchestrator (inline) | No | Yes |
13
+ | 2. Implementation | `hatch3r-implementer` (nontrivial items) | Per item | Nontrivial only |
14
+ | 3. Lint Fix | `hatch3r-lint-fixer` | No | When lint/type errors |
15
+ | 4a. Review Loop | `hatch3r-reviewer` -> `hatch3r-fixer` (max 3 iterations) | No (sequential) | Nontrivial only |
16
+ | 4b. Final Quality | `hatch3r-test-writer` + `hatch3r-security-auditor` | Yes | Nontrivial code changes |
17
+
18
+ ## Browser Automation
19
+
20
+ At the start of this command, ask the user once:
21
+
22
+ > "Would you like to enable browser verification for this session? This uses Playwright to test changes in the running application."
23
+
24
+ If **yes**: implementation and review stages include browser verification steps — navigate to affected pages, interact with changed elements, check console for errors, capture screenshots.
25
+
26
+ If **no**: all browser verification steps are skipped silently throughout the entire command.
27
+
28
+ # Quick Change -- Fast Path for Small, Board-Free Changes
29
+
30
+ Lightweight command for changes not worth tracking as board issues -- typo fixes, constant tweaks, small refactors, config updates, documentation edits. Adaptive ceremony: trivial changes are implemented inline; nontrivial changes delegate to the implementer agent with a light review. Supports batching multiple small changes into a single invocation and commit.
31
+
32
+ Sits alongside `hatch3r-workflow` as a lower-ceremony alternative. If a change grows beyond quick-change territory, the command recommends switching to `hatch3r-workflow`.
33
+
34
+ ---
35
+
36
+ ## Scope
37
+
38
+ This command intentionally skips:
39
+ - Board context (`hatch3r-board-shared`)
40
+ - GitHub issues and PRs
41
+ - Researcher sub-agent
42
+ - Full review pipeline (security-auditor, test-writer, docs-writer)
43
+ - Learnings capture
44
+
45
+ It retains:
46
+ - Quality checks (lint, typecheck, test) -- always mandatory
47
+ - Adaptive sub-agent delegation (implementer for nontrivial items)
48
+ - Light code review (reviewer for nontrivial items only)
49
+ - `scope: always` rules from `.agents/rules/`
50
+ - Soft scope guards to prevent misuse
51
+
52
+ ---
53
+
54
+ ## Global Rule Overrides
55
+
56
+ - **Git commands are fully permitted** during Step 7 (Git Action), including `git add`, `git commit`, and `git push`.
57
+
58
+ ## Token-Saving Directives
59
+
60
+ 1. **No shared context loading.** Do NOT read `hatch3r-board-shared`. Do NOT fetch GitHub issues or PRs.
61
+ 2. **Minimal researcher usage.** No researcher for Tier 1 items. For Tier 2 items that proceed through quick-change, only `similar-implementation` at `quick` depth. Tier 3 items must be routed to `hatch3r-workflow`.
62
+ 3. **Targeted file reads only.** Read only files directly relevant to the described change(s).
63
+ 4. **No learnings capture.** Quick changes are too small to produce meaningful learnings.
64
+ 5. **Minimal rule loading.** Load `scope: always` rules only when spawning sub-agents in Steps 4b or 6.
65
+
66
+ ---
67
+
68
+ ## Workflow
69
+
70
+ Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
71
+
72
+ ### Step 1: Input and Batch Parsing
73
+
74
+ Parse the user's description into discrete change items.
75
+
76
+ 1. Extract each distinct change from the user's message. A single description may contain multiple changes (e.g., "rename this constant, fix that typo, and update the config default").
77
+ 2. For each change item, record:
78
+ - **Description**: what needs to change
79
+ - **Type**: fix / tweak / refactor / config / docs
80
+ - **Affected area**: inferred file paths or directories
81
+ 3. If the user describes a single change, treat it as a batch of one.
82
+
83
+ ---
84
+
85
+ ### Step 2: Scale Assessment (Soft Guard)
86
+
87
+ Evaluate whether the described changes fit the quick-change scope.
88
+
89
+ #### 2a. Estimate Scope
90
+
91
+ For each change item, estimate:
92
+ - Number of files affected
93
+ - Approximate lines changed
94
+ - Whether it touches security-sensitive areas (auth, payments, database schemas, access control)
95
+ - Whether it introduces new dependencies or modules
96
+
97
+ Aggregate across the batch for total estimated scope.
98
+
99
+ #### 2b. Apply Soft Guard and Complexity Scoring
100
+
101
+ **Score complexity** per the `hatch3r-deep-context` rule for the overall change (or each item individually if items are unrelated). Determine the analysis tier (Light / Standard / Deep).
102
+
103
+ **Hard block — Tier 3 (Deep):** If any item scores Tier 3, quick-change is not appropriate.
104
+
105
+ **ASK:** "This change scores Tier 3 (Deep complexity): {reason}. Quick-change does not provide the research depth needed. Options: (a) switch to `hatch3r-workflow`, (b) narrow the scope."
106
+
107
+ Do NOT offer a "proceed anyway" option for Tier 3. The user must switch to workflow or narrow scope.
108
+
109
+ **Soft guard — Tier 2 (Standard) or threshold triggers:** If any item scores Tier 2, or if any of these threshold triggers fire (any one is sufficient):
110
+ - Estimated total exceeds **5 files**
111
+ - Estimated total exceeds **~200 lines changed**
112
+ - Changes touch security-sensitive areas
113
+ - Changes require new dependencies or architectural decisions
114
+
115
+ **ASK:** "This looks larger than a quick change: {reason}. Options: (a) proceed with lightweight research, (b) switch to `hatch3r-workflow` for full ceremony, (c) narrow the scope."
116
+
117
+ If no threshold is triggered and all items are Tier 1, present the change list:
118
+
119
+ ```
120
+ Quick Change Scope:
121
+ Items: {N}
122
+ 1. {description} — {type} — {affected area}
123
+ 2. ...
124
+ Estimated scope: {N} files, ~{N} lines
125
+ ```
126
+
127
+ **ASK:** "Proceed with these changes? (yes / adjust)"
128
+
129
+ ---
130
+
131
+ ### Step 3: Classify Each Change Item
132
+
133
+ Classify each item to determine the implementation path.
134
+
135
+ #### Trivial Signals (inline implementation)
136
+
137
+ - Single-file change
138
+ - Config value update
139
+ - Typo or comment fix
140
+ - Import reordering or fix
141
+ - Constant rename or value change
142
+ - Single-line logic correction
143
+ - Documentation text edit
144
+ - Environment variable update
145
+
146
+ #### Nontrivial Signals (implementer sub-agent)
147
+
148
+ - Multiple files affected
149
+ - New function, method, or module
150
+ - Behavior change requiring test updates
151
+ - Cross-module refactor
152
+ - API signature change
153
+ - Logic branch addition or removal
154
+
155
+ Classify each item as **trivial** or **nontrivial**. If ambiguous, default to **nontrivial**.
156
+
157
+ ---
158
+
159
+ ### Step 4: Implementation (Adaptive)
160
+
161
+ Implement each change item using the path determined by its classification.
162
+
163
+ #### 4a. Trivial Items -- Inline Implementation
164
+
165
+ For each trivial item:
166
+
167
+ 1. Read the target file.
168
+ 2. Make the change directly.
169
+ 3. Verify the file is syntactically valid (no broken imports, no parse errors).
170
+
171
+ No sub-agent delegation. No researcher. Implement and move on.
172
+
173
+ #### 4b. Nontrivial Items -- Implementer Sub-Agent
174
+
175
+ For each nontrivial item (or group of related nontrivial items):
176
+
177
+ 1. Read `scope: always` rules from `.agents/rules/`.
178
+
179
+ 2. **Lightweight research (Tier 2 items only):** If the item scored Tier 2 in Step 2b and the user chose to proceed with lightweight research, spawn a `hatch3r-researcher` sub-agent with:
180
+ - **Modes:** `similar-implementation` at `quick` depth (1 reference implementation)
181
+ - **Research brief:** The change description and affected files.
182
+ - Await the result. Pass the output (reference conventions) to the implementer prompt in step 3.
183
+
184
+ 3. Spawn a `hatch3r-implementer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
185
+
186
+ The implementer prompt MUST include:
187
+ - The change description and affected files.
188
+ - All `scope: always` rule directives.
189
+ - Explicit instruction: do NOT create branches, commits, or PRs.
190
+ - **Reference conventions** from `similar-implementation` output (if step 2 ran) — triggers the implementer's Convention Lock step.
191
+ - If no researcher ran: explicit instruction that no researcher context is available; work from the change description and codebase alone.
192
+
193
+ If multiple nontrivial items affect **independent areas** (no shared files), spawn one implementer per area and run them in parallel.
194
+
195
+ If multiple nontrivial items affect **overlapping files**, process them sequentially through a single implementer to avoid conflicts.
196
+
197
+ 4. Await the implementer result. If the implementer reports BLOCKED, **ASK** the user for guidance.
198
+
199
+ ---
200
+
201
+ ### Step 5: Quality Checks
202
+
203
+ Run the project's quality gates. Refer to `package.json` scripts, `README.md`, or project conventions for the appropriate commands.
204
+
205
+ #### 5a. Run Checks
206
+
207
+ 1. Lint (e.g., `npm run lint`)
208
+ 2. Type check (e.g., `npm run typecheck`)
209
+ 3. Test suite (e.g., `npm run test`)
210
+
211
+ #### 5b. Handle Failures
212
+
213
+ - **Simple failures** (unused import, formatting): fix inline.
214
+ - **Lint/type failures requiring structured fixes**: spawn `hatch3r-lint-fixer` sub-agent with the specific errors.
215
+ - **Test failures**: analyze the failure. If the change intentionally altered behavior and the test needs updating, update it. If the change broke something unintentionally, fix the change.
216
+
217
+ Max 2 retry loops on quality check failures. After 2 retries:
218
+
219
+ **ASK:** "Quality checks still failing after 2 fix attempts: {specific failures}. Options: (a) I'll fix manually, commit what we have, (b) keep trying, (c) abort changes."
220
+
221
+ ---
222
+
223
+ ### Step 6: Review and Final Quality (Nontrivial Items Only)
224
+
225
+ Skip this step entirely if ALL items were classified as trivial in Step 3.
226
+
227
+ #### 6a. Review Loop
228
+
229
+ For nontrivial items, run an iterative review loop (max 3 iterations) until 0 Critical + 0 Warning findings remain:
230
+
231
+ 1. Spawn `hatch3r-reviewer` sub-agent via the Task tool (`subagent_type: "generalPurpose"`).
232
+
233
+ The reviewer prompt MUST include:
234
+ - The diff of all changes made (use `git diff` on the working tree).
235
+ - Focus areas: **correctness and code quality only**. Skip security deep-dive, performance profiling, and documentation review.
236
+ - All `scope: always` rule directives from `.agents/rules/`.
237
+ - Iteration number and previous findings (if not the first iteration).
238
+
239
+ 2. Process reviewer output:
240
+ - If **0 Critical and 0 Warning** findings: review loop is clean. Proceed to Step 6b.
241
+ - If Critical or Warning findings remain: spawn `hatch3r-fixer` sub-agent to address them, then re-run the reviewer (next iteration).
242
+ - **Suggestions**: skip. The point of quick-change is speed.
243
+
244
+ 3. If 3 iterations complete and findings remain, **ASK** the user whether to proceed or fix manually.
245
+
246
+ 4. After any fixes, re-run quality checks (Step 5a) to verify nothing broke.
247
+
248
+ #### 6b. Final Quality
249
+
250
+ After the review loop is clean, spawn both agents in parallel via the Task tool:
251
+
252
+ 1. `hatch3r-test-writer` — write or update tests for nontrivial code changes.
253
+ 2. `hatch3r-security-auditor` — lightweight security review of nontrivial code changes.
254
+
255
+ Both prompts MUST include:
256
+ - The diff of all changes made.
257
+ - All `scope: always` rule directives from `.agents/rules/`.
258
+
259
+ Apply any resulting changes (new tests, security fixes). Re-run quality checks (Step 5a) if changes were made.
260
+
261
+ ---
262
+
263
+ ### Step 7: Git Action
264
+
265
+ **ASK:** "All changes complete. Quality checks pass. How should I handle git? (a) commit only, (b) commit and push, (c) skip git — leave changes in working tree"
266
+
267
+ #### Option (a): Commit Only
268
+
269
+ ```bash
270
+ git add -A
271
+ git commit -m "{commit message}"
272
+ ```
273
+
274
+ #### Option (b): Commit and Push
275
+
276
+ ```bash
277
+ git add -A
278
+ git commit -m "{commit message}"
279
+ git push
280
+ ```
281
+
282
+ If `git push` fails (e.g., no upstream), use `git push -u origin {branch}`.
283
+
284
+ #### Option (c): Skip Git
285
+
286
+ Leave all changes in the working tree. Do not stage or commit.
287
+
288
+ #### Commit Message Format
289
+
290
+ - **Single item**: `quick: {short description}` (e.g., `quick: fix typo in error message`)
291
+ - **Batch**: `quick: {N} small changes` with a body listing each item:
292
+ ```
293
+ quick: 3 small changes
294
+
295
+ - fix typo in auth error message
296
+ - update default timeout to 30s
297
+ - remove unused import in utils.ts
298
+ ```
299
+
300
+ ---
301
+
302
+ ### Step 8: Summary
303
+
304
+ Present a concise completion summary:
305
+
306
+ ```
307
+ Quick Change Complete:
308
+ Items: {N} ({trivial_count} trivial, {nontrivial_count} nontrivial)
309
+ Files changed: {file list}
310
+ Quality: lint {pass/fail}, types {pass/fail}, tests {pass/fail}
311
+ Review: {skipped / N findings applied}
312
+ Git: {committed on {branch} / committed and pushed / skipped}
313
+ ```
314
+
315
+ ---
316
+
317
+ ## Error Handling
318
+
319
+ - **Quality check failure after 2 retries**: Present the specific failures and ASK the user whether to commit partial progress, keep trying, or abort.
320
+ - **Implementer sub-agent failure**: Retry once. If the retry fails, fall back to inline implementation for that item. If inline implementation also fails, report the item as unresolved and ASK.
321
+ - **Reviewer flags critical issues**: Present them and ASK whether to fix or proceed without fixing.
322
+ - **Scope creep during implementation**: If actual changes exceed the soft guard thresholds (5 files / 200 lines), warn the user and suggest deferring remaining items to a `hatch3r-workflow` session.
323
+ - **Push failure**: Present the error. Use `git push -u origin {branch}` for new branches. For diverged branches, suggest `git pull --rebase` and ASK before proceeding.
324
+ - **Context degradation (>15 turns)**: Quick changes should complete fast. If the session exceeds 15 turns, suggest starting fresh or switching to `hatch3r-workflow`.
325
+
326
+ ## Guardrails
327
+
328
+ - **Never skip quality checks (Step 5)** -- even for trivial changes. Lint, typecheck, and test must pass.
329
+ - **Never auto-commit without ASK (Step 7).** The user always decides the git action.
330
+ - **Soft guard is advisory, not blocking.** The user can always override the scope warning.
331
+ - **Stay within the described changes.** Do not expand scope, refactor adjacent code, or add features beyond what was requested.
332
+ - **Recommend `hatch3r-workflow` if scope grows.** If implementation reveals the change is larger than expected, pause and recommend switching.
333
+ - **No board operations.** Never create issues, update project boards, or sync with GitHub Projects.
334
+ - **No PR creation.** Quick changes commit directly; PRs are the user's responsibility if needed.
335
+ - **Respect `scope: always` rules** when delegating to sub-agents. Sub-agents do not inherit rules automatically.
336
+ - **This command composes existing hatch3r agents** (implementer, reviewer, lint-fixer) -- it does not replace them.
@@ -2,7 +2,13 @@
2
2
  id: hatch3r-recipe
3
3
  type: command
4
4
  description: Execute shareable workflow recipes that compose agents, skills, and commands into guided sequences for common development scenarios
5
+ tags: [core]
5
6
  ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ This command orchestrates other commands and skills as recipe steps. It does not spawn sub-agents directly — the composed commands handle their own agent delegation.
11
+
6
12
  # Recipe System — Composable Workflow Orchestration
7
13
 
8
14
  Execute predefined or custom workflow recipes that chain hatch3r's agents, skills, and commands into repeatable guided sequences for common development scenarios.
@@ -2,7 +2,17 @@
2
2
  id: hatch3r-refactor-plan
3
3
  type: command
4
4
  description: Plan a refactoring or migration effort -- spawn parallel researchers, produce refactoring spec, ADR(s), and phased todo.md entries for board-fill.
5
+ tags: [planning]
5
6
  ---
7
+
8
+ ## Agent Pipeline
9
+
10
+ | Stage | Agent(s) | Parallel | Required |
11
+ |-------|----------|----------|----------|
12
+ | 1. Research | `hatch3r-researcher` (4 parallel: current-state, refactoring-strategy, risk-assessment, migration-path) | Yes | Yes |
13
+ | 2. Document Generation | `hatch3r-docs-writer` (refactoring spec, ADRs) | Yes | Yes |
14
+ | 3. Todo Generation | Orchestrator (inline) | No | Yes |
15
+
6
16
  # Refactor Plan — Refactoring & Migration Specification from Problem to Phased Execution
7
17
 
8
18
  Take a refactoring goal or migration need and produce a complete refactoring specification (`docs/specs/`), architectural decision records (`docs/adr/`) when the approach involves significant design choices, and structured `todo.md` entries (phased work items) ready for `hatch3r-board-fill`. Spawns parallel researcher sub-agents (current state analysis, refactoring strategy, impact & risk assessment, migration path planning) to design the refactoring from multiple angles before generating artifacts. AI proposes all outputs; user confirms before any files are written. Optionally chains into `hatch3r-board-fill` to create GitHub issues immediately.
@@ -78,10 +88,10 @@ Refactoring Brief:
78
88
  - `docs/specs/` — project specifications (read TOC/headers first, expand relevant sections only)
79
89
  - `docs/adr/` — architectural decision records (scan for decisions relevant to the target area)
80
90
  - `README.md` — project overview
81
- - `/.agents/hatch.json` — board configuration
91
+ - `.agents/hatch.json` — board configuration
82
92
  - Existing `todo.md` — current backlog (check for overlap or related items)
83
93
  2. Scan GitHub issues via `search_issues` for existing work related to the refactoring area. Note in-progress work, dependencies, or prior refactoring attempts.
84
- 3. If `/.agents/learnings/` exists, scan for learnings relevant to the target area. Match by area and tags against the refactoring brief.
94
+ 3. If `.agents/learnings/` exists, scan for learnings relevant to the target area. Match by area and tags against the refactoring brief.
85
95
  4. Scan test coverage in the target area — identify which parts have strong test coverage (safe to refactor) vs. weak coverage (need tests first).
86
96
  5. Present a context summary:
87
97
 
@@ -117,9 +127,12 @@ Spawn one sub-agent per research domain below concurrently, each following the *
117
127
  | 2 | `refactoring-strategy` | Design transformations, behavioral invariants, interface contracts, effort |
118
128
  | 3 | `risk-assessment` | Breaking changes, downstream consumers, regression hotspots, rollback strategy |
119
129
  | 4 | `migration-path` | Phased execution plan, parallel lanes, rollback points, skill mapping |
130
+ | 5 | `similar-implementation` | Find analogous refactored modules, extract their target patterns, recommend conventions to follow |
120
131
 
121
132
  Each sub-agent produces the structured output defined by its mode in the hatch3r-researcher agent specification. Modes `current-state` and `refactoring-strategy` apply dimension-specific focus (structural/logical/visual/migration) based on the dimension(s) passed in the brief.
122
133
 
134
+ The `similar-implementation` sub-agent finds modules that have already been refactored or that represent the target state the refactoring should aim for. Its convention extraction ensures the refactored code aligns with established codebase patterns rather than inventing new ones.
135
+
123
136
  Wait for all sub-agents to complete before proceeding.
124
137
 
125
138
  ---
@@ -131,16 +144,17 @@ Wait for all sub-agents to complete before proceeding.
131
144
  ```
132
145
  Refactoring Summary:
133
146
 
134
- Title: {title}
135
- Dimension(s): {Structural / Logical / Visual / Migration}
136
- Affected files: {N} files across {M} modules
137
- Phases: {N} phases ({X} parallelizable)
138
- Total effort: {estimate}
139
- ADRs needed: {N} architectural decisions
140
- Risks: {N} risks ({X} high, {Y} med, {Z} low)
141
- Breaking changes: {N} ({list if any})
142
- Test gaps: {N} areas need tests before refactoring
143
- Prerequisites: {listtests to add, docs to update, etc.}
147
+ Title: {title}
148
+ Dimension(s): {Structural / Logical / Visual / Migration}
149
+ Affected files: {N} files across {M} modules
150
+ Phases: {N} phases ({X} parallelizable)
151
+ Total effort: {estimate}
152
+ ADRs needed: {N} architectural decisions
153
+ Risks: {N} risks ({X} high, {Y} med, {Z} low)
154
+ Breaking changes: {N} ({list if any})
155
+ Test gaps: {N} areas need tests before refactoring
156
+ Convention reference: {reference module} refactored code should follow patterns from {name}
157
+ Prerequisites: {list — tests to add, docs to update, etc.}
144
158
  ```
145
159
 
146
160
  2. **Highlight conflicts** between researchers. Common conflict types:
@@ -162,6 +176,8 @@ Prerequisites: {list — tests to add, docs to update, etc.}
162
176
 
163
177
  ### Step 5: Generate Refactoring Spec
164
178
 
179
+ **Note:** Documents (refactoring spec and ADRs in Steps 5–6) should be generated by spawning parallel `hatch3r-docs-writer` sub-agents via the Task tool (`subagent_type: "generalPurpose"`) rather than the orchestrator writing directly.
180
+
165
181
  From the merged researcher outputs, generate a refactoring specification document. Present all content for review before writing any files.
166
182
 
167
183
  #### Refactoring Spec — `docs/specs/{NN}_{refactor-slug}.md`
@@ -403,7 +419,7 @@ If yes, instruct the user to invoke the `hatch3r-board-fill` command. Note that
403
419
  - **Sub-agent failure:** Retry the failed sub-agent once. If it fails again, present partial results from the remaining sub-agents and ask the user how to proceed (continue without that researcher's input / provide the missing information manually / abort).
404
420
  - **Conflicting researcher outputs:** Present both options side by side with trade-offs. Ask the user to decide. Do not silently pick one.
405
421
  - **File write failure:** Report the error and provide the full file content so the user can create the file manually.
406
- - **Missing project context:** If no `hatch3r-board-shared` or `/.agents/hatch.json` exists, proceed without board context — this command does not require board configuration.
422
+ - **Missing project context:** If no `hatch3r-board-shared` or `.agents/hatch.json` exists, proceed without board context — this command does not require board configuration.
407
423
  - **No existing specs or docs:** Proceed without spec references. Warn that the refactoring spec will be less contextualized without existing project documentation. Recommend running `hatch3r-project-spec` or `hatch3r-codebase-map` first for best results.
408
424
  - **Duplicate detection:** If the refactoring overlaps significantly with existing todo.md items or GitHub issues found in Step 2, present the overlap and ASK whether to proceed (augment existing / replace / abort).
409
425
  - **Weak test coverage:** If the current state analyzer finds weak test coverage in the target area, the migration path planner MUST include a Phase 0 for test scaffolding. Do not proceed with refactoring phases without adequate coverage.
@@ -1,14 +1,24 @@
1
+ ---
2
+ id: hatch3r-release
3
+ type: command
4
+ description: Cut a versioned release with changelog generation, version bumping, and GitHub release creation.
5
+ tags: [devops]
6
+ ---
1
7
  # Release — Cut a Versioned Release with Changelog
2
8
 
3
9
  Cut a versioned release for **{owner}/{repo}** with changelog generation, quality verification, version bump, git tagging, GitHub release creation, and optional deploy verification. Follows semantic versioning (major/minor/patch) based on merged PR classification.
4
10
 
5
11
  ---
6
12
 
13
+ ## Agent Pipeline
14
+
15
+ This command runs as a single orchestrator without sub-agent delegation. Quality verification uses direct CLI commands (lint, typecheck, test) rather than specialist agents.
16
+
7
17
  ## Shared Context
8
18
 
9
- **Read the project's shared board context at the start of the run** (e.g., `.cursor/commands/board-shared.md` or equivalent). It contains GitHub Context, Project Reference, and tooling directives. Use GitHub MCP tools for issue/PR operations. Fallback to `gh` CLI for release creation (outside MCP catalog).
19
+ **Read the project's shared board context at the start of the run** (e.g., `.agents/commands/hatch3r-board-shared.md` or equivalent). It contains GitHub Context, Project Reference, and tooling directives. Use GitHub MCP tools for issue/PR operations. Fallback to `gh` CLI for release creation (outside MCP catalog).
10
20
 
11
- **Default branch:** Use `board.defaultBranch` from `/.agents/hatch.json` (fallback: `"main"`) for all git operations involving the base branch (e.g., `git log`, `search_pull_requests` with `base`, `git push origin`).
21
+ **Default branch:** Use `board.defaultBranch` from `.agents/hatch.json` (fallback: `"main"`) for all git operations involving the base branch (e.g., `git log`, `search_pull_requests` with `base`, `git push origin`).
12
22
 
13
23
  ## Global Rule Overrides
14
24
 
@@ -138,7 +148,7 @@ git tag v{version}
138
148
 
139
149
  ### Step 7: Push
140
150
 
141
- Use `{base}` = `board.defaultBranch` from `/.agents/hatch.json` (fallback: `"main"`).
151
+ Use `{base}` = `board.defaultBranch` from `.agents/hatch.json` (fallback: `"main"`).
142
152
 
143
153
  ```bash
144
154
  git push origin {base} && git push origin v{version}