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,129 @@
1
+ ---
2
+ id: hatch3r-feature
3
+ description: End-to-end feature implementation workflow. Covers data model, domain logic, API, and UI as a vertical slice. Use when implementing new features or working on feature request issues.
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
+ # Feature Implementation Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Read the issue and all relevant specs
14
+ - [ ] Step 2: Produce an implementation plan
15
+ - [ ] Step 2b: Test-first approach (TDD alternative — optional)
16
+ - [ ] Step 3: Implement the vertical slice
17
+ - [ ] Step 4: Write tests (unit, integration, security, E2E)
18
+ - [ ] Step 5: Verify quality gates
19
+ - [ ] Step 5b: Browser verification (if UI)
20
+ - [ ] Step 6: Open PR
21
+ ```
22
+
23
+ ## Step 1: Read Inputs
24
+
25
+ - Parse the issue body: problem/goal, proposed solution, acceptance criteria, scope (in/out), UX notes, edge cases, security considerations, rollout plan.
26
+ - Read relevant project documentation (glossary, user flows, behavior, event model, data model, privacy, monetization, as applicable).
27
+ - Review existing code patterns in the affected area.
28
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
29
+
30
+ ## Step 2: Implementation Plan
31
+
32
+ Before coding, output:
33
+
34
+ - **Approach:** high-level strategy
35
+ - **Files to create/modify:** list with what changes
36
+ - **Data model changes:** new collections/fields, if any
37
+ - **Event changes:** new event types, if any
38
+ - **Entitlement changes:** new gates, if any
39
+ - **Risks:** what could go wrong
40
+ - **Phasing:** how to split into PRs if large
41
+
42
+ ## Step 2b: Test-First Approach (TDD Alternative)
43
+
44
+ When acceptance criteria are specific and testable, write tests BEFORE implementing:
45
+
46
+ 1. **Write acceptance tests** from the issue's acceptance criteria. Each criterion becomes at least one test.
47
+ 2. **Write unit test shells** for planned functions/modules from the implementation plan.
48
+ 3. **Run all new tests** — confirm they fail (proves they're testing real behavior, not tautologies).
49
+ 4. **Implement the vertical slice** (Step 3) to make tests pass incrementally.
50
+ 5. **Add edge case tests** as you discover them during implementation.
51
+
52
+ Prefer TDD when:
53
+ - Acceptance criteria are specific and quantifiable
54
+ - Building a well-defined API, service, or utility
55
+ - Working in a domain with complex business logic
56
+
57
+ Use standard flow (implement → test) when:
58
+ - Acceptance criteria are exploratory ("improve UX of...")
59
+ - Heavy UI work where visual verification is primary
60
+ - Prototyping or spike work
61
+
62
+ ## Step 3: Implement
63
+
64
+ - Deliver a complete vertical slice (data -> logic -> UI).
65
+ - Use stable IDs from the project glossary.
66
+ - If database/backend data is needed, include security rules updates.
67
+ - If feature is gated, enforce entitlements client-side AND server-side.
68
+ - If new events, follow the project's event schema.
69
+
70
+ ## Step 4: Tests
71
+
72
+ - **Unit tests:** All new business logic.
73
+ - **Integration tests:** Cross-module interactions.
74
+ - **Security rules tests:** If database collections/rules modified.
75
+ - **Contract tests:** If new event types or API contracts.
76
+ - **E2E tests:** If user-facing flow.
77
+
78
+ ## Step 5: Verify
79
+
80
+ ```bash
81
+ npm run lint && npm run typecheck && npm run test
82
+ ```
83
+
84
+ ## Step 5b: Browser Verification (if UI)
85
+
86
+ Skip this step if the feature has no user-facing UI changes.
87
+
88
+ - Ensure the dev server is running. If not, start it in the background.
89
+ - Navigate to the page or surface affected by the new feature.
90
+ - Walk through the acceptance criteria visually — confirm the feature renders and behaves correctly.
91
+ - Interact with new UI elements: click, type, trigger state transitions.
92
+ - Check the browser console for errors or warnings.
93
+ - If the feature is responsive, test at different viewport sizes.
94
+ - Capture screenshots showing the feature working as expected.
95
+
96
+ ## Step 6: Open PR
97
+
98
+ Use the project's PR template. Include:
99
+
100
+ - Feature summary and motivation
101
+ - Implementation approach
102
+ - Screenshots/recordings (if UI)
103
+ - Test evidence
104
+ - Rollout plan (feature flag if specified)
105
+
106
+ ## Required Agent Delegation
107
+
108
+ You MUST spawn these agents via the Task tool (`subagent_type: "generalPurpose"`) at the appropriate points:
109
+
110
+ - **`hatch3r-researcher`** — MUST spawn before implementation with modes `codebase-impact`, `feature-design`, `architecture`. Skip only for trivially simple features (`risk:low` AND `priority:p3`).
111
+ - **`hatch3r-implementer`** — MUST spawn one per sub-issue when the feature is decomposed into multiple tasks. Each implementer receives its own sub-issue context.
112
+ - **`hatch3r-reviewer`** — MUST spawn after implementation for code review before PR creation.
113
+
114
+ ## Related Skills
115
+
116
+ - **Skill**: `hatch3r-qa-validation` — use this skill for end-to-end verification of the implemented feature
117
+
118
+ ## Definition of Done
119
+
120
+ - [ ] All acceptance criteria met
121
+ - [ ] Unit + integration tests cover new logic
122
+ - [ ] Security rules tested (if data model changed)
123
+ - [ ] Entitlement gates enforced server-side (if gated)
124
+ - [ ] Accessibility requirements met (if UI)
125
+ - [ ] Browser-verified against acceptance criteria (if UI)
126
+ - [ ] Performance budgets maintained
127
+ - [ ] Privacy invariants respected
128
+ - [ ] Rollout plan documented
129
+ - [ ] Relevant spec docs updated
@@ -0,0 +1,150 @@
1
+ ---
2
+ id: hatch3r-gh-agentic-workflows
3
+ description: Set up GitHub Agentic Workflows for continuous AI-powered repository automation
4
+ ---
5
+ # GitHub Agentic Workflows Integration
6
+
7
+ GitHub Agentic Workflows (technical preview, Feb 2026) bring AI agent orchestration into
8
+ GitHub Actions. This skill guides setup for hatch3r-managed projects.
9
+
10
+ ## Overview
11
+
12
+ Agentic Workflows are markdown files in `.github/workflows/` with YAML frontmatter that
13
+ compile to GitHub Actions jobs. They support multiple AI engines (GitHub Copilot, Claude,
14
+ OpenAI Codex) and use MCP for tool access.
15
+
16
+ ## Available Workflow Templates
17
+
18
+ hatch3r recommends these agentic workflow patterns for projects:
19
+
20
+ ### 1. Continuous Test Improvement
21
+
22
+ Automatically assess test coverage and add high-value tests.
23
+
24
+ ```yaml
25
+ # .github/workflows/hatch3r-continuous-testing.md
26
+ ---
27
+ name: Continuous Test Improvement
28
+ on:
29
+ schedule:
30
+ - cron: '0 6 * * 1'
31
+ workflow_dispatch:
32
+ engine: copilot
33
+ permissions:
34
+ contents: read
35
+ pull-requests: write
36
+ ---
37
+ ```
38
+
39
+ Analyze test coverage gaps and open PRs with new tests for uncovered critical paths.
40
+
41
+ ### 2. Continuous Triage
42
+
43
+ Automatically summarize, label, and route new issues.
44
+
45
+ ```yaml
46
+ # .github/workflows/hatch3r-continuous-triage.md
47
+ ---
48
+ name: Continuous Triage
49
+ on:
50
+ issues:
51
+ types: [opened]
52
+ engine: copilot
53
+ permissions:
54
+ issues: write
55
+ ---
56
+ ```
57
+
58
+ When a new issue is opened, analyze it, apply labels from the hatch3r taxonomy
59
+ (type:*, priority:*, area:*), and add a triage summary comment.
60
+
61
+ ### 3. Continuous Documentation
62
+
63
+ Keep documentation aligned with code changes.
64
+
65
+ ```yaml
66
+ # .github/workflows/hatch3r-continuous-docs.md
67
+ ---
68
+ name: Continuous Documentation
69
+ on:
70
+ pull_request:
71
+ types: [closed]
72
+ branches: [main]
73
+ engine: copilot
74
+ permissions:
75
+ contents: write
76
+ pull-requests: write
77
+ ---
78
+ ```
79
+
80
+ After a PR is merged, check if documentation needs updating and open a follow-up PR.
81
+
82
+ ## Security Considerations
83
+
84
+ - Workflows run in sandboxed environments with minimal permissions
85
+ - Use read-only defaults; only grant write permissions when needed
86
+ - Review all AI-generated changes before merging
87
+ - Network isolation and tool allowlisting are enforced by the runtime
88
+
89
+ ## Integration with hatch3r
90
+
91
+ - hatch3r's label taxonomy (type:*, executor:*, priority:*) aligns with agentic triage
92
+ - The hatch3r-test-writer agent's patterns can inform continuous testing workflows
93
+ - The hatch3r-docs-writer agent's patterns can inform continuous documentation
94
+ - Board management commands complement continuous triage
95
+
96
+ ## Setup
97
+
98
+ 1. Enable GitHub Agentic Workflows in your repository settings
99
+ 2. Create workflow files in `.github/workflows/` using the templates above
100
+ 3. Configure the AI engine (copilot is default, claude and codex are alternatives)
101
+ 4. Set appropriate permissions for each workflow
102
+ 5. Monitor workflow runs in the Actions tab
103
+
104
+ ## Verification Steps
105
+
106
+ 1. **Syntax check**: Validate the workflow file with `gh workflow view {name}` or the GitHub Actions web UI.
107
+ 2. **Dry run**: Trigger manually via `gh workflow run {name}` and monitor with `gh run watch`.
108
+ 3. **Output review**: Check the AI-generated output (PR, comment, label) for quality and correctness.
109
+ 4. **Permission audit**: Verify the workflow cannot access resources beyond its declared permissions.
110
+ 5. **Idempotency**: Run the workflow twice on the same input — it should not create duplicate artifacts.
111
+ 6. **Error handling**: Trigger with invalid/edge-case input — workflow should fail gracefully with clear error.
112
+
113
+ ## Monitoring
114
+
115
+ - **Execution tracking**: Use `gh run list --workflow={name}` to monitor recent runs.
116
+ - **Failure alerts**: Configure GitHub Actions notifications (Settings → Notifications → Actions).
117
+ - **Cost awareness**: Monitor AI token usage per workflow run. Set spending limits in org settings.
118
+ - **Quality metrics**: Track: success rate, output acceptance rate (merged PRs / total PRs), mean time per run.
119
+
120
+ ## Troubleshooting
121
+
122
+ | Symptom | Likely Cause | Fix |
123
+ |---------|-------------|-----|
124
+ | Workflow doesn't trigger | Incorrect `on:` event or branch filter | Verify event type matches, check branch protection rules |
125
+ | AI output is empty/poor | Insufficient context in workflow body | Add more context, reference specific files, include examples |
126
+ | Permission denied | Missing or insufficient permissions | Add required permissions in frontmatter, check org policies |
127
+ | MCP tool fails | Server not available or misconfigured | Verify MCP server is accessible, check auth tokens |
128
+ | Rate limiting | Too many workflow runs | Add concurrency groups, reduce trigger frequency |
129
+ | Workflow hangs | Large repo context or slow AI response | Set timeout-minutes, scope file references |
130
+
131
+ ## Rollback
132
+
133
+ If a workflow produces undesirable results:
134
+
135
+ 1. **Disable immediately**: `gh workflow disable {name}` or toggle in repo Settings → Actions.
136
+ 2. **Revert outputs**: Close AI-generated PRs, remove applied labels, revert merged changes if needed.
137
+ 3. **Diagnose**: Review recent run logs with `gh run view {run-id} --log`.
138
+ 4. **Fix and re-enable**: Update the workflow file, test via manual dispatch, then re-enable.
139
+
140
+ ## Definition of Done
141
+
142
+ - [ ] Workflow file created in `.github/workflows/` with correct YAML frontmatter
143
+ - [ ] Engine configured (copilot/claude/codex) with appropriate model selection
144
+ - [ ] Permissions scoped to minimum required (read-only defaults, write only where needed)
145
+ - [ ] MCP tool access configured if needed (with allowlisting)
146
+ - [ ] Trigger events appropriate for the workflow's purpose
147
+ - [ ] Manual `workflow_dispatch` trigger included for testing
148
+ - [ ] Workflow tested via manual dispatch with expected outcomes verified
149
+ - [ ] Monitoring configured (GitHub Actions notifications or Slack integration)
150
+ - [ ] Documentation updated (README or CONTRIBUTING) to describe the new workflow
@@ -0,0 +1,86 @@
1
+ ---
2
+ id: hatch3r-incident-response
3
+ description: Handle production incidents with structured triage, mitigation, and post-mortem. Use when responding to production issues, outages, or security incidents.
4
+ ---
5
+ # Incident Response Workflow
6
+
7
+ ## Quick Start
8
+
9
+ ```
10
+ Task Progress:
11
+ - [ ] Step 1: Classify severity (P0-P3) based on impact
12
+ - [ ] Step 2: Triage — identify affected systems, user impact, blast radius
13
+ - [ ] Step 3: Mitigate — apply hotfix or rollback, verify mitigation works
14
+ - [ ] Step 4: Root cause analysis — trace the failure chain
15
+ - [ ] Step 5: Write post-mortem with timeline, root cause, action items
16
+ - [ ] Step 6: Create follow-up issues for permanent fixes and preventive measures
17
+ ```
18
+
19
+ ## Step 1: Classify Severity
20
+
21
+ | Severity | Definition | Examples |
22
+ | -------- | ------------------------------------------- | -------------------------------------------- |
23
+ | P0 | Complete outage, data loss, security breach | App unusable, auth down, data exposed |
24
+ | P1 | Major degradation, significant user impact | Sync failing, billing broken, >1% error rate |
25
+ | P2 | Partial degradation, limited impact | Single flow broken, slow performance |
26
+ | P3 | Minor issue, workaround available | Cosmetic bug, edge case |
27
+
28
+ - Use **GitHub MCP** (`issue_read`, `search_issues`) to check for related issues or prior incidents.
29
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
30
+
31
+ ## Step 2: Triage
32
+
33
+ - **Affected systems:** Frontend, backend, database, auth, payment, third-party services?
34
+ - **User impact:** How many users? Which flows? Which plans (free/paid)?
35
+ - **Blast radius:** Is the issue contained or spreading?
36
+ - **Data:** Any data corruption, loss, or exposure? Check project privacy/security specs for implications.
37
+ - **Timeline:** When did it start? Any recent deploys, config changes, or dependency updates?
38
+
39
+ ## Step 3: Mitigate
40
+
41
+ - **Immediate actions:** Rollback last deploy, disable feature flag, revert config, scale up, or apply hotfix.
42
+ - **Verification:** Confirm mitigation works — error rate drops, affected flow recovers.
43
+ - **Communication:** Notify stakeholders if P0/P1. Document status in incident channel or issue.
44
+ - Do not spend time on perfect fixes during active incident — stabilize first.
45
+
46
+ ## Step 4: Root Cause Analysis
47
+
48
+ - Trace the failure chain: what changed, what failed, why.
49
+ - Review logs (correlationId, userId), metrics, deploy history.
50
+ - Check ADRs in project docs for architectural context.
51
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
52
+
53
+ ## Step 5: Post-Mortem
54
+
55
+ Write a structured post-mortem document:
56
+
57
+ - **Summary:** One-paragraph description of the incident.
58
+ - **Timeline:** Key events (detection, mitigation, resolution) with timestamps.
59
+ - **Root cause:** What went wrong and why.
60
+ - **Impact:** Users affected, duration, business impact.
61
+ - **Action items:** Permanent fixes, preventive measures, process improvements.
62
+ - **Lessons learned:** What we'll do differently.
63
+
64
+ Store in project incident docs or as a GitHub issue/wiki page. Follow project conventions.
65
+
66
+ ## Step 6: Follow-Up Issues
67
+
68
+ - Create GitHub issues for each action item from the post-mortem.
69
+ - Label appropriately (e.g., `incident-follow-up`, `P0`, `P1`).
70
+ - Link issues to the post-mortem and to each other.
71
+ - Assign owners and due dates for critical fixes.
72
+ - Use **GitHub MCP** (`issue_create` or equivalent) to create issues.
73
+
74
+ ## Definition of Done
75
+
76
+ - [ ] Incident mitigated and verified
77
+ - [ ] Post-mortem written with timeline, root cause, and action items
78
+ - [ ] Follow-up issues created for permanent fixes and preventive measures
79
+ - [ ] Stakeholders notified (if P0/P1)
80
+ - [ ] No sensitive data (secrets, PII, code content) in post-mortem or logs
81
+
82
+ ## Additional Resources
83
+
84
+ - Privacy/security specs: project documentation
85
+ - Observability: project logging and correlation conventions
86
+ - Error handling: project error handling patterns
@@ -0,0 +1,139 @@
1
+ ---
2
+ id: hatch3r-issue-workflow
3
+ description: Guides the 8-step agentic development workflow for GitHub issues. Covers parsing issues, loading skills, reading specs, planning, implementing, testing, opening PRs, and addressing review. Use when working on any GitHub issue or when the user mentions an issue number.
4
+ ---
5
+ # Issue Workflow
6
+
7
+ ## Quick Start
8
+
9
+ When assigned a GitHub issue, follow these 8 steps in order:
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Parse the issue
14
+ - [ ] Step 2: Load the issue-type skill
15
+ - [ ] Step 3: Read relevant specs
16
+ - [ ] Step 4: Produce a plan
17
+ - [ ] Step 5: Implement
18
+ - [ ] Step 6: Test
19
+ - [ ] Step 6b: Browser verification (if UI)
20
+ - [ ] Step 7: Open PR
21
+ - [ ] Step 8: Address review
22
+ ```
23
+
24
+ ## Step 1: Parse the Issue
25
+
26
+ - Read all fields from the issue template.
27
+ - Identify: type (bug/feature/refactor/qa), affected area, priority, acceptance criteria.
28
+ - Note linked issues and spec references.
29
+
30
+ ## Step 2: Load the Issue-Type Skill
31
+
32
+ Navigate to the matching skill based on issue type:
33
+
34
+ | Issue Type | Skill |
35
+ | ----------------- | ------------------------ |
36
+ | Bug report | hatch3r-bug-fix |
37
+ | Feature request | hatch3r-feature |
38
+ | Code refactor | hatch3r-refactor |
39
+ | Logical refactor | hatch3r-logical-refactor |
40
+ | Visual refactor | hatch3r-visual-refactor |
41
+ | QA E2E validation | hatch3r-qa-validation |
42
+
43
+ ## Step 3: Read Relevant Specs
44
+
45
+ Load only the specs relevant to the issue area. See the spec mapping table in the project context rule.
46
+
47
+ Also check project ADRs for architectural constraints.
48
+
49
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
50
+
51
+ ## Step 4: Produce a Plan
52
+
53
+ Output a structured plan before writing code:
54
+
55
+ - **Approach:** strategy
56
+ - **Files to touch:** list with brief description per file
57
+ - **Tests to write:** list
58
+ - **Risks:** what could go wrong
59
+ - **Open questions:** if any, propose answers
60
+
61
+ ## Step 4b: Sub-Agent Delegation
62
+
63
+ Every issue MUST be delegated to a dedicated `hatch3r-implementer` sub-agent — never implement inline. The board-pickup command orchestrates this automatically, but if running issue-workflow standalone, follow the pattern below.
64
+
65
+ ### Single Issue
66
+
67
+ Spawn one `hatch3r-implementer` sub-agent via the Task tool. Include: issue number, body, acceptance criteria, issue type, researcher output, and spec references. Await the result.
68
+
69
+ ### Epic with Sub-Issues
70
+
71
+ 1. **Group sub-issues by dependency level** from the epic's Implementation Order.
72
+ 2. **Spawn one implementer sub-agent per sub-issue** using the Task tool. Include: issue number, body, acceptance criteria, issue type, parent epic context, and spec references.
73
+ 3. **Launch sub-issues at the same dependency level in parallel** — as many concurrently as the platform supports.
74
+ 4. **Await all sub-agents at a level** before starting the next level.
75
+ 5. **Review results** from each sub-agent. Resolve any file conflicts between parallel outputs.
76
+
77
+ ### Multiple Standalone Issues (Batch)
78
+
79
+ When working on multiple standalone issues (not part of an epic), apply the same parallel pattern:
80
+
81
+ 1. **Group issues by dependency level.** Independent issues (no mutual dependencies) share the same level and run in parallel.
82
+ 2. **Spawn one researcher sub-agent per issue** in parallel — as many concurrently as the platform supports. Each issue gets individual context gathering since standalone issues are unrelated.
83
+ 3. **Spawn one implementer sub-agent per issue per level** in parallel — as many concurrently as the platform supports. Each receives its own researcher output.
84
+ 4. **Await all sub-agents at a level** before starting the next level.
85
+ 5. **Review results** from each sub-agent. Resolve any cross-issue file conflicts.
86
+
87
+ ### Plain Chat with Multiple Tasks
88
+
89
+ When working from plain chat instructions with multiple tasks (numbered lists, multiple issue references, or distinct requests), parse into discrete tasks and apply the batch delegation pattern above. For GitHub issue references, fetch issue details. For natural language tasks, derive title, acceptance criteria, and type from the instruction.
90
+
91
+ The implementer sub-agent protocol is defined in the hatch3r-implementer agent. Each sub-agent handles its own implementation and testing but does NOT create branches, commits, or PRs.
92
+
93
+ ## Step 5: Implement
94
+
95
+ - Follow the plan. Use stable IDs from the project glossary.
96
+ - Do not expand scope beyond acceptance criteria.
97
+ - Remove dead code. Keep changes minimal and focused.
98
+
99
+ ## Step 6: Test
100
+
101
+ - Unit tests for new logic. Integration tests for cross-module interactions.
102
+ - Database/security rules tests if rules changed.
103
+ - Regression tests for preserved behavior.
104
+ - All tests must be deterministic, isolated, and fast.
105
+
106
+ ## Step 6b: Browser Verification (if UI)
107
+
108
+ Skip this step if the issue has no user-facing UI changes.
109
+
110
+ - Ensure the dev server is running. If not, start it in the background.
111
+ - Navigate to the page or surface affected by the change.
112
+ - Visually confirm the implementation matches acceptance criteria from the issue.
113
+ - Interact with changed elements to verify functional correctness.
114
+ - Check the browser console for errors or warnings.
115
+ - Capture screenshots as evidence for the PR.
116
+
117
+ ## Step 7: Open PR
118
+
119
+ - Use the project's PR template. Fill every section.
120
+ - Link to the issue. Include plan, implementation summary, test evidence.
121
+ - **Base branch:** Use `board.defaultBranch` from `/.agents/hatch.json` when creating PRs (fallback: `"main"`). Use `gh pr create --base {defaultBranch}` or equivalent.
122
+ - Self-review against the Definition of Done from the loaded skill.
123
+
124
+ ## Step 8: Address Review
125
+
126
+ - Respond to every review comment.
127
+ - Push fixes as new commits (don't force-push during review).
128
+ - Re-request review after addressing all comments.
129
+
130
+ ## Escalation
131
+
132
+ Stop and ask when:
133
+
134
+ 1. Acceptance criteria are contradictory.
135
+ 2. Security concern discovered.
136
+ 3. Architectural decision needed (new ADR required).
137
+ 4. Spec conflict found.
138
+ 5. Scope creep detected.
139
+ 6. Test infrastructure missing.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: hatch3r-logical-refactor
3
+ description: Workflow for changing behavior or logic flow without adding new features or overhauling UI. Use when modifying business logic, data flows, behavioral rules, or working on logical refactor issues.
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
+ # Logical 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 change plan
15
+ - [ ] Step 3: Implement the behavior change
16
+ - [ ] Step 4: Update tests and verify invariants
17
+ - [ ] Step 5: Open PR
18
+ ```
19
+
20
+ ## Step 1: Read Inputs
21
+
22
+ - Parse the issue body: motivation, before/after behavior, invariants preserved, invariants changed, acceptance criteria, affected files, risk analysis, testing plan.
23
+ - Read relevant project documentation: behavior engine, event model, data model, privacy, quality.
24
+ - Review existing tests to understand what behavior is currently asserted.
25
+ - For external library docs and current best practices, follow the project's tooling hierarchy.
26
+
27
+ ## Step 2: Change Plan
28
+
29
+ Before modifying code, output:
30
+
31
+ - **Current behavior:** how it works now
32
+ - **New behavior:** how it will work after
33
+ - **Invariants preserved:** list from issue + specs
34
+ - **Invariants changed:** list, with justification
35
+ - **Cascading effects:** which other flows/components are affected
36
+ - **Files to modify:** list with what changes
37
+ - **Risks:** what could go wrong
38
+
39
+ ## Step 3: Implement
40
+
41
+ - Implement behavior change as described in the before/after section.
42
+ - Verify every listed invariant is maintained (or explicitly updated with justification).
43
+ - Update any spec docs affected by the behavior change.
44
+
45
+ ## Step 4: Test
46
+
47
+ - **Update existing tests** that assert old behavior to assert new behavior.
48
+ - **Add new tests** for the new behavior, especially edge cases.
49
+ - **Regression tests** for preserved invariants.
50
+ - **Integration tests** if change affects cross-module interactions.
51
+
52
+ ```bash
53
+ npm run lint && npm run typecheck && npm run test
54
+ ```
55
+
56
+ ## Step 5: Open PR
57
+
58
+ Use the project's PR template. Include:
59
+
60
+ - Before/after behavior with concrete examples
61
+ - Invariants preserved and changed
62
+ - Test evidence for both new behavior and preserved behavior
63
+ - Spec docs updated (if any)
64
+
65
+ ## Definition of Done
66
+
67
+ - [ ] New behavior matches the "after" description
68
+ - [ ] All preserved invariants verified with tests
69
+ - [ ] Changed invariants documented and justified
70
+ - [ ] Existing tests updated, new tests added
71
+ - [ ] Performance budgets maintained
72
+ - [ ] Privacy/security invariants respected
73
+ - [ ] Spec docs updated if behavior diverges from spec
@@ -0,0 +1,76 @@
1
+ ---
2
+ id: hatch3r-migration
3
+ type: skill
4
+ description: Plan and execute migrations for databases, frameworks, and dependencies. Covers breaking change analysis, phased rollout, and rollback procedures.
5
+ ---
6
+
7
+ # Migration Workflow
8
+
9
+ ## Quick Start
10
+
11
+ ```
12
+ Task Progress:
13
+ - [ ] Step 1: Assess migration scope
14
+ - [ ] Step 2: Analyze breaking changes
15
+ - [ ] Step 3: Create migration plan
16
+ - [ ] Step 4: Execute migration phases
17
+ - [ ] Step 5: Validate and verify
18
+ - [ ] Step 6: Document and clean up
19
+ ```
20
+
21
+ ## Step 1: Assess Migration Scope
22
+
23
+ - Identify the migration type: database schema, framework version, dependency upgrade, language version, or infrastructure change.
24
+ - Inventory all affected files, modules, and services.
25
+ - Check for transitive dependency impacts — upgrading one package may force others.
26
+ - Review the target version's changelog, migration guide, and known issues.
27
+ - Estimate effort and risk level (low/medium/high) based on scope.
28
+
29
+ ## Step 2: Analyze Breaking Changes
30
+
31
+ - Compare current vs target API surfaces for changed/removed features.
32
+ - Search the codebase for usage of deprecated or removed APIs.
33
+ - For database migrations: identify schema changes, data transformations, and index impacts.
34
+ - For framework upgrades: check configuration format changes, plugin compatibility, and behavioral differences.
35
+ - Document each breaking change with affected file locations and required code modifications.
36
+
37
+ ## Step 3: Create Migration Plan
38
+
39
+ - Define phases with clear boundaries — each phase should be independently deployable and rollback-safe.
40
+ - Phase ordering: compatibility layer first, then consumer migration, then removal of old code.
41
+ - For database migrations: write both `up` and `down` migration scripts. Test both directions.
42
+ - Include a rollback plan for each phase with specific steps and time estimates.
43
+ - Set validation criteria for each phase before proceeding to the next.
44
+
45
+ ## Step 4: Execute Migration Phases
46
+
47
+ - Implement one phase at a time. Verify before proceeding.
48
+ - For dependency upgrades: update lockfile, fix type errors, update API calls, run tests.
49
+ - For database migrations: run against a staging copy first, verify data integrity, measure execution time.
50
+ - For framework migrations: use codemods where available, manual fixes where not.
51
+ - Keep backward compatibility during transition — both old and new code paths should work.
52
+
53
+ ## Step 5: Validate and Verify
54
+
55
+ - Run the full test suite after each phase.
56
+ - For database migrations: verify row counts, check constraint integrity, test queries against migrated data.
57
+ - For dependency upgrades: verify bundle size impact, check for runtime behavior changes.
58
+ - Performance benchmark critical paths before and after.
59
+ - Test rollback procedure on a staging environment.
60
+
61
+ ## Step 6: Document and Clean Up
62
+
63
+ - Remove compatibility shims and old code paths after the migration is complete.
64
+ - Update project documentation (README, setup guides, deployment docs).
65
+ - Update CI configuration if build steps changed.
66
+ - Delete unused migration scripts after they've been applied to all environments.
67
+ - Write a migration retrospective noting what went well and any issues encountered.
68
+
69
+ ## Definition of Done
70
+
71
+ - [ ] All phases completed and verified
72
+ - [ ] Full test suite passes
73
+ - [ ] Rollback procedure tested
74
+ - [ ] No backward-compatibility shims remain
75
+ - [ ] Documentation updated
76
+ - [ ] Performance verified against baseline