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,131 @@
1
+ ---
2
+ id: hatch3r-code-review
3
+ type: prompt
4
+ description: Review code changes for quality, security, and correctness
5
+ ---
6
+ # Code Review
7
+
8
+ Review the provided code changes for quality, security, and correctness. Produce a structured review report with actionable feedback.
9
+
10
+ ## Instructions
11
+
12
+ 1. **Correctness** — Does the code do what it is supposed to? Verify against acceptance criteria, spec references, and expected behavior. Check for off-by-one errors, missing null/undefined handling, incorrect operator usage, and logic inversions.
13
+ 2. **Security** — Input validation at boundaries, auth checks on every route, no secrets in code or logs, CSRF protection on mutations, parameterized queries, safe deserialization. Flag any trust boundary violations.
14
+ 3. **Code Quality** — Naming follows conventions, functions < 50 lines, files < 400 lines, cyclomatic complexity ≤ 10, no dead code or unused imports, DRY without over-abstraction.
15
+ 4. **Type Safety** — No `any`, no `@ts-ignore` without a linked issue, discriminated unions preferred over type assertions, `satisfies` over `as` where applicable.
16
+ 5. **Performance** — No N+1 queries, no unnecessary allocations in hot paths, lazy loading for large imports, no unbounded list fetches, bundle size impact assessed.
17
+ 6. **Testing** — New logic has unit tests, bug fixes have regression tests, edge cases covered, mocks are minimal and focused.
18
+ 7. **Accessibility** — If UI changes: keyboard navigation, WCAG AA contrast (4.5:1), ARIA attributes, `prefers-reduced-motion` respected.
19
+ 8. **Error Handling** — Errors caught and handled at the appropriate level, user-facing errors are informative but safe (no stack traces), fail-closed defaults.
20
+
21
+ ## Edge Cases to Watch
22
+
23
+ - Empty collections and null/undefined inputs at boundaries
24
+ - Concurrent modifications and race conditions
25
+ - Unicode and multi-byte string handling
26
+ - Timezone-sensitive date operations
27
+ - Large payload sizes and pagination exhaustion
28
+ - Partial failures in batch operations
29
+
30
+ ## Severity Classification
31
+
32
+ | Severity | Criteria | Action |
33
+ |----------|----------|--------|
34
+ | **Critical** | Security vulnerability, data loss risk, privacy violation, incorrect business logic | Must fix before merge |
35
+ | **Warning** | Performance regression, missing tests, code quality violation, poor error handling | Should fix, PR author decides timing |
36
+ | **Suggestion** | Naming improvement, alternative pattern, readability enhancement | Nice to have, not blocking |
37
+
38
+ ## Output Template
39
+
40
+ ```markdown
41
+ ## Code Review: {file or PR scope}
42
+
43
+ **Verdict:** APPROVE | REQUEST CHANGES | COMMENT
44
+
45
+ ### Critical
46
+
47
+ | # | File:Line | Issue | Suggestion |
48
+ |---|-----------|-------|------------|
49
+ | 1 | `src/auth.ts:42` | Missing token expiry check | Add `if (isExpired(token)) throw new AuthError(...)` |
50
+
51
+ ### Warnings
52
+
53
+ | # | File:Line | Issue | Suggestion |
54
+ |---|-----------|-------|------------|
55
+ | 1 | `src/api/users.ts:78` | No test for empty input case | Add unit test for `getUser(undefined)` |
56
+
57
+ ### Suggestions
58
+
59
+ | # | File:Line | Issue | Suggestion |
60
+ |---|-----------|-------|------------|
61
+ | 1 | `src/utils.ts:15` | `data` is vague | Rename to `userProfile` for clarity |
62
+
63
+ ### Summary
64
+
65
+ - Critical: {n} | Warnings: {n} | Suggestions: {n}
66
+ - Test coverage: {assessed / not assessed}
67
+ - Security: {no issues / issues found}
68
+ ```
69
+
70
+ ## Few-Shot Examples
71
+
72
+ ### Example 1: Security Issue Found
73
+
74
+ **Input:** A diff adding a new API endpoint:
75
+
76
+ ```typescript
77
+ app.post("/api/admin/users", async (req, res) => {
78
+ const user = await db.createUser(req.body);
79
+ res.json(user);
80
+ });
81
+ ```
82
+
83
+ **Output:**
84
+
85
+ ```markdown
86
+ ## Code Review: src/routes/admin.ts
87
+
88
+ **Verdict:** REQUEST CHANGES
89
+
90
+ ### Critical
91
+
92
+ | # | File:Line | Issue | Suggestion |
93
+ |---|-----------|-------|------------|
94
+ | 1 | `src/routes/admin.ts:12` | No auth middleware on admin endpoint | Add `requireAuth("admin")` middleware before handler |
95
+ | 2 | `src/routes/admin.ts:13` | `req.body` used without validation | Add zod schema: `const body = CreateUserSchema.parse(req.body)` |
96
+
97
+ ### Warnings
98
+
99
+ | # | File:Line | Issue | Suggestion |
100
+ |---|-----------|-------|------------|
101
+ | 1 | `src/routes/admin.ts:14` | Full user object returned including password hash | Return `omit(user, ["passwordHash"])` |
102
+
103
+ ### Summary
104
+
105
+ - Critical: 2 | Warnings: 1 | Suggestions: 0
106
+ - Security: AUTH MISSING, INPUT UNVALIDATED
107
+ ```
108
+
109
+ ### Example 2: Clean Code with Minor Suggestions
110
+
111
+ **Input:** A utility function refactor with tests.
112
+
113
+ **Output:**
114
+
115
+ ```markdown
116
+ ## Code Review: src/utils/format.ts
117
+
118
+ **Verdict:** APPROVE
119
+
120
+ ### Suggestions
121
+
122
+ | # | File:Line | Issue | Suggestion |
123
+ |---|-----------|-------|------------|
124
+ | 1 | `src/utils/format.ts:8` | `formatDate` accepts `any` | Use `Date | string | number` union type |
125
+
126
+ ### Summary
127
+
128
+ - Critical: 0 | Warnings: 0 | Suggestions: 1
129
+ - Test coverage: 4 new tests added, edge cases covered
130
+ - Security: no issues
131
+ ```
@@ -0,0 +1,173 @@
1
+ ---
2
+ id: hatch3r-pr-description
3
+ type: prompt
4
+ description: Generate a pull request description from staged changes
5
+ ---
6
+ # PR Description
7
+
8
+ Generate a pull request description for the current changes. Analyze the diff and produce a structured, reviewer-friendly PR description.
9
+
10
+ ## Instructions
11
+
12
+ 1. **Analyze the staged diff and recent commits** on this branch. Identify all files changed, lines added/removed, and the nature of each change.
13
+ 2. **Identify the type of change:**
14
+
15
+ | Type | Prefix | When to Use |
16
+ |------|--------|-------------|
17
+ | Feature | `feat:` | New functionality or capability |
18
+ | Fix | `fix:` | Bug fix or error correction |
19
+ | Refactor | `refactor:` | Code restructuring without behavior change |
20
+ | Docs | `docs:` | Documentation only |
21
+ | Test | `test:` | Adding or updating tests only |
22
+ | Infra | `infra:` | CI/CD, build config, tooling |
23
+ | Perf | `perf:` | Performance improvement |
24
+ | Security | `security:` | Security fix or hardening |
25
+
26
+ 3. **Write a concise title** following Conventional Commits: `{type}: {short description}` (max 72 characters).
27
+ 4. **Write the body** with structured sections (see template below).
28
+ 5. **Assess risk level** — low (docs, tests), medium (new feature, refactor), high (auth, data model, security).
29
+
30
+ ## Edge Cases to Handle
31
+
32
+ - **Multiple change types:** If the PR spans types (e.g., feature + tests + docs), use the primary type and note others in the summary.
33
+ - **Breaking changes:** Always include a `## Breaking Changes` section with migration instructions. Prefix title with `feat!:` or `fix!:`.
34
+ - **Large PRs:** If the diff exceeds 500 lines, suggest splitting. List logical split points.
35
+ - **No linked issue:** Flag this — every PR should reference an issue.
36
+ - **Reverts:** Use `revert:` prefix and link to the original PR being reverted.
37
+
38
+ ## Output Template
39
+
40
+ ```markdown
41
+ ## {type}: {short description}
42
+
43
+ ### Summary
44
+
45
+ - {what changed — 1-3 bullet points explaining the change and why it was needed}
46
+
47
+ ### Changes
48
+
49
+ | File | Change | Description |
50
+ |------|--------|-------------|
51
+ | `{path}` | Added / Modified / Deleted | {what and why} |
52
+
53
+ ### Test Plan
54
+
55
+ - [ ] {how to verify the changes work — specific steps}
56
+ - [ ] {edge case verified}
57
+ - [ ] Lint and typecheck pass
58
+ - [ ] All tests pass
59
+
60
+ ### Risk Assessment
61
+
62
+ | Factor | Level | Notes |
63
+ |--------|-------|-------|
64
+ | **Scope** | Low / Med / High | {number of files, modules touched} |
65
+ | **Data impact** | None / Low / High | {any schema or data changes} |
66
+ | **Security** | None / Low / High | {auth, input validation, secrets} |
67
+ | **Rollback** | Easy / Complex | {can this be reverted cleanly?} |
68
+
69
+ ### Breaking Changes
70
+
71
+ {None, or describe what breaks and how to migrate}
72
+
73
+ ### Related
74
+
75
+ - Closes #{issue_number}
76
+ - Related: #{other_issue}
77
+ ```
78
+
79
+ ## Few-Shot Examples
80
+
81
+ ### Example 1: Feature PR
82
+
83
+ **Input:** Diff adds a new rate-limiting middleware, updates 3 route files, adds tests.
84
+
85
+ **Output:**
86
+
87
+ ```markdown
88
+ ## feat: add rate limiting to public API endpoints
89
+
90
+ ### Summary
91
+
92
+ - Add token-bucket rate limiter middleware to prevent abuse of public endpoints
93
+ - Apply 100 req/min limit to auth endpoints, 1000 req/min to read endpoints
94
+ - Return standard `429 Too Many Requests` with `Retry-After` header
95
+
96
+ ### Changes
97
+
98
+ | File | Change | Description |
99
+ |------|--------|-------------|
100
+ | `src/middleware/rateLimiter.ts` | Added | Token-bucket implementation with Redis backing |
101
+ | `src/routes/auth.ts` | Modified | Apply rate limiter with auth-tier limits |
102
+ | `src/routes/api.ts` | Modified | Apply rate limiter with standard-tier limits |
103
+ | `tests/unit/rateLimiter.test.ts` | Added | 8 tests covering burst, steady-state, and reset |
104
+
105
+ ### Test Plan
106
+
107
+ - [ ] Verify 429 returned after exceeding limit
108
+ - [ ] Verify `Retry-After` header is accurate
109
+ - [ ] Verify rate limit resets after window expires
110
+ - [ ] Load test confirms no false positives under normal traffic
111
+
112
+ ### Risk Assessment
113
+
114
+ | Factor | Level | Notes |
115
+ |--------|-------|-------|
116
+ | **Scope** | Medium | 3 route files + new middleware |
117
+ | **Data impact** | None | No schema changes |
118
+ | **Security** | Low | Additive security improvement |
119
+ | **Rollback** | Easy | Remove middleware from routes |
120
+
121
+ ### Breaking Changes
122
+
123
+ None
124
+
125
+ ### Related
126
+
127
+ - Closes #42
128
+ ```
129
+
130
+ ### Example 2: Bug Fix PR
131
+
132
+ **Input:** Diff fixes an off-by-one error in pagination, adds a regression test.
133
+
134
+ **Output:**
135
+
136
+ ```markdown
137
+ ## fix: correct off-by-one in cursor pagination
138
+
139
+ ### Summary
140
+
141
+ - Fix pagination returning duplicate items when cursor falls on page boundary
142
+ - Root cause: `>=` comparison should have been `>` in cursor offset calculation
143
+
144
+ ### Changes
145
+
146
+ | File | Change | Description |
147
+ |------|--------|-------------|
148
+ | `src/db/pagination.ts` | Modified | Fix boundary comparison operator |
149
+ | `tests/unit/pagination.test.ts` | Modified | Add regression test for boundary cursor |
150
+
151
+ ### Test Plan
152
+
153
+ - [ ] Verify no duplicates at page boundary (regression test added)
154
+ - [ ] Verify first page, last page, and empty result still work
155
+ - [ ] Existing pagination tests still pass
156
+
157
+ ### Risk Assessment
158
+
159
+ | Factor | Level | Notes |
160
+ |--------|-------|-------|
161
+ | **Scope** | Low | Single line fix + test |
162
+ | **Data impact** | None | Read-only query change |
163
+ | **Security** | None | No auth changes |
164
+ | **Rollback** | Easy | Revert single commit |
165
+
166
+ ### Breaking Changes
167
+
168
+ None
169
+
170
+ ### Related
171
+
172
+ - Closes #87
173
+ ```
@@ -0,0 +1,77 @@
1
+ ---
2
+ id: hatch3r-accessibility-standards
3
+ type: rule
4
+ description: Accessibility standards covering WCAG 2.2 AA compliance, keyboard navigation, screen readers, and ARIA patterns
5
+ scope: always
6
+ ---
7
+ # Accessibility Standards
8
+
9
+ ## WCAG 2.2 AA Compliance
10
+
11
+ All user-facing features must meet WCAG 2.2 Level AA conformance. This is the baseline — Level AAA is aspirational for critical user flows.
12
+
13
+ ## Keyboard Navigation
14
+
15
+ - All interactive elements must be reachable and operable via keyboard alone.
16
+ - Tab order follows the visual reading order (left-to-right, top-to-bottom for LTR languages).
17
+ - Never use `tabindex` values greater than 0. Use `tabindex="0"` to add to natural flow, `tabindex="-1"` for programmatic focus only.
18
+ - Custom widgets implement standard keyboard patterns: arrow keys for navigation within a group, Enter/Space for activation, Escape to dismiss.
19
+ - Keyboard traps are forbidden. Every focused element must have a keyboard-accessible exit.
20
+ - Skip navigation links appear as the first focusable element on pages with repeated navigation.
21
+
22
+ ## Focus Management
23
+
24
+ - Focus is visible at all times. Custom focus indicators must have a minimum 3:1 contrast ratio against the background.
25
+ - When content changes dynamically (modals, drawers, toasts), move focus to the new content.
26
+ - When a modal or dialog closes, return focus to the element that triggered it.
27
+ - Single-page application route changes move focus to the main content heading or a skip link target.
28
+ - Never remove focus outlines globally. If overriding browser defaults, provide an equally visible alternative.
29
+
30
+ ## Color and Contrast
31
+
32
+ - Text contrast ratio: minimum 4.5:1 for normal text, 3:1 for large text (18px+ or 14px+ bold).
33
+ - Non-text contrast: minimum 3:1 for UI components (borders, icons, form controls) and graphical objects.
34
+ - Never convey information through color alone. Use additional indicators: icons, text labels, patterns.
35
+ - Test with color blindness simulators (protanopia, deuteranopia, tritanopia).
36
+ - Dark mode and light mode must independently meet contrast requirements.
37
+
38
+ ## Screen Reader Support
39
+
40
+ - All images have meaningful `alt` text or `alt=""` for decorative images.
41
+ - Form controls have associated `<label>` elements (using `for`/`id` or wrapping).
42
+ - Use semantic HTML elements (`<nav>`, `<main>`, `<header>`, `<footer>`, `<section>`, `<article>`) before reaching for ARIA roles.
43
+ - Dynamic content updates use `aria-live` regions: `polite` for non-urgent updates, `assertive` for critical alerts.
44
+ - Tables have `<caption>` and use `<th scope="col|row">` for header cells.
45
+ - Icon-only buttons include `aria-label` or visually hidden text.
46
+
47
+ ## ARIA Patterns
48
+
49
+ - Follow the [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/) for all custom widgets.
50
+ - ARIA role must match keyboard behavior — a `role="button"` element must respond to Enter and Space.
51
+ - Use `aria-expanded`, `aria-selected`, `aria-checked` to communicate widget state.
52
+ - `aria-describedby` links error messages and help text to form controls.
53
+ - Avoid ARIA when native HTML provides the same semantics. First rule of ARIA: don't use ARIA if native HTML works.
54
+ - Test ARIA implementations with at least two screen readers (VoiceOver + NVDA or JAWS).
55
+
56
+ ## Motion and Animation
57
+
58
+ - All animations must respect `prefers-reduced-motion: reduce`. Disable non-essential motion.
59
+ - Essential animations (progress indicators, loading states) simplify rather than disable entirely.
60
+ - No content flashes more than 3 times per second (seizure safety — WCAG 2.3.1).
61
+ - Auto-playing media has a visible pause/stop mechanism.
62
+
63
+ ## Forms and Input
64
+
65
+ - Group related form controls with `<fieldset>` and `<legend>`.
66
+ - Error messages identify the field in error and describe how to fix it.
67
+ - Required fields are indicated both visually and programmatically (`aria-required="true"` or `required`).
68
+ - Input validation provides feedback inline and in an error summary.
69
+ - Time limits are either removable, adjustable (10x minimum), or preceded by a warning with option to extend.
70
+
71
+ ## Testing with Assistive Technology
72
+
73
+ - Test with a screen reader on every feature branch that modifies UI.
74
+ - Minimum testing matrix: VoiceOver (macOS/iOS) + Chrome, NVDA + Firefox (Windows).
75
+ - Run automated accessibility checks (axe-core, Lighthouse) in CI.
76
+ - Automated tools catch ~30% of accessibility issues. Manual testing is required for keyboard flows, screen reader experience, and cognitive accessibility.
77
+ - Maintain an accessibility test checklist per component type (form, modal, navigation, data table).
@@ -0,0 +1,75 @@
1
+ ---
2
+ description: Accessibility standards covering WCAG 2.2 AA compliance, keyboard navigation, screen readers, and ARIA patterns
3
+ alwaysApply: true
4
+ ---
5
+ # Accessibility Standards
6
+
7
+ ## WCAG 2.2 AA Compliance
8
+
9
+ All user-facing features must meet WCAG 2.2 Level AA conformance. This is the baseline — Level AAA is aspirational for critical user flows.
10
+
11
+ ## Keyboard Navigation
12
+
13
+ - All interactive elements must be reachable and operable via keyboard alone.
14
+ - Tab order follows the visual reading order (left-to-right, top-to-bottom for LTR languages).
15
+ - Never use `tabindex` values greater than 0. Use `tabindex="0"` to add to natural flow, `tabindex="-1"` for programmatic focus only.
16
+ - Custom widgets implement standard keyboard patterns: arrow keys for navigation within a group, Enter/Space for activation, Escape to dismiss.
17
+ - Keyboard traps are forbidden. Every focused element must have a keyboard-accessible exit.
18
+ - Skip navigation links appear as the first focusable element on pages with repeated navigation.
19
+
20
+ ## Focus Management
21
+
22
+ - Focus is visible at all times. Custom focus indicators must have a minimum 3:1 contrast ratio against the background.
23
+ - When content changes dynamically (modals, drawers, toasts), move focus to the new content.
24
+ - When a modal or dialog closes, return focus to the element that triggered it.
25
+ - Single-page application route changes move focus to the main content heading or a skip link target.
26
+ - Never remove focus outlines globally. If overriding browser defaults, provide an equally visible alternative.
27
+
28
+ ## Color and Contrast
29
+
30
+ - Text contrast ratio: minimum 4.5:1 for normal text, 3:1 for large text (18px+ or 14px+ bold).
31
+ - Non-text contrast: minimum 3:1 for UI components (borders, icons, form controls) and graphical objects.
32
+ - Never convey information through color alone. Use additional indicators: icons, text labels, patterns.
33
+ - Test with color blindness simulators (protanopia, deuteranopia, tritanopia).
34
+ - Dark mode and light mode must independently meet contrast requirements.
35
+
36
+ ## Screen Reader Support
37
+
38
+ - All images have meaningful `alt` text or `alt=""` for decorative images.
39
+ - Form controls have associated `<label>` elements (using `for`/`id` or wrapping).
40
+ - Use semantic HTML elements (`<nav>`, `<main>`, `<header>`, `<footer>`, `<section>`, `<article>`) before reaching for ARIA roles.
41
+ - Dynamic content updates use `aria-live` regions: `polite` for non-urgent updates, `assertive` for critical alerts.
42
+ - Tables have `<caption>` and use `<th scope="col|row">` for header cells.
43
+ - Icon-only buttons include `aria-label` or visually hidden text.
44
+
45
+ ## ARIA Patterns
46
+
47
+ - Follow the [WAI-ARIA Authoring Practices](https://www.w3.org/WAI/ARIA/apg/) for all custom widgets.
48
+ - ARIA role must match keyboard behavior — a `role="button"` element must respond to Enter and Space.
49
+ - Use `aria-expanded`, `aria-selected`, `aria-checked` to communicate widget state.
50
+ - `aria-describedby` links error messages and help text to form controls.
51
+ - Avoid ARIA when native HTML provides the same semantics. First rule of ARIA: don't use ARIA if native HTML works.
52
+ - Test ARIA implementations with at least two screen readers (VoiceOver + NVDA or JAWS).
53
+
54
+ ## Motion and Animation
55
+
56
+ - All animations must respect `prefers-reduced-motion: reduce`. Disable non-essential motion.
57
+ - Essential animations (progress indicators, loading states) simplify rather than disable entirely.
58
+ - No content flashes more than 3 times per second (seizure safety — WCAG 2.3.1).
59
+ - Auto-playing media has a visible pause/stop mechanism.
60
+
61
+ ## Forms and Input
62
+
63
+ - Group related form controls with `<fieldset>` and `<legend>`.
64
+ - Error messages identify the field in error and describe how to fix it.
65
+ - Required fields are indicated both visually and programmatically (`aria-required="true"` or `required`).
66
+ - Input validation provides feedback inline and in an error summary.
67
+ - Time limits are either removable, adjustable (10x minimum), or preceded by a warning with option to extend.
68
+
69
+ ## Testing with Assistive Technology
70
+
71
+ - Test with a screen reader on every feature branch that modifies UI.
72
+ - Minimum testing matrix: VoiceOver (macOS/iOS) + Chrome, NVDA + Firefox (Windows).
73
+ - Run automated accessibility checks (axe-core, Lighthouse) in CI.
74
+ - Automated tools catch ~30% of accessibility issues. Manual testing is required for keyboard flows, screen reader experience, and cognitive accessibility.
75
+ - Maintain an accessibility test checklist per component type (form, modal, navigation, data table).
@@ -0,0 +1,160 @@
1
+ ---
2
+ id: hatch3r-agent-orchestration
3
+ type: rule
4
+ description: Mandatory agent delegation, skill loading, and subagent usage directives for ALL tasks in ALL contexts
5
+ scope: always
6
+ ---
7
+ # Agent Orchestration
8
+
9
+ This rule governs when and how to delegate work to hatch3r agents, load skills, and spawn subagents. These directives are mandatory — not suggestions.
10
+
11
+ ## Universal Applicability
12
+
13
+ This rule applies to EVERY context without exception:
14
+
15
+ - **Board-pickup** (epic, sub-issue, standalone, batch)
16
+ - **Workflow command** (full mode and quick mode)
17
+ - **Plain chat** (single task or multiple tasks)
18
+ - **Issue references** (e.g., "implement #5")
19
+ - **Natural language requests** (e.g., "add a dark mode toggle")
20
+
21
+ Whether the user invokes a command or simply asks for a task in conversation, the full sub-agent pipeline defined below is mandatory. There is no context where implementing code inline (without sub-agents) is acceptable.
22
+
23
+ ## Universal Sub-Agent Pipeline
24
+
25
+ Every task MUST follow this three-phase pipeline:
26
+
27
+ **Phase 1 — Research:** Spawn `hatch3r-researcher` for context gathering. Skip only for trivial single-line edits (typos, comment fixes, single-value config changes). All other tasks require researcher context.
28
+
29
+ **Phase 2 — Implement:** Spawn `hatch3r-implementer` for ALL code changes. One dedicated implementer per task. Never implement inline — always delegate via the Task tool.
30
+
31
+ **Phase 3 — Quality:** Spawn ALL applicable specialists in parallel after implementation:
32
+
33
+ | Specialist | When | Mandatory? |
34
+ |-----------|------|------------|
35
+ | `hatch3r-reviewer` | After every implementation | YES — always |
36
+ | `hatch3r-test-writer` | After every code change | YES — always for code changes |
37
+ | `hatch3r-security-auditor` | After every code change | YES — always for code changes |
38
+ | `hatch3r-docs-writer` | After every implementation | EVALUATE — spawn when changes affect APIs, architecture, user-facing behavior, or when specs/ADRs need updating |
39
+ | `hatch3r-lint-fixer` | When lint errors present | Conditional |
40
+ | `hatch3r-a11y-auditor` | When UI/accessibility changes | Conditional |
41
+ | `hatch3r-perf-profiler` | When performance-sensitive changes | Conditional |
42
+ | `hatch3r-dependency-auditor` | When dependencies change | Conditional |
43
+ | `hatch3r-ci-watcher` | When CI fails | Conditional |
44
+
45
+ ## Agent Roster
46
+
47
+ | Agent | Purpose | Invoke When |
48
+ |-------|---------|-------------|
49
+ | `hatch3r-researcher` | Context gathering across 12 research modes | ALWAYS before implementation. Skip only for trivial single-line edits. Select modes by task type. |
50
+ | `hatch3r-implementer` | Focused single-task implementation | ALWAYS. One dedicated implementer per task — standalone issues, epic sub-issues, batched issues, and plain chat tasks all get dedicated implementers. |
51
+ | `hatch3r-reviewer` | Code review for quality, security, performance | ALWAYS after implementation, before PR creation. |
52
+ | `hatch3r-test-writer` | Regression and coverage tests | ALWAYS for code changes. Not just bugs — every code change gets tests. |
53
+ | `hatch3r-security-auditor` | Security rules, data flows, access control | ALWAYS for code changes. Not just `area:security` — every code change gets a security review. |
54
+ | `hatch3r-docs-writer` | Specs, ADRs, documentation maintenance | ALWAYS evaluate. Spawn when changes affect APIs, architecture, or user-facing behavior. |
55
+ | `hatch3r-lint-fixer` | Style, formatting, type error cleanup | After implementation when lint errors are present. |
56
+ | `hatch3r-a11y-auditor` | WCAG AA compliance checks | When UI/accessibility changes are made. |
57
+ | `hatch3r-perf-profiler` | Performance profiling and optimization | When performance-sensitive changes are made. |
58
+ | `hatch3r-dependency-auditor` | Supply chain security, CVE scanning | When dependencies change or new packages are added. |
59
+ | `hatch3r-ci-watcher` | CI/CD failure diagnosis and fix suggestions | When CI fails during or after implementation. |
60
+
61
+ ## Mandatory Delegation Directives
62
+
63
+ ### Context Gathering (Before Implementation)
64
+
65
+ You MUST spawn a `hatch3r-researcher` subagent before implementing any task. Skip only for trivial single-line edits (typos, comment fixes, single-value config changes). Select research modes by task type:
66
+
67
+ - **`type:bug`**: modes `symptom-trace`, `root-cause`, `codebase-impact`
68
+ - **`type:feature`**: modes `codebase-impact`, `feature-design`, `architecture`
69
+ - **`type:refactor`**: modes `current-state`, `refactoring-strategy`, `migration-path`
70
+ - **`type:qa`**: modes `codebase-impact`
71
+
72
+ Use depth `quick` for low-risk tasks, `standard` for medium-risk, `deep` for high-risk.
73
+
74
+ ### Implementation Delegation
75
+
76
+ You MUST spawn a `hatch3r-implementer` subagent via the Task tool for ALL code changes. Never implement inline.
77
+
78
+ - **Single standalone issue**: Spawn one `hatch3r-implementer`. The orchestrator coordinates git, PR, and board operations.
79
+ - **Plain chat single task**: Spawn one `hatch3r-implementer`. Create synthetic issue context first (title, acceptance criteria, type).
80
+ - **Epics with sub-issues**: Spawn one `hatch3r-implementer` per sub-issue. Execute level-by-level respecting dependency order.
81
+ - **Multiple standalone issues (batch)**: Treat as a batch. Group by dependency level, spawn one `hatch3r-implementer` per issue, execute level-by-level. Shared branch, combined PR.
82
+
83
+ ### Post-Implementation Quality Pipeline
84
+
85
+ You MUST spawn specialist subagents after implementation completes. Launch as many independent subagents in parallel as the platform supports — no artificial concurrency limit.
86
+
87
+ **Always spawn (mandatory for every code change):**
88
+
89
+ 1. `hatch3r-reviewer` — code review. Include the diff and acceptance criteria in the prompt.
90
+ 2. `hatch3r-test-writer` — tests for all code changes. Unit tests for new logic, regression tests for bug fixes, integration tests for cross-module changes.
91
+ 3. `hatch3r-security-auditor` — security review of all code changes. Audit data flows, access control, input validation, and secret management.
92
+
93
+ **Always evaluate (spawn when applicable):**
94
+
95
+ 4. `hatch3r-docs-writer` — spawn when changes affect public APIs, architectural patterns, user-facing behavior, or when specs/ADRs need updating. If no documentation impact exists, skip silently.
96
+
97
+ **Conditional specialists (spawn when triggered):**
98
+
99
+ 5. `hatch3r-lint-fixer` — when lint or type errors are present after implementation.
100
+ 6. `hatch3r-a11y-auditor` — when UI or accessibility changes are made.
101
+ 7. `hatch3r-perf-profiler` — when performance-sensitive changes are made.
102
+ 8. `hatch3r-dependency-auditor` — when dependencies change or new packages are added.
103
+
104
+ ## Skill Loading Directives
105
+
106
+ Before implementing any task, you MUST read and follow the matching hatch3r skill:
107
+
108
+ | Task Type | Skill |
109
+ |-----------|-------|
110
+ | `type:bug` | `hatch3r-bug-fix` |
111
+ | `type:feature` | `hatch3r-feature` (aka `hatch3r-feature-implementation`) |
112
+ | `type:refactor` + `area:ui` | `hatch3r-visual-refactor` |
113
+ | `type:refactor` + behavior change | `hatch3r-logical-refactor` |
114
+ | `type:refactor` (other) | `hatch3r-refactor` (aka `hatch3r-code-refactor`) |
115
+ | `type:qa` | `hatch3r-qa-validation` |
116
+
117
+ When a skill references agents under "Required Agent Delegation", those delegations are mandatory — you MUST spawn the listed agents via the Task tool.
118
+
119
+ ## Subagent Spawning Protocol
120
+
121
+ When spawning any subagent via the Task tool:
122
+
123
+ 1. **Use `subagent_type: "generalPurpose"`** for all hatch3r agent delegations.
124
+ 2. **Include in every subagent prompt**:
125
+ - The agent protocol to follow (e.g., "Follow the hatch3r-implementer agent protocol").
126
+ - All `scope: always` rules from `/.agents/rules/` that apply.
127
+ - The project's tooling hierarchy (Context7 MCP for library docs, web research for current context).
128
+ - Relevant learnings from `/.agents/learnings/` if the directory exists.
129
+ 3. **Launch as many independent subagents in parallel as the platform supports.** Do not impose an artificial concurrency limit. Use maximum parallelism for independent work.
130
+ 4. **Await and review results** before proceeding. If a subagent reports BLOCKED or PARTIAL, surface to the user.
131
+
132
+ ## Single-Task Plain Chat Protocol
133
+
134
+ When the user provides a single task in plain chat (no command invoked, no issue reference), the full sub-agent pipeline still applies:
135
+
136
+ 1. **Classify** the task by type (bug/feature/refactor/QA/other) based on context.
137
+ 2. **Create synthetic issue context** — title, acceptance criteria, and type — from the user's instruction.
138
+ 3. **Run the Universal Sub-Agent Pipeline**: Phase 1 (Research) → Phase 2 (Implement) → Phase 3 (Quality).
139
+ 4. For GitHub issue references in chat (e.g., "fix #5"), fetch issue details via `gh issue view` and use them as the task context instead of creating synthetic context.
140
+
141
+ This ensures consistent quality regardless of how the task was initiated.
142
+
143
+ ## Multi-Task Detection (Plain Chat)
144
+
145
+ When the user provides multiple tasks in a single message — numbered lists, comma-separated instructions, multiple issue references (e.g., "implement #1, #3, #7"), or multiple distinct requests — you MUST parallelize them:
146
+
147
+ 1. **Parse** the message into individual discrete tasks. Each distinct implementation request is one task.
148
+ 2. **Classify** each task by type (bug/feature/refactor/QA/other) based on context or explicit labels.
149
+ 3. **Build a dependency graph** among the tasks. Independent tasks share the same level and run in parallel.
150
+ 4. **Spawn one `hatch3r-researcher` subagent per task** (skip for trivial single-line edits only). Launch in parallel.
151
+ 5. **Spawn one `hatch3r-implementer` subagent per task** per dependency level.
152
+ 6. **For GitHub issue references**: fetch issue details via `gh issue view` and use them as the task context.
153
+ 7. **For natural language tasks**: create synthetic issue context (title, acceptance criteria, type) from the instruction. Pass this context to the implementer subagent.
154
+ 8. **Spawn the full quality pipeline** after all implementations complete: reviewer + test-writer + security-auditor (always), plus docs-writer, auditors as applicable.
155
+
156
+ This directive applies regardless of whether board-pickup was invoked. Any context where implementation tasks are identified MUST use one subagent per task with maximum parallelism.
157
+
158
+ ## Rule Application
159
+
160
+ All hatch3r rules with `scope: always` apply to every implementation task, including work delegated to subagents. When constructing subagent prompts, include the rule directives — subagents do not automatically inherit the parent's rule context.