hatch3r 1.3.0 → 1.5.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 (175) hide show
  1. package/README.md +12 -7
  2. package/agents/hatch3r-a11y-auditor.md +18 -11
  3. package/agents/hatch3r-architect.md +27 -12
  4. package/agents/hatch3r-ci-watcher.md +30 -9
  5. package/agents/hatch3r-context-rules.md +18 -8
  6. package/agents/hatch3r-dependency-auditor.md +30 -15
  7. package/agents/hatch3r-devops.md +18 -13
  8. package/agents/hatch3r-docs-writer.md +33 -12
  9. package/agents/hatch3r-fixer.md +46 -9
  10. package/agents/hatch3r-implementer.md +21 -9
  11. package/agents/hatch3r-learnings-loader.md +24 -7
  12. package/agents/hatch3r-lint-fixer.md +18 -9
  13. package/agents/hatch3r-perf-profiler.md +26 -10
  14. package/agents/hatch3r-researcher.md +57 -919
  15. package/agents/hatch3r-reviewer.md +29 -10
  16. package/agents/hatch3r-security-auditor.md +25 -10
  17. package/agents/hatch3r-test-writer.md +29 -9
  18. package/agents/modes/architecture.md +1 -0
  19. package/agents/modes/boundary-analysis.md +2 -1
  20. package/agents/modes/codebase-impact.md +1 -0
  21. package/agents/modes/complexity-risk.md +1 -0
  22. package/agents/modes/coverage-analysis.md +1 -0
  23. package/agents/modes/current-state.md +1 -0
  24. package/agents/modes/feature-design.md +1 -0
  25. package/agents/modes/impact-analysis.md +1 -0
  26. package/agents/modes/library-docs.md +2 -1
  27. package/agents/modes/migration-path.md +1 -0
  28. package/agents/modes/prior-art.md +1 -0
  29. package/agents/modes/refactoring-strategy.md +1 -0
  30. package/agents/modes/regression.md +1 -0
  31. package/agents/modes/requirements-elicitation.md +1 -0
  32. package/agents/modes/risk-assessment.md +1 -0
  33. package/agents/modes/risk-prioritization.md +1 -0
  34. package/agents/modes/root-cause.md +1 -0
  35. package/agents/modes/similar-implementation.md +2 -1
  36. package/agents/modes/symptom-trace.md +1 -0
  37. package/agents/modes/test-pattern.md +2 -1
  38. package/agents/shared/external-knowledge.md +31 -0
  39. package/agents/shared/quality-charter.md +96 -0
  40. package/checks/README.md +1 -0
  41. package/checks/accessibility.md +55 -0
  42. package/commands/board/pickup-azure-devops.md +5 -0
  43. package/commands/board/pickup-delegation-multi.md +9 -1
  44. package/commands/board/pickup-delegation.md +4 -0
  45. package/commands/board/pickup-github.md +5 -0
  46. package/commands/board/pickup-gitlab.md +5 -0
  47. package/commands/board/pickup-modes.md +1 -0
  48. package/commands/board/pickup-post-impl.md +9 -1
  49. package/commands/board/shared-azure-devops.md +14 -3
  50. package/commands/board/shared-board-overview.md +1 -0
  51. package/commands/board/shared-github.md +2 -0
  52. package/commands/board/shared-gitlab.md +10 -2
  53. package/commands/hatch3r-agent-customize.md +6 -1
  54. package/commands/hatch3r-api-spec.md +1 -0
  55. package/commands/hatch3r-benchmark.md +4 -3
  56. package/commands/hatch3r-board-fill.md +52 -9
  57. package/commands/hatch3r-board-groom.md +124 -7
  58. package/commands/hatch3r-board-init.md +7 -3
  59. package/commands/hatch3r-board-pickup.md +1 -0
  60. package/commands/hatch3r-board-refresh.md +1 -0
  61. package/commands/hatch3r-board-shared.md +71 -5
  62. package/commands/hatch3r-bug-plan.md +2 -1
  63. package/commands/hatch3r-codebase-map.md +4 -3
  64. package/commands/hatch3r-command-customize.md +6 -1
  65. package/commands/hatch3r-context-health.md +1 -0
  66. package/commands/hatch3r-cost-tracking.md +1 -0
  67. package/commands/hatch3r-debug.md +4 -3
  68. package/commands/hatch3r-dep-audit.md +3 -0
  69. package/commands/hatch3r-feature-plan.md +3 -2
  70. package/commands/hatch3r-healthcheck.md +1 -0
  71. package/commands/hatch3r-hooks.md +6 -1
  72. package/commands/hatch3r-learn.md +1 -0
  73. package/commands/hatch3r-migration-plan.md +3 -2
  74. package/commands/hatch3r-onboard.md +2 -1
  75. package/commands/hatch3r-project-spec.md +4 -3
  76. package/commands/hatch3r-quick-change.md +31 -3
  77. package/commands/hatch3r-recipe.md +1 -0
  78. package/commands/hatch3r-refactor-plan.md +2 -1
  79. package/commands/hatch3r-release.md +4 -1
  80. package/commands/hatch3r-revision.md +138 -17
  81. package/commands/hatch3r-roadmap.md +5 -4
  82. package/commands/hatch3r-rule-customize.md +5 -0
  83. package/commands/hatch3r-security-audit.md +1 -0
  84. package/commands/hatch3r-skill-customize.md +5 -0
  85. package/commands/hatch3r-test-plan.md +3 -2
  86. package/commands/hatch3r-workflow.md +15 -1
  87. package/dist/cli/index.js +7595 -4548
  88. package/dist/cli/index.js.map +1 -1
  89. package/hooks/hatch3r-ci-failure.md +1 -0
  90. package/hooks/hatch3r-file-save.md +1 -0
  91. package/hooks/hatch3r-post-merge.md +1 -0
  92. package/hooks/hatch3r-pre-commit.md +1 -0
  93. package/hooks/hatch3r-pre-push.md +1 -0
  94. package/hooks/hatch3r-session-start.md +1 -0
  95. package/package.json +30 -12
  96. package/rules/hatch3r-accessibility-standards.md +2 -1
  97. package/rules/hatch3r-accessibility-standards.mdc +1 -1
  98. package/rules/hatch3r-agent-orchestration-detail.md +207 -0
  99. package/rules/hatch3r-agent-orchestration-detail.mdc +202 -0
  100. package/rules/hatch3r-agent-orchestration.md +161 -318
  101. package/rules/hatch3r-agent-orchestration.mdc +212 -154
  102. package/rules/hatch3r-api-design.md +2 -1
  103. package/rules/hatch3r-api-design.mdc +1 -1
  104. package/rules/hatch3r-browser-verification.md +4 -2
  105. package/rules/hatch3r-browser-verification.mdc +1 -0
  106. package/rules/hatch3r-ci-cd.md +2 -1
  107. package/rules/hatch3r-ci-cd.mdc +1 -1
  108. package/rules/hatch3r-code-standards.md +15 -2
  109. package/rules/hatch3r-code-standards.mdc +22 -2
  110. package/rules/hatch3r-component-conventions.md +2 -1
  111. package/rules/hatch3r-component-conventions.mdc +1 -1
  112. package/rules/hatch3r-data-classification.md +2 -1
  113. package/rules/hatch3r-data-classification.mdc +1 -1
  114. package/rules/hatch3r-deep-context.md +26 -1
  115. package/rules/hatch3r-deep-context.mdc +54 -8
  116. package/rules/hatch3r-dependency-management.md +2 -1
  117. package/rules/hatch3r-dependency-management.mdc +17 -5
  118. package/rules/hatch3r-feature-flags.md +2 -0
  119. package/rules/hatch3r-feature-flags.mdc +1 -0
  120. package/rules/hatch3r-git-conventions.md +2 -1
  121. package/rules/hatch3r-git-conventions.mdc +2 -1
  122. package/rules/hatch3r-i18n.md +2 -1
  123. package/rules/hatch3r-i18n.mdc +1 -1
  124. package/rules/hatch3r-learning-consult.md +11 -1
  125. package/rules/hatch3r-learning-consult.mdc +11 -1
  126. package/rules/hatch3r-migrations.md +2 -1
  127. package/rules/hatch3r-migrations.mdc +12 -1
  128. package/rules/hatch3r-observability-logging.md +34 -0
  129. package/rules/hatch3r-observability-logging.mdc +30 -0
  130. package/rules/hatch3r-observability-metrics.md +74 -0
  131. package/rules/hatch3r-observability-metrics.mdc +70 -0
  132. package/rules/hatch3r-observability-tracing-detail.md +160 -0
  133. package/rules/hatch3r-observability-tracing-detail.mdc +63 -0
  134. package/rules/hatch3r-observability-tracing.md +86 -0
  135. package/rules/hatch3r-observability-tracing.mdc +77 -0
  136. package/rules/hatch3r-observability.md +9 -448
  137. package/rules/hatch3r-observability.mdc +7 -159
  138. package/rules/hatch3r-performance-budgets.md +2 -0
  139. package/rules/hatch3r-performance-budgets.mdc +1 -0
  140. package/rules/hatch3r-secrets-management.md +2 -1
  141. package/rules/hatch3r-secrets-management.mdc +1 -1
  142. package/rules/hatch3r-security-patterns.md +3 -2
  143. package/rules/hatch3r-security-patterns.mdc +12 -1
  144. package/rules/hatch3r-testing.md +12 -2
  145. package/rules/hatch3r-testing.mdc +11 -2
  146. package/rules/hatch3r-theming.md +3 -2
  147. package/rules/hatch3r-theming.mdc +1 -1
  148. package/rules/hatch3r-tooling-hierarchy.md +3 -2
  149. package/rules/hatch3r-tooling-hierarchy.mdc +19 -5
  150. package/skills/hatch3r-a11y-audit/SKILL.md +11 -4
  151. package/skills/hatch3r-agent-customize/SKILL.md +5 -72
  152. package/skills/hatch3r-api-spec/SKILL.md +9 -2
  153. package/skills/hatch3r-architecture-review/SKILL.md +7 -0
  154. package/skills/hatch3r-bug-fix/SKILL.md +16 -7
  155. package/skills/hatch3r-ci-pipeline/SKILL.md +8 -1
  156. package/skills/hatch3r-command-customize/SKILL.md +5 -62
  157. package/skills/hatch3r-context-health/SKILL.md +23 -2
  158. package/skills/hatch3r-cost-tracking/SKILL.md +16 -6
  159. package/skills/hatch3r-customize/SKILL.md +124 -0
  160. package/skills/hatch3r-dep-audit/SKILL.md +9 -2
  161. package/skills/hatch3r-feature/SKILL.md +12 -4
  162. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +7 -0
  163. package/skills/hatch3r-incident-response/SKILL.md +7 -0
  164. package/skills/hatch3r-issue-workflow/SKILL.md +8 -1
  165. package/skills/hatch3r-logical-refactor/SKILL.md +8 -1
  166. package/skills/hatch3r-migration/SKILL.md +7 -0
  167. package/skills/hatch3r-perf-audit/SKILL.md +9 -2
  168. package/skills/hatch3r-pr-creation/SKILL.md +8 -1
  169. package/skills/hatch3r-qa-validation/SKILL.md +8 -1
  170. package/skills/hatch3r-recipe/SKILL.md +8 -1
  171. package/skills/hatch3r-refactor/SKILL.md +10 -2
  172. package/skills/hatch3r-release/SKILL.md +8 -1
  173. package/skills/hatch3r-rule-customize/SKILL.md +5 -65
  174. package/skills/hatch3r-skill-customize/SKILL.md +5 -62
  175. package/skills/hatch3r-visual-refactor/SKILL.md +12 -5
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Performance budgets and targets for the project
3
+ globs: ["**/*perf*", "**/*benchmark*", "**/*budget*", "**/lighthouse*", "**/*.perf.*"]
3
4
  alwaysApply: false
4
5
  ---
5
6
  # Performance Budgets
@@ -2,8 +2,9 @@
2
2
  id: hatch3r-secrets-management
3
3
  type: rule
4
4
  description: Secret management, rotation, and secure handling patterns for the project
5
- scope: always
5
+ scope: "**/.env*,**/*secret*,**/*credential*,**/*token*,**/config/**,**/.gitignore,**/vault/**,**/*auth*.config*"
6
6
  tags: [security]
7
+ quality_charter: agents/shared/quality-charter.md
7
8
  ---
8
9
  # Secrets Management
9
10
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Secret management, rotation, and secure handling patterns for the project
3
- alwaysApply: true
3
+ globs: ["**/.env*", "**/*secret*", "**/*credential*", "**/*token*", "**/config/**", "**/.gitignore", "**/vault/**", "**/*auth*.config*"]
4
4
  ---
5
5
  # Secrets Management
6
6
 
@@ -2,8 +2,9 @@
2
2
  id: hatch3r-security-patterns
3
3
  type: rule
4
4
  description: Security patterns including input validation, auth enforcement, and AI/agentic security for the project
5
- scope: always
5
+ scope: "**/auth/**,**/security/**,**/middleware/**,**/*auth*,**/*guard*,**/*policy*,**/*permission*,**/*sanitiz*,**/*validat*"
6
6
  tags: [security]
7
+ quality_charter: agents/shared/quality-charter.md
7
8
  ---
8
9
  # Security Patterns
9
10
 
@@ -202,7 +203,7 @@ tags: [security]
202
203
  ### A08 — Software and Data Integrity Failures
203
204
 
204
205
  - Verify integrity of all software updates, dependencies, and CI/CD pipeline artifacts using digital signatures or checksums.
205
- - Use lockfiles and verify their integrity. `npm ci` (not `npm install`) in CI to ensure deterministic builds.
206
+ - Use lockfiles and verify their integrity. `npm ci` (not `npm install`) in CI for deterministic builds that fail on lockfile drift.
206
207
  - CI/CD pipelines: require code review for all changes, enforce branch protection, sign commits where feasible.
207
208
  - Never deserialize untrusted data without validation. Use schemas (zod, JSON Schema) to validate structure before processing.
208
209
  - Protect CI/CD secrets and permissions: restrict who can modify pipeline configuration, require approval for deployment steps.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Security patterns including input validation, auth enforcement, and AI/agentic security for the project
3
- alwaysApply: true
3
+ globs: ["**/auth/**", "**/security/**", "**/middleware/**", "**/*auth*", "**/*guard*", "**/*policy*", "**/*permission*", "**/*sanitiz*", "**/*validat*"]
4
4
  ---
5
5
  # Security Patterns
6
6
 
@@ -61,6 +61,11 @@ alwaysApply: true
61
61
  - Enforce parameter schemas on every tool call. Reject calls with unexpected, missing, or out-of-range arguments.
62
62
  - Rate-limit tool invocations per agent per time window. Alert on anomalous tool usage patterns.
63
63
  - Sandbox tool execution: restrict file system access, network egress, and subprocess spawning.
64
+ - **MCP server filesystem scope:** MCP servers with filesystem access must be scoped to the minimum necessary directories:
65
+ - Restrict filesystem access to the project directory. MCP servers should never have access to the home directory, system directories, or unrelated project directories.
66
+ - Document which MCP servers have filesystem access and define their intended scope (read-only vs read-write, which directories).
67
+ - Configure `allowedDirectories` in MCP server configs where supported. If the server does not support directory restrictions, document this as a known risk and apply compensating controls (monitoring, read-only mode).
68
+ - Audit MCP server filesystem access on configuration changes. Verify that added servers do not expand the filesystem attack surface beyond the project boundary.
64
69
 
65
70
  ### ASI03 — Identity & Privilege Abuse
66
71
 
@@ -75,6 +80,12 @@ alwaysApply: true
75
80
  - Verify package integrity (checksums, signatures) before loading tools or plugins.
76
81
  - Audit third-party prompt templates for injected instructions before use.
77
82
  - Maintain an allowlist of approved MCP servers and tool sources.
83
+ - **`npx -y` safety:** The `-y` flag auto-confirms installation of unknown packages without prompts, creating a supply chain attack vector:
84
+ - Never use `npx -y` with untrusted, unknown, or typo-squattable package names.
85
+ - Always pin explicit versions when using npx: `npx package@1.2.3` instead of `npx package`.
86
+ - Prefer `npm exec --package=package@version -- command` for critical tooling — it provides explicit version control and avoids silent auto-install.
87
+ - In CI pipelines, install tools as explicit `devDependencies` with pinned versions rather than relying on `npx` at runtime.
88
+ - Verify the package name and publisher on the npm registry before first use. Typosquatting attacks exploit `npx -y` by registering names similar to popular packages.
78
89
 
79
90
  ### ASI05 — Unexpected Code Execution
80
91
 
@@ -2,8 +2,9 @@
2
2
  id: hatch3r-testing
3
3
  type: rule
4
4
  description: Test standards and conventions for the project
5
- scope: always
5
+ scope: "**/*.test.*,**/*.spec.*,**/__tests__/**,**/tests/**,**/test/**,**/*.cy.*,**/playwright/**,**/vitest.config.*,**/jest.config.*,**/cypress.config.*"
6
6
  tags: [core]
7
+ quality_charter: agents/shared/quality-charter.md
7
8
  ---
8
9
  # Testing Standards
9
10
 
@@ -80,11 +81,20 @@ tags: [core]
80
81
  - **Fixture files** (JSON, YAML) are acceptable for large, complex, or externally-sourced test inputs (API response snapshots, configuration samples). Store in `tests/fixtures/`.
81
82
  - **Database state:** Integration tests that require database state must set up and tear down within the test using helpers. Never depend on database state from a previous test.
82
83
 
84
+ ## Error Path Coverage
85
+
86
+ Error handling code is often under-tested because developers focus on happy paths. Enforce minimum error coverage:
87
+
88
+ - **Every exported function that can fail** must have at least one test exercising the error path. "Can fail" includes: functions returning `Result<T, E>`, functions with `throw` statements, async functions calling external services, and functions with input validation.
89
+ - **Error message assertions.** Test that error messages, codes, and structured fields contain the expected values. Do not assert only that "an error was thrown" -- verify the error content.
90
+ - **Error propagation.** When a function wraps or transforms errors from a dependency, test that the original error context is preserved (cause chain, stack trace, original error code).
91
+ - **Boundary error tests.** For each architectural boundary (API handler, event handler, background processor), test that errors are caught, logged, and returned as safe responses without leaking internal details.
92
+
83
93
  ## Snapshot Testing
84
94
 
85
95
  - **Use sparingly.** Snapshots are appropriate for serialized output (JSON API responses, CLI output, rendered HTML structure) where the exact output matters and is stable.
86
96
  - **Not appropriate for:** UI component visual appearance (use visual regression tests), objects with timestamps or random IDs (unstable), large objects (unreadable diffs).
87
- - **Review discipline.** Snapshot updates (`--update-snapshots`) must be reviewed as carefully as code changes. Reviewers must verify the new snapshot is intentionally correct, not just "different."
97
+ - **Review discipline.** Snapshot updates (`--update-snapshots`) must be reviewed with the same rigor as code changes. Reviewers must verify the new snapshot is intentionally correct, not just "different."
88
98
  - **Keep snapshots small.** Snapshot files > 100 lines suggest the test is asserting too broadly. Narrow the assertion to the relevant subset.
89
99
  - **Inline snapshots** (where supported) are preferred over external `.snap` files for short outputs (< 20 lines) because they keep the assertion co-located with the test.
90
100
  - **Name snapshot files** to match their test file: `auth.test.ts` → `auth.test.ts.snap`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Test standards and conventions for the project
3
- alwaysApply: true
3
+ globs: ["**/*.test.*", "**/*.spec.*", "**/__tests__/**", "**/tests/**", "**/test/**", "**/*.cy.*", "**/playwright/**", "**/vitest.config.*", "**/jest.config.*", "**/cypress.config.*"]
4
4
  ---
5
5
  # Testing Standards
6
6
 
@@ -13,7 +13,7 @@ alwaysApply: true
13
13
  - **Named clearly.** Describe behavior: `"should award 15 XP for 25-min focus block"`.
14
14
  - **Regression.** Every bug fix includes a test that fails before the fix and passes after.
15
15
  - **No network.** Unit tests must not make network calls. Use mocks.
16
- - No `any` types in tests. No `.skip` without a linked issue.
16
+ - No type escape hatches in tests. No `.skip` without a linked issue.
17
17
  - Write tests to `tests/unit/`, `tests/integration/`, `tests/e2e/`, or equivalent.
18
18
  - Use test fixtures from `tests/fixtures/` or equivalent.
19
19
  - **Browser verification.** For UI changes, verify visually in the browser via browser automation MCP after automated tests pass. Capture screenshots as evidence.
@@ -77,6 +77,15 @@ alwaysApply: true
77
77
  - **Fixture files** (JSON, YAML) are acceptable for large, complex, or externally-sourced test inputs (API response snapshots, configuration samples). Store in `tests/fixtures/`.
78
78
  - **Database state:** Integration tests that require database state must set up and tear down within the test using helpers. Never depend on database state from a previous test.
79
79
 
80
+ ## Error Path Coverage
81
+
82
+ Error handling code is often under-tested because developers focus on happy paths. Enforce minimum error coverage:
83
+
84
+ - **Every exported function that can fail** must have at least one test exercising the error path. "Can fail" includes: functions returning `Result<T, E>`, functions with `throw` statements, async functions calling external services, and functions with input validation.
85
+ - **Error message assertions.** Test that error messages, codes, and structured fields contain the expected values. Do not assert only that "an error was thrown" -- verify the error content.
86
+ - **Error propagation.** When a function wraps or transforms errors from a dependency, test that the original error context is preserved (cause chain, stack trace, original error code).
87
+ - **Boundary error tests.** For each architectural boundary (API handler, event handler, background processor), test that errors are caught, logged, and returned as safe responses without leaking internal details.
88
+
80
89
  ## Snapshot Testing
81
90
 
82
91
  - **Use sparingly.** Snapshots are appropriate for serialized output (JSON API responses, CLI output, rendered HTML structure) where the exact output matters and is stable.
@@ -5,6 +5,7 @@ description: Theming, dark mode, and color system conventions for the project
5
5
  scope: conditional
6
6
  globs: src/**/*.vue, src/**/*.tsx, src/**/*.jsx, src/**/*.css, src/**/*.scss
7
7
  tags: [implementation]
8
+ quality_charter: agents/shared/quality-charter.md
8
9
  ---
9
10
  # Theming & Dark Mode
10
11
 
@@ -43,11 +44,11 @@ tags: [implementation]
43
44
  - Provide a `high-contrast` token set with ≥ 7:1 contrast ratios for all text and ≥ 3:1 for non-text UI.
44
45
  - Detect user preference with `@media (prefers-contrast: more)` and apply high-contrast tokens.
45
46
  - Support `forced-colors` mode: use system color keywords (`Canvas`, `CanvasText`, `LinkText`, `ButtonFace`, `ButtonText`) and test that information is not conveyed by color alone.
46
- - Ensure focus indicators and borders remain visible under forced-colors by using `Highlight` / `SelectedItem` keywords.
47
+ - Verify focus indicators and borders remain visible under forced-colors by testing in Windows High Contrast Mode — use `Highlight` / `SelectedItem` keywords.
47
48
 
48
49
  ## Testing
49
50
 
50
- - Verify theme toggle switches all tokens correctly — no unstyled or hard-coded colors leak through.
51
+ - Verify theme toggle switches all tokens — no unstyled or hard-coded colors leak through. Inspect computed styles to confirm all color values come from design tokens.
51
52
  - Validate contrast ratios per theme using automated tools (axe-core, Lighthouse) against WCAG AA (4.5:1 text, 3:1 non-text).
52
53
  - Capture screenshots across light, dark, and high-contrast themes at key viewport sizes for visual regression comparison.
53
54
  - Test `prefers-color-scheme` and `prefers-contrast` media query overrides using browser DevTools emulation or Playwright `emulateMedia`.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Theming, dark mode, and color system conventions for the project
3
- globs: src/**/*.vue, src/**/*.tsx, src/**/*.jsx, src/**/*.css, src/**/*.scss
3
+ globs: ["src/**/*.vue", "src/**/*.tsx", "src/**/*.jsx", "src/**/*.css", "src/**/*.scss", "**/*theme*", "**/*color*"]
4
4
  alwaysApply: false
5
5
  ---
6
6
  # Theming & Dark Mode
@@ -2,8 +2,9 @@
2
2
  id: hatch3r-tooling-hierarchy
3
3
  type: rule
4
4
  description: Priority order for tools and knowledge sources
5
- scope: always
5
+ scope: "**/.agents/**,**/mcp/**,**/mcp.json,**/.cursor/**,**/.github/copilot*,**/.windsurf/**,**/hatch.json,**/.claude/**"
6
6
  tags: [core]
7
+ quality_charter: agents/shared/quality-charter.md
7
8
  ---
8
9
  # Tooling Hierarchy
9
10
 
@@ -91,7 +92,7 @@ If no web search MCP server is configured (e.g., `brave-search` is not in `mcp.s
91
92
  Use browser automation MCP tools to visually verify UI changes after automated tests pass.
92
93
 
93
94
  **When to use:**
94
- - Verifying UI component changes render correctly.
95
+ - Verifying UI component changes render as specified in the design or acceptance criteria.
95
96
  - Reproducing and confirming fixes for visually observable bugs.
96
97
  - Accessibility auditing (keyboard nav, contrast, focus indicators).
97
98
  - Frontend performance profiling (CPU, frame rate, memory).
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Priority order for tools and knowledge sources
3
- alwaysApply: true
3
+ globs: ["**/.agents/**", "**/mcp/**", "**/mcp.json", "**/.cursor/**", "**/.github/copilot*", "**/.windsurf/**", "**/hatch.json", "**/.claude/**"]
4
4
  ---
5
5
  # Tooling Hierarchy
6
6
 
@@ -10,25 +10,39 @@ alwaysApply: true
10
10
 
11
11
  Read `platform` from `.agents/hatch.json` to determine which platform tools to use.
12
12
 
13
+ ### Prerequisites
14
+
15
+ | Platform | Auth Setup |
16
+ |----------|-----------|
17
+ | **GitHub** | `gh auth login` or `GITHUB_TOKEN` env var. For Projects v2: `gh auth refresh -s project` |
18
+ | **Azure DevOps** | `az login` and `az devops configure --defaults organization=ORG project=PROJECT` |
19
+ | **GitLab** | `glab auth login` or `GITLAB_TOKEN` env var |
20
+
21
+ ### Platform CLI Fallback Reference
22
+
13
23
  **Fallback to the platform CLI only when:**
14
24
  - The MCP tool catalog lacks the specific capability.
15
25
  - An MCP call fails repeatedly and the CLI provides a viable alternative.
16
26
 
17
27
  **Never** use the platform CLI for operations that have a direct MCP equivalent (issue CRUD, PR/MR CRUD, search, labels).
18
28
 
19
- ### Platform CLI Fallback Reference
20
-
21
29
  | Action | GitHub | Azure DevOps | GitLab |
22
30
  |--------|--------|--------------|--------|
23
31
  | Create issue | `gh issue create` | `az boards work-item create` | `glab issue create` |
32
+ | Edit issue | `gh issue edit` | `az boards work-item update` | `glab issue update` |
24
33
  | View issue | `gh issue view` | `az boards work-item show --id N` | `glab issue view` |
25
34
  | List issues | `gh issue list` | `az boards work-item list` | `glab issue list` |
26
35
  | Create PR/MR | `gh pr create` | `az repos pr create` | `glab mr create` |
27
36
  | View PR/MR | `gh pr view` | `az repos pr show` | `glab mr view` |
28
37
  | List PRs/MRs | `gh pr list` | `az repos pr list` | `glab mr list` |
38
+ | Merge PR/MR | `gh pr merge` | `az repos pr complete` | `glab mr merge` |
39
+ | Search issues | `gh search issues` | `az boards query` | `glab issue list --search` |
40
+ | Search PRs | `gh search prs` | `az repos pr list --status all` | `glab mr list --search` |
29
41
  | Search code | `gh search code` | `az repos show` | `glab search` |
30
- | CI runs | `gh run list/view` | `az pipelines run list/show` | `glab ci list/view` |
42
+ | Labels | `gh label create/list` | `az boards work-item update --fields` | `glab label create/list` |
31
43
  | Releases | `gh release create` | `az repos release` | `glab release create` |
44
+ | CI runs | `gh run list/view/watch` | `az pipelines run list/show` | `glab ci list/view` |
45
+ | Projects | `gh project item-add/edit/list` | `az boards iteration/area` | GitLab Boards API |
32
46
 
33
47
  ## B. Documentation MCP for Library Documentation
34
48
 
@@ -94,7 +108,7 @@ Use browser automation MCP tools to visually verify UI changes after automated t
94
108
  When seeking information, follow this priority order:
95
109
 
96
110
  1. **Project specs and ADRs** — authoritative for project-specific behavior, constraints, and decisions.
97
- 2. **Codebase exploration** (Grep, SemanticSearch) — ground truth for current implementation.
111
+ 2. **Codebase exploration** (code search tools, semantic code search) — ground truth for current implementation.
98
112
  3. **Documentation MCP** — authoritative for external library/framework APIs and patterns.
99
113
  4. **Web research** — current events, best practices, security advisories, novel problems.
100
114
  5. **Browser verification** — visual confirmation of UI changes after automated tests pass.
@@ -2,6 +2,7 @@
2
2
  id: hatch3r-a11y-audit
3
3
  description: Comprehensive WCAG AA accessibility audit with findings and fixes. Use when auditing accessibility, verifying WCAG compliance, or improving a11y across the application.
4
4
  tags: [review, a11y]
5
+ quality_charter: agents/shared/quality-charter.md
5
6
  ---
6
7
  # Accessibility Audit Workflow
7
8
 
@@ -50,7 +51,7 @@ Task Progress:
50
51
 
51
52
  **Keyboard navigation:**
52
53
 
53
- - Tab through all interactive elements. Ensure logical order, no focus traps.
54
+ - Tab through all interactive elements. Verify logical order and confirm no focus traps exist.
54
55
  - All buttons, links, inputs, custom controls focusable.
55
56
  - Visible focus indicator (outline or ring) — no `outline: none` without replacement.
56
57
  - Escape closes modals/dropdowns. Enter/Space activates buttons.
@@ -58,7 +59,7 @@ Task Progress:
58
59
  **Color contrast:**
59
60
 
60
61
  - Check text vs background: ≥ 4.5:1 for normal text, ≥ 3:1 for large text.
61
- - Use DevTools or contrast checker. Test with design tokens — ensure no ad-hoc colors fail.
62
+ - Use DevTools or contrast checker. Test with design tokens — flag any ad-hoc colors that fall below the 4.5:1 ratio.
62
63
 
63
64
  **ARIA attributes:**
64
65
 
@@ -99,7 +100,7 @@ Task Progress:
99
100
  - Implement fixes following project component and quality requirements.
100
101
  - Use semantic HTML where possible (`<button>`, `<a>`, `<nav>`, `<main>`).
101
102
  - Add `aria-*` attributes for custom components.
102
- - Ensure `prefers-reduced-motion` respected in CSS and JS.
103
+ - Verify `prefers-reduced-motion` is respected by enabling the media query in DevTools and confirming animations are disabled or simplified.
103
104
  - Add or fix focus styles. Use design tokens for focus ring.
104
105
  - Verify reduced-motion behavior in tests.
105
106
 
@@ -107,7 +108,7 @@ Task Progress:
107
108
 
108
109
  - Re-run automated scan. No critical or major violations.
109
110
  - Manual keyboard and screen reader check on fixed areas.
110
- - Run full test suite to ensure no regressions.
111
+ - Run full test suite and confirm 0 failures to verify no regressions.
111
112
  - Document remaining minor findings for future backlog.
112
113
 
113
114
  ## Required Agent Delegation
@@ -120,6 +121,12 @@ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`
120
121
 
121
122
  - **Rule**: `hatch3r-browser-verification` — follow this rule for live browser-based accessibility testing
122
123
 
124
+ ## Error Handling
125
+
126
+ - **No automated scanner available**: If axe-core, Lighthouse, or equivalent is not installed, report the gap and proceed with manual checklist-only audit. Do not skip the audit.
127
+ - **Scanner produces false positives**: Cross-reference automated findings against manual inspection. Mark confirmed false positives with justification and exclude from the violation count.
128
+ - **Component renders differently across browsers**: Test in at least two browser engines (Chromium + Firefox or Safari). Document browser-specific a11y gaps with reproduction steps.
129
+
123
130
  ## Definition of Done
124
131
 
125
132
  - [ ] No critical a11y violations
@@ -1,78 +1,11 @@
1
1
  ---
2
2
  id: hatch3r-agent-customize
3
- description: Create and manage per-agent customization files for model overrides, description changes, and project-specific markdown instructions. Use when tailoring agent behavior to project-specific needs.
3
+ description: Agent customization redirects to the unified hatch3r-customize skill.
4
4
  tags: [customize]
5
+ quality_charter: agents/shared/quality-charter.md
5
6
  ---
6
- # Agent Customization Management
7
+ # Agent Customization
7
8
 
8
- ## Quick Start
9
+ > **This skill has been consolidated.** Use the `hatch3r-customize` skill with `type: agent`.
9
10
 
10
- ```
11
- Task Progress:
12
- - [ ] Step 1: Identify which agent to customize
13
- - [ ] Step 2: Determine customization needs
14
- - [ ] Step 3: Create the customization files
15
- - [ ] Step 4: Sync to propagate changes
16
- - [ ] Step 5: Verify the customized output
17
- ```
18
-
19
- ## Step 1: Identify Agent
20
-
21
- Determine which hatch3r agent needs customization:
22
- - Review the agents in `.agents/agents/` and their default behaviors
23
- - Identify gaps between default behavior and project needs
24
- - Check for existing customization files in `.hatch3r/agents/`
25
-
26
- ## Step 2: Determine Customization Needs
27
-
28
- Decide which customization approach to use:
29
-
30
- **YAML (`.customize.yaml`)** — for structured overrides:
31
- - **Model**: Override the agent's preferred model (e.g., `model: opus`)
32
- - **Description**: Change how the agent is described in adapter frontmatter
33
- - **Enabled**: Set to `false` to disable the agent entirely
34
-
35
- **Protected agents:** Some agents have `protected: true` in their canonical frontmatter. For these security-critical agents (e.g., reviewer, security-auditor, test-writer), customization cannot override `scope`, `description`, or `enabled` — only `model` and markdown instructions can be customized. See the `hatch3r-agent-customize` command for full details.
36
-
37
- **Markdown (`.customize.md`)** — for free-form instructions:
38
- - Domain-specific review checklists
39
- - Architecture context and constraints
40
- - Project-specific workflow steps
41
- - Compliance and security requirements
42
-
43
- ## Step 3: Create Customization Files
44
-
45
- Create files in `.hatch3r/agents/`:
46
-
47
- **For YAML overrides:**
48
- ```yaml
49
- # .hatch3r/agents/{agent-id}.customize.yaml
50
- model: opus
51
- description: "Security-focused reviewer for healthcare platform"
52
- ```
53
-
54
- **For markdown instructions:**
55
- Create `.hatch3r/agents/{agent-id}.customize.md` with project-specific instructions. This content is injected into the managed block under `## Project Customizations`.
56
-
57
- Set only the fields/content you need — partial customization is valid.
58
-
59
- ## Step 4: Sync
60
-
61
- Run `npx hatch3r sync` to propagate customizations to all adapter outputs. The sync:
62
- - Reads `.customize.yaml` for structured overrides (model, description, enabled)
63
- - Reads `.customize.md` and appends it inside the managed block
64
- - Generates updated output for every configured adapter (Cursor, Claude, etc.)
65
-
66
- ## Step 5: Verify
67
-
68
- Confirm customizations appear in adapter output files:
69
- - Check model appears in frontmatter (e.g., `.cursor/agents/hatch3r-reviewer.md`)
70
- - Check markdown instructions appear inside the managed block
71
- - Verify disabled agents are absent from adapter outputs
72
-
73
- ## Definition of Done
74
-
75
- - [ ] Customization files created in `.hatch3r/agents/`
76
- - [ ] `npx hatch3r sync` completes without errors
77
- - [ ] Adapter output files reflect the customizations
78
- - [ ] Customization files committed to the repository
11
+ For agent-specific reference (model resolution, protected agents, YAML schema), see the `hatch3r-agent-customize` command.
@@ -3,6 +3,7 @@ id: hatch3r-api-spec
3
3
  type: skill
4
4
  description: Generate and validate OpenAPI specifications from codebase. Covers endpoint design, schema validation, and documentation generation.
5
5
  tags: [planning]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  # API Specification Workflow
@@ -37,7 +38,7 @@ Task Progress:
37
38
 
38
39
  ## Step 3: Validate Schemas
39
40
 
40
- - Ensure all request bodies have JSON Schema validation constraints (`required`, `minLength`, `maxLength`, `pattern`, `enum`).
41
+ - Verify all request bodies have JSON Schema validation constraints (`required`, `minLength`, `maxLength`, `pattern`, `enum`).
41
42
  - Verify response schemas match actual serialized output (check serializers, DTOs, or response builders).
42
43
  - Validate enum values match database constraints or application constants.
43
44
  - Check for nullable fields — mark explicitly with `nullable: true` or type union.
@@ -55,9 +56,15 @@ Task Progress:
55
56
 
56
57
  - Cross-reference the generated spec against integration tests to confirm endpoint behavior.
57
58
  - Verify content types (`application/json`, `multipart/form-data`, etc.) match actual handlers.
58
- - Check that path parameters, query parameters, and headers are correctly documented.
59
+ - Check that path parameters, query parameters, and headers are documented with accurate types, required flags, and example values.
59
60
  - Validate against any existing API consumers (SDKs, frontend clients) for breaking changes.
60
61
 
62
+ ## Error Handling
63
+
64
+ - **Route definitions use dynamic or meta-programmed patterns**: If endpoints are generated at runtime or via decorators that resist static analysis, document the gap and manually enumerate the missing endpoints.
65
+ - **OpenAPI linter fails on generated output**: Fix the specific schema violations reported by the linter. Do not suppress linter rules without documenting the reason.
66
+ - **Breaking changes detected against existing consumers**: Flag each breaking change with the affected consumer, the migration path, and whether a versioned endpoint is needed.
67
+
61
68
  ## Definition of Done
62
69
 
63
70
  - [ ] OpenAPI spec covers all endpoints in the codebase
@@ -2,6 +2,7 @@
2
2
  id: hatch3r-architecture-review
3
3
  description: Evaluate architectural decisions and produce ADRs following the project template. Use when making architectural decisions, evaluating trade-offs, or creating ADRs.
4
4
  tags: [review]
5
+ quality_charter: agents/shared/quality-charter.md
5
6
  ---
6
7
  # Architecture Review Workflow
7
8
 
@@ -89,6 +90,12 @@ Save as `docs/adr/XXXX_short-title.md` (or project convention). Use next availab
89
90
  - Link from related issues/work items or PRs/MRs on the platform.
90
91
  - If superseding an ADR, update the old ADR's Status to `SUPERSEDED by ADR-XXXX`.
91
92
 
93
+ ## Error Handling
94
+
95
+ - **Conflicting ADRs discovered**: If an existing ADR contradicts the proposed decision, reference both ADRs and recommend superseding the older one with explicit justification.
96
+ - **Insufficient context for trade-off evaluation**: If the codebase lacks enough information to evaluate an option, state the knowledge gap and recommend a time-boxed spike before finalizing the decision.
97
+ - **Stakeholder disagreement on recommended option**: Document all positions with their rationale and escalate to the project lead with a clear recommendation and dissent summary.
98
+
92
99
  ## Definition of Done
93
100
 
94
101
  - [ ] ADR written following project template
@@ -2,8 +2,9 @@
2
2
  id: hatch3r-bug-fix
3
3
  description: Step-by-step bug fix workflow. Diagnose root cause, implement minimal fix, write regression test. Use when fixing bugs, working on bug report issues, or when the user mentions a bug.
4
4
  tags: [core, implementation]
5
+ quality_charter: agents/shared/quality-charter.md
5
6
  ---
6
- > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool as appropriate.
7
+ > **Note:** Commands below use `npm` as an example. Substitute with your project's package manager (`yarn`, `pnpm`, `bun`) or build tool when your project uses a different package manager.
7
8
 
8
9
  # Bug Fix Workflow
9
10
 
@@ -33,16 +34,18 @@ Task Progress:
33
34
 
34
35
  Before fixing, output:
35
36
 
36
- - **Root cause hypothesis:** what is wrong and why
37
- - **Files to investigate:** list of files
38
- - **Reproduction strategy:** how to confirm the bug via tests
39
- - **Risks:** what could go wrong with the fix
37
+ - **Root cause hypothesis:** what is wrong and why (distinguish between the symptom the user reported and the underlying cause)
38
+ - **Files to investigate:** list of files with reason each file is relevant
39
+ - **Reproduction strategy:** how to confirm the bug via tests (specific test scenario, expected vs. actual result)
40
+ - **Error handling check:** does the affected code have proper error handling? If the bug is caused by a missing or incorrect error path, note this explicitly
41
+ - **Risks:** what could go wrong with the fix (regression risk, related code paths that could be affected)
42
+ - **Confidence:** high/medium/low for the hypothesis. If low, describe what additional investigation is needed before proceeding
40
43
 
41
44
  ## Step 2b: Browser Reproduction (if UI Bug)
42
45
 
43
46
  Skip this step if the bug has no visual or interactive symptoms.
44
47
 
45
- - Ensure the dev server is running. If not, start it in the background.
48
+ - Confirm the dev server is running by checking the expected port. If not running, start it in the background.
46
49
  - Navigate to the page where the bug manifests.
47
50
  - Follow the reproduction steps from the issue to confirm the bug is observable.
48
51
  - Take a screenshot of the broken state as baseline evidence.
@@ -78,7 +81,7 @@ Skip TDD and use the standard flow (Steps 3→4) when:
78
81
 
79
82
  - Write a test that **fails before** the fix and **passes after**.
80
83
  - Add edge case tests if the bug reveals coverage gaps.
81
- - Ensure all existing tests still pass.
84
+ - Run the full test suite and confirm 0 failures — all existing tests still pass.
82
85
 
83
86
  ## Step 5: Verify
84
87
 
@@ -119,6 +122,12 @@ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`
119
122
 
120
123
  - **Skill**: `hatch3r-qa-validation` — use this skill for end-to-end verification of the bug fix
121
124
 
125
+ ## Error Handling
126
+
127
+ - **Root cause cannot be identified**: If tracing reaches a dead end, document the investigation path taken, the hypotheses eliminated, and recommend additional instrumentation (debug logging, reproduction steps) to narrow down the cause.
128
+ - **Fix introduces test failures elsewhere**: Analyze whether the failing tests relied on the buggy behavior. Update those tests if they were testing incorrect expectations; otherwise, rethink the fix approach.
129
+ - **Bug is in a third-party dependency**: If the root cause is in external code, implement a workaround with a code comment linking to the upstream issue, and file or reference the upstream bug report.
130
+
122
131
  ## Definition of Done
123
132
 
124
133
  - [ ] Root cause identified and documented in PR
@@ -3,6 +3,7 @@ id: hatch3r-ci-pipeline
3
3
  type: skill
4
4
  description: Design and optimize CI/CD pipelines. Covers stage design, test parallelization, artifact management, and pipeline performance.
5
5
  tags: [devops]
6
+ quality_charter: agents/shared/quality-charter.md
6
7
  ---
7
8
 
8
9
  # CI Pipeline Workflow
@@ -53,7 +54,7 @@ Task Progress:
53
54
  ## Step 5: Implement and Validate
54
55
 
55
56
  - Implement pipeline changes incrementally — test each stage change in a feature branch.
56
- - Verify caching works correctly: first run populates cache, second run uses it.
57
+ - Verify caching works: first run populates cache, second run uses it (confirmed by cache hit log output).
57
58
  - Confirm parallel stages don't have hidden dependencies causing race conditions.
58
59
  - Measure pipeline duration improvement against the baseline from Step 1.
59
60
  - Document the pipeline architecture for the team.
@@ -68,6 +69,12 @@ Task Progress:
68
69
  | Full pipeline (push to artifact) | < 15 minutes |
69
70
  | Cache hit ratio | > 80% |
70
71
 
72
+ ## Error Handling
73
+
74
+ - **Pipeline config syntax errors**: Validate workflow YAML locally (e.g., `actionlint` for GitHub Actions) before pushing. Report the exact line and field causing the parse failure.
75
+ - **Flaky tests block pipeline**: Identify the flaky test(s) by re-running the failing job. If confirmed flaky, quarantine the test with a tracking issue reference and unblock the pipeline.
76
+ - **Cache invalidation causes slow builds**: Verify cache key patterns match the lockfile hash. If caches are stale, clear them and document the corrected key strategy.
77
+
71
78
  ## Definition of Done
72
79
 
73
80
  - [ ] Pipeline stages optimized with maximum parallelism
@@ -1,68 +1,11 @@
1
1
  ---
2
2
  id: hatch3r-command-customize
3
- description: Create and manage per-command customization files for description overrides, enable/disable control, and project-specific markdown instructions. Use when tailoring command behavior to project-specific needs.
3
+ description: Command customization redirects to the unified hatch3r-customize skill.
4
4
  tags: [customize]
5
+ quality_charter: agents/shared/quality-charter.md
5
6
  ---
6
- # Command Customization Management
7
+ # Command Customization
7
8
 
8
- ## Quick Start
9
+ > **This skill has been consolidated.** Use the `hatch3r-customize` skill with `type: command`.
9
10
 
10
- ```
11
- Task Progress:
12
- - [ ] Step 1: Identify which command to customize
13
- - [ ] Step 2: Determine customization needs
14
- - [ ] Step 3: Create the customization files
15
- - [ ] Step 4: Sync to propagate changes
16
- - [ ] Step 5: Verify the customized output
17
- ```
18
-
19
- ## Step 1: Identify Command
20
-
21
- Determine which hatch3r command needs customization:
22
- - Review the commands in `.agents/commands/` and their default behavior
23
- - Identify gaps between default behavior and project needs
24
- - Check for existing customization files in `.hatch3r/commands/`
25
-
26
- ## Step 2: Determine Customization Needs
27
-
28
- Decide which customization approach to use:
29
-
30
- **YAML (`.customize.yaml`)** — for structured overrides:
31
- - **Description**: Change how the command is described in adapter outputs
32
- - **Enabled**: Set to `false` to disable the command entirely
33
-
34
- **Markdown (`.customize.md`)** — for free-form instructions:
35
- - Project-specific workflow steps
36
- - Additional prerequisites or constraints
37
- - Custom deployment or release procedures
38
-
39
- ## Step 3: Create Customization Files
40
-
41
- Create files in `.hatch3r/commands/`:
42
-
43
- **For YAML overrides:**
44
- ```yaml
45
- # .hatch3r/commands/{command-id}.customize.yaml
46
- description: "Release workflow with staging validation"
47
- ```
48
-
49
- **For markdown instructions:**
50
- Create `.hatch3r/commands/{command-id}.customize.md` with project-specific additions. This content is injected into the managed block under `## Project Customizations`.
51
-
52
- ## Step 4: Sync
53
-
54
- Run `npx hatch3r sync` to propagate customizations to all adapter outputs.
55
-
56
- ## Step 5: Verify
57
-
58
- Confirm customizations appear in adapter output files:
59
- - Check description in adapter outputs (where applicable)
60
- - Check markdown instructions appear inside the managed block
61
- - Verify disabled commands are absent from adapter outputs
62
-
63
- ## Definition of Done
64
-
65
- - [ ] Customization files created in `.hatch3r/commands/`
66
- - [ ] `npx hatch3r sync` completes without errors
67
- - [ ] Adapter output files reflect the customizations
68
- - [ ] Customization files committed to the repository
11
+ For command-specific reference (YAML schema, examples), see the `hatch3r-command-customize` command.