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,114 @@
1
+ ---
2
+ id: hatch3r-perf-audit
3
+ description: Profile and optimize application performance against defined budgets. Use when investigating performance issues, auditing performance budgets, or optimizing hot paths.
4
+ ---
5
+ > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool as appropriate.
6
+
7
+ # Performance Audit Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Read performance budgets from rules and specs
14
+ - [ ] Step 2: Profile — bundle size, runtime, memory
15
+ - [ ] Step 3: Identify violations — which budgets exceeded, which hot paths slow
16
+ - [ ] Step 4: Plan optimizations — code splitting, lazy loading, memoization, etc.
17
+ - [ ] Step 5: Implement optimizations with before/after measurements
18
+ - [ ] Step 6: Verify all budgets met, no regressions
19
+ ```
20
+
21
+ ## Step 1: Read Performance Budgets
22
+
23
+ Load the project's performance budgets from project rules and quality documentation:
24
+
25
+ - Common metrics: render frame rate, cold start to interactive, idle CPU usage, memory footprint, event processing latency, bundle size (initial, gzipped), database reads per session, API warm execution.
26
+ - Note which surface is in scope: frontend, backend, or both.
27
+ - Read project architecture docs for constraints if auditing a specific module.
28
+
29
+ ## Step 2: Profile
30
+
31
+ **Bundle size:**
32
+
33
+ - Run `npm run build`. Inspect output for gzipped sizes.
34
+ - Use `vite-bundle-visualizer`, `rollup-plugin-visualizer`, or `webpack-bundle-analyzer` (or build tool equivalent) to identify large chunks and dependencies.
35
+ - Compare bundle sizes if multiple build targets exist.
36
+
37
+ **Runtime (frontend):**
38
+
39
+ - Use Chrome DevTools Performance tab: record startup, record key interactions.
40
+ - Measure: Time to Interactive (TTI), First Contentful Paint (FCP), Largest Contentful Paint (LCP).
41
+ - Use **cursor-ide-browser MCP** `browser_profile_start`/`browser_profile_stop` for CPU profiling with call stacks.
42
+ - Check frame rate during animations (target: 60fps, 16ms/frame).
43
+
44
+ **Memory:**
45
+
46
+ - Heap snapshot before/after session. Target per project budget.
47
+ - Look for leaks: detached DOM, growing arrays, uncleared timers.
48
+
49
+ **Backend/API:**
50
+
51
+ - Check monitoring for cold start and warm execution times.
52
+ - Instrument key paths.
53
+
54
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
55
+
56
+ ## Step 3: Identify Violations
57
+
58
+ - List which budgets are exceeded and by how much.
59
+ - Identify hot paths: which functions/components contribute most to latency or bundle size.
60
+ - Prioritize: critical user flows first.
61
+ - Document baseline measurements for comparison.
62
+
63
+ ## Step 4: Plan Optimizations
64
+
65
+ Common strategies:
66
+
67
+ - **Code splitting:** Route-based or component-based. Lazy-load panels, modals, non-critical features.
68
+ - **Lazy loading:** `defineAsyncComponent`, dynamic `import()` for heavy components.
69
+ - **Memoization:** `computed`, `memo` for expensive derivations. Avoid unnecessary re-renders.
70
+ - **Reduce re-renders:** `v-show` over `v-if` for frequently toggled. `shallowRef` where appropriate.
71
+ - **Bundle:** Remove unused deps, replace heavy libs with lighter alternatives, tree-shake.
72
+ - **Images/assets:** Optimize, lazy-load, use appropriate formats.
73
+ - **Database:** Reduce reads (batch, cache, denormalize).
74
+ - **Cloud/API:** Warm-up strategies, reduce cold starts.
75
+
76
+ - Check project ADRs for constraints. Ensure optimizations don't violate privacy/security invariants.
77
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
78
+
79
+ ## Step 5: Implement Optimizations
80
+
81
+ - Apply changes incrementally. Measure before and after each change.
82
+ - Document before/after for each metric in PR or audit report.
83
+ - Respect `prefers-reduced-motion` — do not add animations that ignore it.
84
+ - Run full test suite after each optimization to avoid functional regressions.
85
+
86
+ ## Step 6: Verify
87
+
88
+ ```bash
89
+ npm run lint && npm run typecheck && npm run test
90
+ npm run build
91
+ ```
92
+
93
+ - All performance budgets met.
94
+ - No functional regressions.
95
+ - Before/after measurements documented.
96
+ - CI performance check passes (if configured).
97
+
98
+ ## Required Agent Delegation
99
+
100
+ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`) at the appropriate points:
101
+
102
+ - **`hatch3r-perf-profiler`** — MUST spawn to perform autonomous performance profiling and optimization. Provide the target areas, budget thresholds, and baseline measurements.
103
+
104
+ ## Related Rules
105
+
106
+ - **Rule**: `hatch3r-performance-budgets` — reference this rule for the project's defined performance budget thresholds
107
+
108
+ ## Definition of Done
109
+
110
+ - [ ] All performance budgets met
111
+ - [ ] Before/after measurements documented
112
+ - [ ] No functional regressions
113
+ - [ ] Bundle size within budget (if defined)
114
+ - [ ] Key metrics within project targets
@@ -0,0 +1,85 @@
1
+ ---
2
+ id: hatch3r-pr-creation
3
+ description: Create a pull request following project conventions including branch naming, PR template, checklist, and rollout plan. Use when opening or preparing a pull request, or when the user asks to create a PR.
4
+ ---
5
+ > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool as appropriate.
6
+
7
+ # PR Creation Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Verify branch naming
14
+ - [ ] Step 2: Self-review against checklist
15
+ - [ ] Step 3: Fill PR template
16
+ - [ ] Step 4: Create the PR
17
+ ```
18
+
19
+ ## Step 1: Branch Naming
20
+
21
+ Branches must follow `{type}/{short-description}`:
22
+
23
+ | Type | When to Use | Example |
24
+ | ----------- | ---------------------------------- | ----------------------------- |
25
+ | `feat/` | New features | `feat/add-user-preferences` |
26
+ | `fix/` | Bug fixes | `fix/login-validation-bug` |
27
+ | `refactor/` | Code, logical, or visual refactors | `refactor/simplify-auth-flow` |
28
+ | `qa/` | QA validation or test additions | `qa/e2e-checkout-flow` |
29
+ | `docs/` | Documentation changes | `docs/update-readme` |
30
+ | `infra/` | CI/CD, tooling, infrastructure | `infra/add-lint-ci-step` |
31
+
32
+ Rules: lowercase, hyphens (no underscores), 3-5 words max.
33
+
34
+ ## Step 2: Self-Review Checklist
35
+
36
+ Before creating the PR, verify:
37
+
38
+ **Scope:** Changes limited to the stated issue. No unrelated changes. No TODOs without linked issues.
39
+
40
+ **Quality:** Code compiles (`npm run typecheck`). Lint passes (`npm run lint`). All tests pass (`npm run test`). No `any` types. No `@ts-ignore` without linked issue.
41
+
42
+ **Security & Privacy:** No secrets in code. Database rules updated and tested if data model changed. No sensitive content leaks to cloud. Event metadata uses allowlisted keys. Entitlement gates enforced server-side if gated.
43
+
44
+ **Accessibility (if UI):** Animations respect `prefers-reduced-motion`. Color contrast meets WCAG AA. Interactive elements keyboard accessible.
45
+
46
+ ## Step 3: Fill PR Template
47
+
48
+ Use the project's PR template. Fill every section:
49
+
50
+ - **Summary:** 1-3 sentences on what and why
51
+ - **Type:** Feature / Bug fix / Refactor / QA / Docs / Infra
52
+ - **Related Issues:** `Closes #N` or `Relates to #N`
53
+ - **Changes:** Bullet list of key changes
54
+ - **Screenshots:** Required for UI changes (before/after)
55
+ - **Testing:** Which tests added/updated, manual test steps
56
+ - **Rollout Plan:** Feature flag / gradual / direct
57
+ - **Rollback Plan:** How to revert
58
+
59
+ ## Step 4: Create the PR
60
+
61
+ PR title format: `{type}: {short description} (#issue)`
62
+
63
+ Examples:
64
+
65
+ - `feat: add user preferences panel (#42)`
66
+ - `fix: correct validation for email field (#87)`
67
+
68
+ ## Required Agent Delegation
69
+
70
+ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`) at the appropriate points:
71
+
72
+ - **`hatch3r-reviewer`** — MUST spawn before PR creation for code review. Include the full diff and acceptance criteria in the prompt. Apply reviewer feedback before creating the PR.
73
+
74
+ ## Related Skills
75
+
76
+ - **Skill**: `hatch3r-issue-workflow` — use this skill for the parent issue-to-PR workflow that feeds into PR creation
77
+
78
+ ## Size Guidelines
79
+
80
+ | Files Changed | Recommendation |
81
+ | ------------- | ------------------------------------ |
82
+ | 1-5 | Ideal. Review and merge quickly. |
83
+ | 6-15 | Acceptable. Thorough PR description. |
84
+ | 16-30 | Split if possible. |
85
+ | 30+ | Must be split. |
@@ -0,0 +1,86 @@
1
+ ---
2
+ id: hatch3r-qa-validation
3
+ description: E2E validation workflow producing a structured pass/fail report with evidence. Use when running QA validation, acceptance testing, verifying releases, or working on QA E2E validation issues.
4
+ ---
5
+ # QA E2E Validation Workflow
6
+
7
+ ## Quick Start
8
+
9
+ ```
10
+ Task Progress:
11
+ - [ ] Step 1: Read the issue and relevant specs
12
+ - [ ] Step 2: Produce a validation plan
13
+ - [ ] Step 3: Execute all test cases
14
+ - [ ] Step 4: Produce the validation report
15
+ - [ ] Step 5: File follow-up issues
16
+ ```
17
+
18
+ ## Step 1: Read Inputs
19
+
20
+ - Parse the issue body: validation scope, test matrix, environments, preconditions, pass/fail criteria, evidence requirements.
21
+ - Read project user flows documentation for expected behavior.
22
+ - Read project quality documentation for DoD, testing pyramid, performance budgets.
23
+ - Read project permissions/privacy and security threat model for security test cases.
24
+ - Confirm the correct version is deployed to the test environment.
25
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
26
+
27
+ ## Step 2: Validation Plan
28
+
29
+ Before executing, output:
30
+
31
+ - **Scope:** feature/release being validated
32
+ - **Environment:** where tests will run
33
+ - **Version:** build/commit being tested
34
+ - **Preconditions verified:** checklist
35
+ - **Test execution order:** sequence with dependencies
36
+ - **Estimated duration:** time estimate
37
+
38
+ ## Step 3: Execute Tests
39
+
40
+ ### 3a. Automated Test Execution
41
+
42
+ Run the project's automated test suites (unit, integration, E2E) and record results.
43
+
44
+ ### 3b. Browser-Based Validation
45
+
46
+ For each user-facing test case in the matrix:
47
+
48
+ 1. Ensure the dev server is running. If not, start it in the background.
49
+ 2. Navigate to the page or surface under test using browser automation MCP.
50
+ 3. Execute the test steps exactly as described — click, type, navigate, trigger state changes.
51
+ 4. Observe the actual result and compare to the expected result.
52
+ 5. Capture a screenshot as evidence for each test case result.
53
+ 6. Check the browser console for errors or warnings after each test case.
54
+ 7. Mark as **PASS**, **FAIL**, or **BLOCKED** (with reason and screenshot).
55
+
56
+ For non-UI test cases (API, data integrity, background jobs), use appropriate non-browser verification methods.
57
+
58
+ Do NOT fix bugs during validation. Document and file issues.
59
+
60
+ ## Step 4: Validation Report
61
+
62
+ Produce a structured report with:
63
+
64
+ - **Summary:** total/passed/failed/blocked counts, overall result
65
+ - **Results table:** test case, priority, result, evidence, notes
66
+ - **Regression results:** checks for unaffected flows
67
+ - **Security validation:** invariant checks
68
+ - **Performance validation:** metric vs budget vs actual
69
+ - **Issues found:** severity, description, issue link
70
+ - **Recommendation:** SHIP or HOLD with reasons
71
+
72
+ ## Step 5: Follow-Up
73
+
74
+ - File new issues for bugs discovered during validation.
75
+ - If validation fails, state what must be fixed before re-validation.
76
+ - Post report as comment on the issue or linked PR.
77
+
78
+ ## Definition of Done
79
+
80
+ - [ ] All test cases in the matrix executed
81
+ - [ ] Evidence collected for every result
82
+ - [ ] Regression checks completed
83
+ - [ ] Security and performance validation completed
84
+ - [ ] Validation report produced
85
+ - [ ] Issues filed for all failures
86
+ - [ ] Ship/hold recommendation provided
@@ -0,0 +1,67 @@
1
+ ---
2
+ id: hatch3r-recipe
3
+ description: Create, test, and manage workflow recipes that compose hatch3r capabilities into guided sequences. Use when creating new recipes, customizing existing ones, or troubleshooting recipe execution.
4
+ ---
5
+ # Recipe Management
6
+
7
+ ## Quick Start
8
+
9
+ ```
10
+ Task Progress:
11
+ - [ ] Step 1: Identify the workflow to capture as a recipe
12
+ - [ ] Step 2: Design the step sequence and dependency graph
13
+ - [ ] Step 3: Write the recipe YAML
14
+ - [ ] Step 4: Test with dry-run mode
15
+ - [ ] Step 5: Validate with a real execution
16
+ ```
17
+
18
+ ## Step 1: Identify Workflow
19
+
20
+ Determine the repeatable workflow pattern:
21
+ - What commands/skills/agents are involved?
22
+ - What order do they execute in?
23
+ - Which steps can run in parallel?
24
+ - Where should the user be asked to confirm (checkpoints)?
25
+
26
+ ## Step 2: Design Step Sequence
27
+
28
+ Map out the dependency graph:
29
+ - List all steps with their hatch3r command or skill reference
30
+ - Identify dependencies between steps
31
+ - Identify steps that can run in parallel
32
+ - Mark checkpoint steps where user confirmation adds value
33
+
34
+ ## Step 3: Write Recipe YAML
35
+
36
+ Create the recipe file in `.hatch3r/recipes/` following the schema defined in the `hatch3r-recipe` command. Include:
37
+ - Clear name and description
38
+ - Required variables with descriptions
39
+ - Steps with proper `depends_on` and `parallel_with` relationships
40
+ - Checkpoint markers at decision points
41
+ - Completion message with next steps
42
+
43
+ ## Step 4: Test with Dry-Run
44
+
45
+ Execute `--dry-run` to validate:
46
+ - YAML schema is valid
47
+ - All referenced commands/skills exist
48
+ - Dependency graph has no cycles
49
+ - Variables are properly referenced
50
+ - Prerequisites are checkable
51
+
52
+ ## Step 5: Validate with Real Execution
53
+
54
+ Run the recipe on a test project to verify:
55
+ - Steps execute in correct order
56
+ - Parallel steps don't conflict
57
+ - Checkpoints pause appropriately
58
+ - Error handling works (intentionally fail a step)
59
+ - Completion message is accurate
60
+
61
+ ## Definition of Done
62
+
63
+ - [ ] Recipe YAML validates against schema
64
+ - [ ] Dry-run completes without errors
65
+ - [ ] Real execution produces expected results
66
+ - [ ] Error handling tested
67
+ - [ ] Recipe committed to project or shared globally
@@ -0,0 +1,86 @@
1
+ ---
2
+ id: hatch3r-refactor
3
+ description: Internal code quality improvement workflow without changing external behavior. Use when refactoring code structure, simplifying modules, or improving maintainability.
4
+ ---
5
+ > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool as appropriate.
6
+
7
+ # Code Refactor Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Read the issue, specs, and existing tests
14
+ - [ ] Step 2: Produce a refactor plan
15
+ - [ ] Step 3: Implement with behavioral preservation
16
+ - [ ] Step 4: Verify all tests pass, add regression tests
17
+ - [ ] Step 5: Open PR
18
+ ```
19
+
20
+ ## Step 1: Read Inputs
21
+
22
+ - Parse the issue body: motivation, proposed change, affected files, safety plan, risk analysis, acceptance criteria.
23
+ - Read project quality standards documentation.
24
+ - Read specs for the area being refactored.
25
+ - Review all existing tests — every one must still pass after refactoring.
26
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
27
+
28
+ ## Step 2: Refactor Plan
29
+
30
+ Before changing code, output:
31
+
32
+ - **Goal:** what improves (readability, performance, maintainability)
33
+ - **Strategy:** how the refactor works
34
+ - **Files to modify:** list with what changes
35
+ - **Behavioral invariant:** what must NOT change
36
+ - **Risk assessment:** what could go wrong, how to detect
37
+ - **Rollback:** how to revert if needed
38
+
39
+ ## Step 3: Implement
40
+
41
+ - Refactor with minimum changes needed.
42
+ - Preserve all public interfaces and external behavior.
43
+ - Remove dead code created by the refactor.
44
+ - Do not introduce new dependencies.
45
+ - If a bug is found, document it — fix in a separate PR.
46
+
47
+ ## Step 4: Verify
48
+
49
+ - All existing tests must pass without modification.
50
+ - Add regression tests for previously untested at-risk behavior.
51
+ - Performance verification if refactored code is on a hot path.
52
+
53
+ ```bash
54
+ npm run lint && npm run typecheck && npm run test
55
+ ```
56
+
57
+ ## Step 5: Open PR
58
+
59
+ Use the project's PR template. Include:
60
+
61
+ - Motivation (why this refactor now)
62
+ - Before/after structure (high-level description)
63
+ - Proof of behavioral preservation (test results)
64
+ - Performance impact (if applicable)
65
+
66
+ ## Required Agent Delegation
67
+
68
+ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`) at the appropriate points:
69
+
70
+ - **`hatch3r-researcher`** — MUST spawn before implementation with modes `current-state`, `refactoring-strategy`, `migration-path`. Skip only for trivially simple refactors (`risk:low` AND `priority:p3`).
71
+ - **`hatch3r-reviewer`** — MUST spawn after implementation for code review, verifying behavioral preservation.
72
+
73
+ ## Related Skills
74
+
75
+ - **Skill**: `hatch3r-logical-refactor` — use when the refactor changes internal logic flow while preserving external behavior
76
+ - **Skill**: `hatch3r-visual-refactor` — use when the refactor targets UI/styling changes without altering functionality
77
+
78
+ ## Definition of Done
79
+
80
+ - [ ] All existing tests pass without modification
81
+ - [ ] Regression tests added for at-risk behavior
82
+ - [ ] No new linter warnings
83
+ - [ ] Performance budgets maintained
84
+ - [ ] Dead code removed
85
+ - [ ] No external behavior changed
86
+ - [ ] No new dependencies introduced
@@ -0,0 +1,93 @@
1
+ ---
2
+ id: hatch3r-release
3
+ description: Cut a release with version bump, changelog, tagging, and deploy verification. Use when preparing a release, cutting a version, or deploying to production.
4
+ ---
5
+ > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool as appropriate.
6
+
7
+ # Release Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Determine version bump (major/minor/patch) based on changes
14
+ - [ ] Step 2: Generate changelog from merged PRs and commit history
15
+ - [ ] Step 3: Update version in package.json and any other version references
16
+ - [ ] Step 4: Verify quality gates (lint, typecheck, all tests)
17
+ - [ ] Step 5: Create git tag and GitHub release with changelog
18
+ - [ ] Step 6: Deploy and verify (staging first if applicable, then production)
19
+ - [ ] Step 7: Monitor post-deploy for errors/regressions
20
+ ```
21
+
22
+ ## Step 1: Determine Version Bump
23
+
24
+ - Review changes since last release: merged PRs, commit history.
25
+ - Use **GitHub MCP** (`search_issues`, PR search) to list merged PRs since last tag.
26
+ - Apply [Semantic Versioning](https://semver.org/):
27
+ - **Major:** Breaking changes (API, data model, config)
28
+ - **Minor:** New features, backward-compatible
29
+ - **Patch:** Bug fixes, security patches, non-breaking improvements
30
+ - Check project release gates: no P0/P1 bugs open, E2E pass, performance budgets met.
31
+
32
+ ## Step 2: Generate Changelog
33
+
34
+ - List merged PRs since last release (e.g., `git log v1.2.0..HEAD --oneline` or GitHub Releases API).
35
+ - Group by category: Features, Bug Fixes, Security, Dependencies, Chore.
36
+ - Format each entry: `- description (#PR-number)` or `- description (commit hash)`.
37
+ - Include breaking changes section if major bump.
38
+ - Follow project changelog format (e.g., `CHANGELOG.md` or GitHub Release notes).
39
+
40
+ ## Step 3: Update Version
41
+
42
+ - Update `version` in `package.json`.
43
+ - Update any other version references: `package-lock.json` (via `npm version`), docs, config files.
44
+ - Run `npm install` to refresh lockfile if needed.
45
+ - Commit with message: `chore(release): vX.Y.Z` or similar.
46
+
47
+ ## Step 4: Verify Quality Gates
48
+
49
+ ```bash
50
+ npm run lint && npm run typecheck && npm run test
51
+ npm run build
52
+ ```
53
+
54
+ - All tests pass (unit, integration, E2E).
55
+ - Bundle size within budget (if defined).
56
+ - Security rules tests pass if rules changed.
57
+ - No TODO without linked issue.
58
+ - See project quality documentation for full pre-release gates.
59
+
60
+ ## Step 5: Create Tag and GitHub Release
61
+
62
+ - Create annotated tag: `git tag -a vX.Y.Z -m "Release vX.Y.Z"`.
63
+ - Push tag: `git push origin vX.Y.Z`.
64
+ - Create GitHub Release with:
65
+ - Title: `vX.Y.Z`
66
+ - Changelog as release notes
67
+ - Attach build artifacts if applicable
68
+ - Use **GitHub MCP** if available for release creation; otherwise use `gh release create` or GitHub UI.
69
+
70
+ ## Step 6: Deploy and Verify
71
+
72
+ - Deploy to staging first (if applicable). Run smoke tests.
73
+ - Deploy to production (project-specific pipeline).
74
+ - Verify: health check, key flows.
75
+ - Document deploy method and environment in project docs if not already.
76
+
77
+ ## Step 7: Monitor Post-Deploy
78
+
79
+ - Monitor error rate (target per project SLO).
80
+ - Monitor function/API error rate.
81
+ - Check for startup time regression.
82
+ - Watch user-reported issues for first 24h.
83
+ - If errors spike: rollback and investigate.
84
+
85
+ ## Definition of Done
86
+
87
+ - [ ] Version bumped in package.json
88
+ - [ ] Changelog generated and included in release
89
+ - [ ] Git tag created and pushed
90
+ - [ ] GitHub release published with changelog
91
+ - [ ] Deployed to production and verified
92
+ - [ ] Post-deploy monitoring completed (no critical regressions)
93
+ - [ ] All release gates satisfied
@@ -0,0 +1,70 @@
1
+ ---
2
+ id: hatch3r-rule-customize
3
+ description: Create and manage per-rule customization files for scope overrides, description changes, enable/disable control, and project-specific markdown instructions. Use when tailoring rules to project-specific needs.
4
+ ---
5
+ # Rule Customization Management
6
+
7
+ ## Quick Start
8
+
9
+ ```
10
+ Task Progress:
11
+ - [ ] Step 1: Identify which rule to customize
12
+ - [ ] Step 2: Determine customization needs
13
+ - [ ] Step 3: Create the customization files
14
+ - [ ] Step 4: Sync to propagate changes
15
+ - [ ] Step 5: Verify the customized output
16
+ ```
17
+
18
+ ## Step 1: Identify Rule
19
+
20
+ Determine which hatch3r rule needs customization:
21
+ - Review the rules in `.agents/rules/` and their default scope/content
22
+ - Identify gaps between default rules and project needs
23
+ - Check for existing customization files in `.hatch3r/rules/`
24
+
25
+ ## Step 2: Determine Customization Needs
26
+
27
+ Decide which customization approach to use:
28
+
29
+ **YAML (`.customize.yaml`)** — for structured overrides:
30
+ - **Scope**: Override when the rule applies (`always`, glob patterns like `src/**/*.ts`)
31
+ - **Description**: Change how the rule is described in adapter outputs
32
+ - **Enabled**: Set to `false` to disable the rule entirely
33
+
34
+ **Markdown (`.customize.md`)** — for free-form instructions:
35
+ - Project-specific rule additions or constraints
36
+ - Domain-specific standards and requirements
37
+ - Framework-specific conventions
38
+
39
+ ## Step 3: Create Customization Files
40
+
41
+ Create files in `.hatch3r/rules/`:
42
+
43
+ **For YAML overrides:**
44
+ ```yaml
45
+ # .hatch3r/rules/{rule-id}.customize.yaml
46
+ scope: "src/**/*.ts,src/**/*.tsx"
47
+ description: "Testing rules with healthcare compliance requirements"
48
+ ```
49
+
50
+ **For markdown instructions:**
51
+ Create `.hatch3r/rules/{rule-id}.customize.md` with project-specific additions. This content is injected into the managed block under `## Project Customizations`.
52
+
53
+ ## Step 4: Sync
54
+
55
+ Run `npx hatch3r sync` to propagate customizations to all adapter outputs.
56
+
57
+ ## Step 5: Verify
58
+
59
+ Confirm customizations appear in adapter output files:
60
+ - Check scope is applied correctly in adapter-specific frontmatter (globs, alwaysApply, etc.)
61
+ - Check description in adapter outputs
62
+ - Check markdown instructions appear inside the managed block
63
+ - Verify disabled rules are absent from adapter outputs
64
+
65
+ ## Definition of Done
66
+
67
+ - [ ] Customization files created in `.hatch3r/rules/`
68
+ - [ ] `npx hatch3r sync` completes without errors
69
+ - [ ] Adapter output files reflect the customizations (scope, description, content)
70
+ - [ ] Customization files committed to the repository
@@ -0,0 +1,67 @@
1
+ ---
2
+ id: hatch3r-skill-customize
3
+ description: Create and manage per-skill customization files for description overrides, enable/disable control, and project-specific markdown instructions. Use when tailoring skill workflows to project-specific needs.
4
+ ---
5
+ # Skill Customization Management
6
+
7
+ ## Quick Start
8
+
9
+ ```
10
+ Task Progress:
11
+ - [ ] Step 1: Identify which skill to customize
12
+ - [ ] Step 2: Determine customization needs
13
+ - [ ] Step 3: Create the customization files
14
+ - [ ] Step 4: Sync to propagate changes
15
+ - [ ] Step 5: Verify the customized output
16
+ ```
17
+
18
+ ## Step 1: Identify Skill
19
+
20
+ Determine which hatch3r skill needs customization:
21
+ - Review the skills in `.agents/skills/` and their default workflows
22
+ - Identify gaps between default workflows and project needs
23
+ - Check for existing customization files in `.hatch3r/skills/`
24
+
25
+ ## Step 2: Determine Customization Needs
26
+
27
+ Decide which customization approach to use:
28
+
29
+ **YAML (`.customize.yaml`)** — for structured overrides:
30
+ - **Description**: Change how the skill is described in adapter frontmatter
31
+ - **Enabled**: Set to `false` to disable the skill entirely
32
+
33
+ **Markdown (`.customize.md`)** — for free-form instructions:
34
+ - Project-specific workflow additions
35
+ - Additional prerequisites or validation steps
36
+ - Custom tooling or process requirements
37
+
38
+ ## Step 3: Create Customization Files
39
+
40
+ Create files in `.hatch3r/skills/`:
41
+
42
+ **For YAML overrides:**
43
+ ```yaml
44
+ # .hatch3r/skills/{skill-id}.customize.yaml
45
+ description: "Issue workflow with mandatory security review"
46
+ ```
47
+
48
+ **For markdown instructions:**
49
+ Create `.hatch3r/skills/{skill-id}.customize.md` with project-specific additions. This content is injected into the managed block under `## Project Customizations`.
50
+
51
+ ## Step 4: Sync
52
+
53
+ Run `npx hatch3r sync` to propagate customizations to all adapter outputs.
54
+
55
+ ## Step 5: Verify
56
+
57
+ Confirm customizations appear in adapter output files:
58
+ - Check description in frontmatter (where applicable)
59
+ - Check markdown instructions appear inside the managed block
60
+ - Verify disabled skills are absent from adapter outputs
61
+
62
+ ## Definition of Done
63
+
64
+ - [ ] Customization files created in `.hatch3r/skills/`
65
+ - [ ] `npx hatch3r sync` completes without errors
66
+ - [ ] Adapter output files reflect the customizations
67
+ - [ ] Customization files committed to the repository