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,315 @@
1
+ ---
2
+ id: hatch3r-board-init
3
+ type: command
4
+ description: Initialize a GitHub Projects V2 board with hatch3r's label taxonomy, status fields, and board structure. Optionally migrate issues from an existing project.
5
+ ---
6
+ # Board Init -- Bootstrap a GitHub Projects V2 Board
7
+
8
+ Initialize a new or existing GitHub Projects V2 board for **{owner}/{repo}** (read from `/.agents/hatch.json` board config). Sets up status fields, creates the full hatch3r label taxonomy, optionally migrates issues from another project, and writes all IDs back to `/.agents/hatch.json` so subsequent board commands work out of the box. AI proposes configuration; user confirms before any mutation.
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
+ This command runs in two phases: **Planning** (collect all answers) then **Execution** (perform all mutations). No mutations occur until the user confirms the full plan.
37
+
38
+ ---
39
+
40
+ ### Phase 1 — Planning
41
+
42
+ Collect all configuration choices upfront. No GitHub API calls or file writes in this phase (except reads needed to present options).
43
+
44
+ #### 1.1: Read Configuration
45
+
46
+ 1. Read `/.agents/hatch.json` and cache the `board` config.
47
+ 2. Resolve owner/repo per `hatch3r-board-shared`: **Use top-level `owner`/`repo` first.** Fall back to `board.owner`/`board.repo` if top-level values are empty.
48
+ 3. If both are set (from either source), note: "Using owner=`{owner}`, repo=`{repo}`."
49
+ 4. If either is missing:
50
+
51
+ **ASK:** "I need the GitHub owner and repository for this board. Please provide: (1) owner (org or username), (2) repo name."
52
+
53
+ Update the in-memory config with the provided values.
54
+
55
+ #### 1.2: Choose Mode
56
+
57
+ **ASK:** "How would you like to set up the Projects V2 board?
58
+ - **A** — Create a new GitHub Projects V2 board
59
+ - **B** — Connect to an existing project (provide the project number)"
60
+
61
+ Record the user's choice and, for option B, the project number.
62
+
63
+ #### 1.2a: Project Name (when Mode A — Create new)
64
+
65
+ If the user chose **A** (Create new):
66
+
67
+ **ASK:** "What should the GitHub Project be named? (default: {repo} Board)"
68
+
69
+ Record the project name. If the user accepts the default or leaves it blank, use `{repo} Board`.
70
+
71
+ #### 1.2b: Default Branch
72
+
73
+ **ASK:** "What is your repository's default branch? (default: main, or current: {board.defaultBranch} if set in hatch.json)"
74
+
75
+ Record the branch name. If the user accepts the default or leaves it blank, use `main` (or existing `board.defaultBranch` from `/.agents/hatch.json` if present). This value is written to `board.defaultBranch` and used by board-pickup (checkout, PR base) and other agents.
76
+
77
+ #### 1.3: Area Labels
78
+
79
+ **ASK:** "Would you like to create area labels? If yes, list area names (e.g., frontend, backend, infra). If no, I'll skip area labels."
80
+
81
+ #### 1.4: Migration
82
+
83
+ **ASK:** "Do you have an existing GitHub project to migrate issues from? (yes + project number / no)"
84
+
85
+ #### 1.5: Board Overview
86
+
87
+ A board overview issue (labeled `meta:board-overview`) will be created by default. No user prompt needed.
88
+
89
+ #### 1.6: Confirm Plan
90
+
91
+ Present the full plan summary:
92
+
93
+ ```
94
+ Board Init Plan:
95
+ Owner/Repo: {owner}/{repo}
96
+ Default branch: {defaultBranch}
97
+ Mode: {A: Create new / B: Connect to #{N}}
98
+ Project name: {project name, or "N/A" when Mode B}
99
+ Status options: Backlog, Ready, In Progress, In Review, Done
100
+ Label taxonomy: {count} labels (types, executors, statuses, priorities, risks, meta)
101
+ Area labels: {list or "none"}
102
+ Migration: {from Project #X / "none"}
103
+ Board overview: yes (default)
104
+ ```
105
+
106
+ **ASK:** "Here is the full board init plan. Confirm to begin execution, or adjust any setting."
107
+
108
+ ---
109
+
110
+ ### Phase 2 — Execution
111
+
112
+ Execute all planned mutations in sequence. No further questions unless a mutation fails.
113
+
114
+ #### 2.1: Create or Connect Project
115
+
116
+ ##### Option A — Create New Project
117
+
118
+ 1. Fetch the repository node ID:
119
+ ```graphql
120
+ query { repository(owner: "{owner}", name: "{repo}") { id } }
121
+ ```
122
+ Use the GitHub MCP `graphql` tool with `owner: {board.owner}`, `repo: {board.repo}`.
123
+ 2. Create the project using the project name from Phase 1, step 1.2a (default: `{repo} Board`):
124
+ ```graphql
125
+ mutation { createProjectV2(input: { ownerId: "<repo_owner_node_id>", title: "{project_name}" }) { projectV2 { id number } } }
126
+ ```
127
+ The `ownerId` must be the **owner's** node ID (org or user), not the repository node ID. Fetch the owner node ID first if needed:
128
+ ```graphql
129
+ query { repositoryOwner(login: "{owner}") { id } }
130
+ ```
131
+ 3. Capture the project `id` (node ID) and `number` from the response.
132
+
133
+ ##### Option B — Connect to Existing Project
134
+
135
+ 1. Query the existing project:
136
+ ```graphql
137
+ query { user(login: "{owner}") { projectV2(number: {N}) { id number } } }
138
+ ```
139
+ Use `organization` instead of `user` if the owner is an org. Try `user` first; if it fails, retry with `organization`.
140
+ 2. Capture the project `id` and `number`.
141
+
142
+ #### 2.2: Configure Status Field
143
+
144
+ 1. Query the project's fields to find the "Status" single-select field:
145
+ ```graphql
146
+ query {
147
+ node(id: "<project_id>") {
148
+ ... on ProjectV2 {
149
+ fields(first: 50) {
150
+ nodes {
151
+ ... on ProjectV2SingleSelectField {
152
+ id name options { id name }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
159
+ ```
160
+ 2. Look for a field named "Status" (case-insensitive match).
161
+ 3. If no Status field exists, create one via the `createProjectV2Field` mutation with type `SINGLE_SELECT`.
162
+ 4. Ensure these status options exist on the field: **Backlog**, **Ready**, **In Progress**, **In Review**, **Done**.
163
+ - For missing options, use the `updateProjectV2Field` mutation (or the appropriate mutation for adding options to a single-select field) to add them.
164
+ 5. Capture the field ID and each option's ID.
165
+
166
+ #### 2.3: Create Label Taxonomy
167
+
168
+ 1. Read the label taxonomy from `board.labels` in `/.agents/hatch.json`.
169
+ 2. If labels are not defined or empty, use these defaults:
170
+
171
+ | Category | Labels |
172
+ |-----------|--------|
173
+ | Type | `type:bug`, `type:feature`, `type:refactor`, `type:qa`, `type:docs`, `type:infra` |
174
+ | Executor | `executor:agent`, `executor:human`, `executor:hybrid` |
175
+ | Status | `status:triage`, `status:ready`, `status:in-progress`, `status:in-review`, `status:blocked` |
176
+ | Priority | `priority:p0`, `priority:p1`, `priority:p2`, `priority:p3` |
177
+ | Risk | `risk:low`, `risk:med`, `risk:high` |
178
+ | Meta | `meta:board-overview`, `has-dependencies` |
179
+
180
+ 3. For each label, check if it already exists on the repository using `get_label` (or `list_labels` to fetch all at once). Create only missing labels via `create_label`.
181
+ 4. Use consistent colors per category:
182
+
183
+ | Category | Color scheme | Hex examples |
184
+ |----------|-------------|--------------|
185
+ | `type:*` | Blue shades | `#0052CC`, `#1D76DB`, `#5319E7`, `#0075CA`, `#006B75`, `#0E8A16` |
186
+ | `executor:*` | Green shades | `#0E8A16`, `#2EA44F`, `#7CFC00` |
187
+ | `status:*` | Yellow/Orange shades | `#FBCA04`, `#F9D0C4`, `#E4E669`, `#FFA500`, `#D93F0B` |
188
+ | `priority:*` | Red shades (p0 darkest) | `#B60205`, `#D93F0B`, `#E99695`, `#F9D0C4` |
189
+ | `risk:*` | Purple shades | `#5319E7`, `#7B68EE`, `#D4C5F9` |
190
+ | `meta:*` / `has-dependencies` | Gray | `#BFD4F2`, `#C5DEF5` |
191
+
192
+ 5. If the user requested area labels (from Phase 1, step 1.3), create `area:{name}` labels for each (teal/cyan color, e.g., `#006B75`). Add area names to `board.areas` in the in-memory config.
193
+
194
+ #### 2.4: Migrate from Existing Project
195
+
196
+ Skip if the user chose "no" in Phase 1, step 1.4.
197
+
198
+ 1. Query the source project to get all items:
199
+ ```graphql
200
+ query {
201
+ node(id: "<source_project_id>") {
202
+ ... on ProjectV2 {
203
+ items(first: 100, after: <cursor>) {
204
+ pageInfo { hasNextPage endCursor }
205
+ nodes {
206
+ id
207
+ content { ... on Issue { id number title } ... on PullRequest { id number title } }
208
+ fieldValues(first: 20) {
209
+ nodes {
210
+ ... on ProjectV2ItemFieldSingleSelectValue { name field { ... on ProjectV2SingleSelectField { name } } }
211
+ }
212
+ }
213
+ }
214
+ }
215
+ }
216
+ }
217
+ }
218
+ ```
219
+ Paginate until all items are retrieved. Resolve the source project node ID from the project number first (same approach as Step 2.1 Option B).
220
+ 2. For each item with linked issue content, add it to the new project board via the `addProjectV2ItemById` mutation:
221
+ ```graphql
222
+ mutation { addProjectV2ItemById(input: { projectId: "<new_project_id>", contentId: "<issue_node_id>" }) { item { id } } }
223
+ ```
224
+ 3. Map the source project's status to the new project's status options (best-effort string matching: exact match first, then case-insensitive, then substring). Update each migrated item's status on the new board using the `updateProjectV2ItemFieldValue` mutation.
225
+ 4. Report migration results in the execution log.
226
+
227
+ #### 2.5: Write Configuration Back
228
+
229
+ 1. Prepare the updated config with all captured IDs:
230
+ - **Top-level owner/repo:** Set if they were missing (per board-shared convention). Also set `board.owner`/`board.repo` for backward compatibility.
231
+ - `board.defaultBranch` — from Phase 1 step 1.2b (default: `"main"`)
232
+ - `board.projectNumber` — from the created/connected project
233
+ - `board.statusFieldId` — from the Status field
234
+ - `board.statusOptions.backlog` — option ID
235
+ - `board.statusOptions.ready` — option ID
236
+ - `board.statusOptions.inProgress` — option ID
237
+ - `board.statusOptions.inReview` — option ID
238
+ - `board.statusOptions.done` — option ID
239
+ - `board.areas` — if area labels were created
240
+
241
+ 2. Write the file. Preserve any keys outside the `board` section.
242
+
243
+ #### 2.6: Create Board Overview Issue
244
+
245
+ 1. Search for an existing open issue labeled `meta:board-overview` via `search_issues` with `owner: {board.owner}`, `repo: {board.repo}`, query `label:meta:board-overview state:open`.
246
+ 2. **If found:** Skip creation. One board overview issue at a time. Proceed to Step 2.7.
247
+ 3. **If not found:** Create an issue via `issue_write` with `method: create`, `owner: {board.owner}`, `repo: {board.repo}`:
248
+ - **Title:** `[Board Overview] {repo} Project Board`
249
+ - **Labels:** `meta:board-overview`
250
+ - **Body:**
251
+
252
+ ```markdown
253
+ ## Board Overview
254
+
255
+ **Project:** {owner}/{repo}
256
+ **Last refreshed:** {current ISO date}
257
+
258
+ ---
259
+
260
+ ## Status Summary
261
+
262
+ | Status | Count |
263
+ |--------|-------|
264
+ | Backlog / Triage | 0 |
265
+ | Ready | 0 |
266
+ | In Progress | 0 |
267
+ | In Review | 0 |
268
+ | Externally Blocked | 0 |
269
+ | **Total Open** | **0** |
270
+
271
+ ---
272
+
273
+ ## Implementation Lanes
274
+
275
+ No ready issues yet. Run `board-fill` to populate the board.
276
+
277
+ ---
278
+
279
+ *This issue is auto-maintained by hatch3r board commands. Do not close.*
280
+ ```
281
+
282
+ 4. If an issue was created in step 3, add it to the project board and set its status to **Backlog** using the Projects v2 Sync Procedure from `hatch3r-board-shared`.
283
+
284
+ #### 2.7: Summary
285
+
286
+ Print a complete summary:
287
+
288
+ ```
289
+ Board Init Complete:
290
+ Project: {owner}/{repo} (Project #{number})
291
+ Status field: configured (5 options)
292
+ Labels created: N new, M existing
293
+ Areas: [list or "none"]
294
+ Migration: N issues migrated from Project #X (or "skipped")
295
+ Board overview: #{issueNumber}
296
+ Config: /.agents/hatch.json updated
297
+ ```
298
+
299
+ ---
300
+
301
+ ## Error Handling
302
+
303
+ - **GraphQL mutation failure:** Report the error and suggest checking GitHub PAT permissions (must include `project` scope for Projects V2 operations). For gh CLI: run `gh auth refresh -s project`.
304
+ - **Label creation failure:** Report the failing label, continue with remaining labels. Summarize failures at end.
305
+ - **Migration failure:** Report per-item, continue with remaining items. Summarize at end.
306
+ - **Never create or mutate without user confirmation.**
307
+
308
+ ## Guardrails
309
+
310
+ - **Never modify or delete existing labels.** Only create missing ones.
311
+ - **Never remove issues from existing projects.** Migration is additive only.
312
+ - **Collect all choices in Phase 1 before any mutations in Phase 2.**
313
+ - **Never skip Planning questions or the plan confirmation step.**
314
+ - **Require `project` scope** on the GitHub token for Projects V2 operations. If mutations fail with permission errors, surface this requirement. For gh CLI (used by board-fill, board-pickup, etc.): run `gh auth refresh -s project`.
315
+ - **Preserve existing `/.agents/hatch.json` content** outside the `board` key when writing config back.