hatch3r 1.2.0 → 1.4.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 (86) hide show
  1. package/README.md +38 -1
  2. package/agents/hatch3r-a11y-auditor.md +7 -14
  3. package/agents/hatch3r-architect.md +7 -14
  4. package/agents/hatch3r-ci-watcher.md +7 -13
  5. package/agents/hatch3r-context-rules.md +5 -10
  6. package/agents/hatch3r-dependency-auditor.md +10 -19
  7. package/agents/hatch3r-devops.md +7 -16
  8. package/agents/hatch3r-docs-writer.md +7 -14
  9. package/agents/hatch3r-fixer.md +2 -8
  10. package/agents/hatch3r-implementer.md +2 -8
  11. package/agents/hatch3r-learnings-loader.md +150 -21
  12. package/agents/hatch3r-lint-fixer.md +7 -12
  13. package/agents/hatch3r-perf-profiler.md +7 -14
  14. package/agents/hatch3r-researcher.md +7 -14
  15. package/agents/hatch3r-reviewer.md +7 -13
  16. package/agents/hatch3r-security-auditor.md +7 -15
  17. package/agents/hatch3r-test-writer.md +7 -14
  18. package/agents/modes/architecture.md +44 -0
  19. package/agents/modes/boundary-analysis.md +45 -0
  20. package/agents/modes/codebase-impact.md +81 -0
  21. package/agents/modes/complexity-risk.md +40 -0
  22. package/agents/modes/coverage-analysis.md +44 -0
  23. package/agents/modes/current-state.md +52 -0
  24. package/agents/modes/feature-design.md +39 -0
  25. package/agents/modes/impact-analysis.md +45 -0
  26. package/agents/modes/library-docs.md +31 -0
  27. package/agents/modes/migration-path.md +55 -0
  28. package/agents/modes/prior-art.md +31 -0
  29. package/agents/modes/refactoring-strategy.md +55 -0
  30. package/agents/modes/regression.md +45 -0
  31. package/agents/modes/requirements-elicitation.md +68 -0
  32. package/agents/modes/risk-assessment.md +41 -0
  33. package/agents/modes/risk-prioritization.md +43 -0
  34. package/agents/modes/root-cause.md +39 -0
  35. package/agents/modes/similar-implementation.md +70 -0
  36. package/agents/modes/symptom-trace.md +39 -0
  37. package/agents/modes/test-pattern.md +61 -0
  38. package/agents/shared/external-knowledge.md +32 -0
  39. package/agents/shared/quality-charter.md +78 -0
  40. package/commands/board/pickup-azure-devops.md +4 -0
  41. package/commands/board/pickup-delegation-multi.md +3 -0
  42. package/commands/board/pickup-delegation.md +3 -0
  43. package/commands/board/pickup-github.md +4 -0
  44. package/commands/board/pickup-gitlab.md +4 -0
  45. package/commands/board/pickup-post-impl.md +8 -1
  46. package/commands/board/shared-azure-devops.md +13 -3
  47. package/commands/board/shared-github.md +1 -0
  48. package/commands/board/shared-gitlab.md +9 -2
  49. package/commands/hatch3r-agent-customize.md +5 -1
  50. package/commands/hatch3r-board-groom.md +55 -2
  51. package/commands/hatch3r-board-init.md +5 -2
  52. package/commands/hatch3r-board-shared.md +62 -2
  53. package/commands/hatch3r-command-customize.md +4 -0
  54. package/commands/hatch3r-context-health.md +22 -2
  55. package/commands/hatch3r-cost-tracking.md +14 -0
  56. package/commands/hatch3r-hooks.md +1 -1
  57. package/commands/hatch3r-learn.md +68 -2
  58. package/commands/hatch3r-quick-change.md +29 -3
  59. package/commands/hatch3r-revision.md +136 -16
  60. package/commands/hatch3r-rule-customize.md +4 -0
  61. package/commands/hatch3r-skill-customize.md +4 -0
  62. package/commands/hatch3r-workflow.md +10 -1
  63. package/dist/cli/index.js +2528 -640
  64. package/dist/cli/index.js.map +1 -1
  65. package/package.json +12 -9
  66. package/rules/hatch3r-agent-orchestration-detail.md +159 -0
  67. package/rules/hatch3r-agent-orchestration-detail.mdc +156 -0
  68. package/rules/hatch3r-agent-orchestration.md +91 -318
  69. package/rules/hatch3r-agent-orchestration.mdc +127 -149
  70. package/rules/hatch3r-code-standards.mdc +10 -2
  71. package/rules/hatch3r-component-conventions.mdc +0 -1
  72. package/rules/hatch3r-deep-context.mdc +30 -8
  73. package/rules/hatch3r-dependency-management.mdc +17 -5
  74. package/rules/hatch3r-i18n.mdc +0 -1
  75. package/rules/hatch3r-migrations.mdc +12 -1
  76. package/rules/hatch3r-observability.mdc +289 -0
  77. package/rules/hatch3r-security-patterns.mdc +11 -0
  78. package/rules/hatch3r-testing.mdc +1 -1
  79. package/rules/hatch3r-theming.mdc +0 -1
  80. package/rules/hatch3r-tooling-hierarchy.mdc +18 -4
  81. package/skills/hatch3r-agent-customize/SKILL.md +4 -72
  82. package/skills/hatch3r-command-customize/SKILL.md +4 -62
  83. package/skills/hatch3r-customize/SKILL.md +117 -0
  84. package/skills/hatch3r-dep-audit/SKILL.md +1 -1
  85. package/skills/hatch3r-rule-customize/SKILL.md +4 -65
  86. package/skills/hatch3r-skill-customize/SKILL.md +4 -62
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hatch3r",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "Battle-tested agentic coding setup framework. One command to hatch your agent stack -- agents, skills, rules, commands, and MCP for every major AI coding tool.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -64,18 +64,21 @@
64
64
  "dependencies": {
65
65
  "boxen": "^8.0.1",
66
66
  "chalk": "^5.4.0",
67
- "commander": "^13.0.0",
68
- "inquirer": "^12.0.0",
67
+ "commander": "^14.0.3",
68
+ "inquirer": "^13.3.2",
69
69
  "ora": "^9.3.0",
70
- "yaml": "^2.7.0"
70
+ "yaml": "^2.8.3"
71
71
  },
72
72
  "devDependencies": {
73
- "@types/node": "^25.3.0",
74
- "@vitest/coverage-v8": "^3.2.4",
75
- "eslint": "^9.0.0",
73
+ "@types/node": "^25.5.0",
74
+ "@vitest/coverage-v8": "^4.1.2",
75
+ "eslint": "^10.1.0",
76
76
  "tsup": "^8.0.0",
77
77
  "typescript": "^5.7.0",
78
- "typescript-eslint": "^8.56.0",
79
- "vitest": "^3.0.0"
78
+ "typescript-eslint": "^8.57.2",
79
+ "vitest": "^4.1.2"
80
+ },
81
+ "overrides": {
82
+ "flatted": "^3.4.2"
80
83
  }
81
84
  }
@@ -0,0 +1,159 @@
1
+ ---
2
+ id: hatch3r-agent-orchestration-detail
3
+ type: rule
4
+ description: Extended orchestration reference — PipelineContext schemas, resilience protocols, observability integration, and auto-mode guardrails
5
+ scope: conditional
6
+ tags: [core]
7
+ ---
8
+ # Agent Orchestration — Extended Reference
9
+
10
+ This is the on-demand companion to `hatch3r-agent-orchestration`. Load when you need detailed schemas, failure handling protocols, or guardrail specifications.
11
+
12
+ ## PipelineContext Schema
13
+
14
+ The `PipelineContext` is the structured handoff object passed between pipeline phases. Each phase reads its inputs and writes its outputs to this context.
15
+
16
+ ```
17
+ PipelineContext {
18
+ correlationId: string // UUID v4, generated before Phase 1
19
+ taskType: "bug" | "feature" | "refactor" | "qa"
20
+ issueRef: string | null // Issue number or null for plain chat
21
+ deepContextTier: 1 | 2 | 3 // From hatch3r-deep-context scoring
22
+
23
+ // Phase 1 outputs (Research)
24
+ researchFindings: {
25
+ modes: string[] // Researcher modes used
26
+ affectedFiles: string[] // Files to create/modify/delete
27
+ blastRadius: string[] // Downstream consumers
28
+ existingTests: string[] // Test files covering affected code
29
+ dependencies: string[] // Internal + external dependencies
30
+ conventions: object | null // From similar-implementation mode
31
+ resolvedRequirements: object | null // From requirements-elicitation
32
+ }
33
+
34
+ // Phase 2 outputs (Implementation)
35
+ implementationResult: {
36
+ filesChanged: string[]
37
+ testsWritten: string[]
38
+ status: "SUCCESS" | "PARTIAL" | "FAILED"
39
+ reason: string | null
40
+ }
41
+
42
+ // Phase 3 outputs (Review)
43
+ reviewResult: {
44
+ iterations: number // 1-3
45
+ finalVerdict: "CLEAN" | "UNRESOLVED"
46
+ findings: ReviewFinding[]
47
+ confirmationPassResult: "PASS" | "FAIL"
48
+ }
49
+
50
+ // Phase 4 outputs (Quality)
51
+ qualityResults: {
52
+ specialists: SpecialistResult[]
53
+ validationPass: {
54
+ testsPass: boolean
55
+ typecheckPass: boolean
56
+ fixAttempts: number
57
+ regressionsPersist: boolean
58
+ }
59
+ }
60
+
61
+ // Metadata
62
+ startedAt: string // ISO-8601
63
+ completedAt: string | null
64
+ totalDuration: number | null // milliseconds
65
+ }
66
+ ```
67
+
68
+ ## Resilience and Failure Handling
69
+
70
+ ### Phase Failure Protocols
71
+
72
+ | Phase | Failure Mode | Protocol |
73
+ |-------|-------------|----------|
74
+ | Phase 1 (Research) | Researcher timeout | Proceed with partial findings; flag missing modes. |
75
+ | Phase 1 (Research) | No relevant findings | Surface to user; ask whether to proceed with implementation. |
76
+ | Phase 2 (Implementation) | Build/test failure | Attempt self-fix (max 2 iterations). Escalate to user if unresolved. |
77
+ | Phase 2 (Implementation) | Scope creep detected | Halt. Surface deviation to user. Resume only with approval. |
78
+ | Phase 3 (Review) | Max iterations (3) | Surface unresolved findings to user. Do not merge. |
79
+ | Phase 3 (Review) | Fixer introduces regressions | Revert fixer changes. Surface original findings + regression to user. |
80
+ | Phase 4 (Quality) | Specialist timeout | Log timeout. Continue with available results. Flag in output. |
81
+ | Phase 4 (Quality) | Validation pass fails | Spawn fixer (max 2 attempts). Surface if unresolved. |
82
+
83
+ ### Subagent Error Recovery
84
+
85
+ 1. **Timeout:** Forward partial output. Mark status `TIMEOUT`. Continue pipeline.
86
+ 2. **Crash/no output:** Mark status `FAILED`. Log reason. Continue if non-blocking.
87
+ 3. **Conflicting outputs:** When two specialists disagree (e.g., security vs performance), escalate to user with both positions.
88
+ 4. **Resource exhaustion:** If context window is exhausted, summarize prior context and continue with summary.
89
+
90
+ ### Retry Policies
91
+
92
+ - Subagent retries: 0 (spawn a new agent with adjusted prompt instead).
93
+ - Phase retries: Phase 3 review loop retries up to 3 iterations. All other phases: 0 retries (escalate to user).
94
+ - Never retry the same failed operation identically — adjust the prompt or approach.
95
+
96
+ ## Observability Integration
97
+
98
+ ### Structured Logging
99
+
100
+ All pipeline events should produce structured log entries when the project has observability infrastructure:
101
+
102
+ ```
103
+ {
104
+ "event": "pipeline.phase.start" | "pipeline.phase.end" | "subagent.spawn" | "subagent.complete",
105
+ "correlationId": "...",
106
+ "phase": 1-4,
107
+ "agent": "hatch3r-implementer",
108
+ "status": "SUCCESS" | "PARTIAL" | "FAILED" | "TIMEOUT",
109
+ "duration": 12345,
110
+ "metadata": {}
111
+ }
112
+ ```
113
+
114
+ ### Metrics to Track
115
+
116
+ | Metric | Description |
117
+ |--------|-------------|
118
+ | Pipeline duration | Total time from Phase 1 start to Phase 4 end |
119
+ | Phase duration | Time per phase |
120
+ | Review iterations | Number of Phase 3 review cycles |
121
+ | Specialist invocations | Count of Phase 4 specialists launched |
122
+ | Fix attempts | Number of fixer invocations across all phases |
123
+ | Failure rate | Proportion of tasks not reaching SUCCESS |
124
+
125
+ ### Correlation ID Propagation
126
+
127
+ The correlation ID generated before Phase 1 MUST be:
128
+ - Included in every subagent prompt
129
+ - Included in every structured log entry
130
+ - Included in every status report and output
131
+ - Used as the key for cross-referencing pipeline artifacts
132
+
133
+ ## Auto-Mode Guardrails
134
+
135
+ When operating in unattended/auto mode (no human in the loop), enforce these guardrails after each phase:
136
+
137
+ ### Scope Containment
138
+
139
+ - **File scope:** Only modify files identified in Phase 1 research + files discovered during implementation that are direct dependencies. No drive-by refactors.
140
+ - **Dependency scope:** Do not add new external dependencies without explicit approval.
141
+ - **Destructive operations:** Never execute `rm -rf`, `DROP TABLE`, force push, or other destructive operations in auto mode. Queue for human review.
142
+
143
+ ### Output Schema Compliance
144
+
145
+ After each phase, validate that the output conforms to the expected PipelineContext schema fields. Missing required fields trigger a HALT.
146
+
147
+ ### Escalation Triggers
148
+
149
+ Auto-mode MUST halt and surface to user when:
150
+ 1. A CRITICAL finding is detected in Phase 3.
151
+ 2. Phase 4 validation pass fails after 2 fix attempts.
152
+ 3. Any specialist reports FAILED status.
153
+ 4. Scope containment violation detected.
154
+ 5. Implementation touches more than 20 files (may indicate scope creep).
155
+
156
+ ### Budget Guards
157
+
158
+ - **Token budget:** If cumulative subagent token usage exceeds 80% of estimated budget, surface to user before spawning additional agents.
159
+ - **Time budget:** If pipeline duration exceeds 2x the estimated time (based on deep context tier), surface status and request continuation approval.
@@ -0,0 +1,156 @@
1
+ ---
2
+ description: Extended orchestration reference — PipelineContext schemas, resilience protocols, observability integration, and auto-mode guardrails
3
+ alwaysApply: false
4
+ ---
5
+ # Agent Orchestration — Extended Reference
6
+
7
+ This is the on-demand companion to `hatch3r-agent-orchestration`. Load when you need detailed schemas, failure handling protocols, or guardrail specifications.
8
+
9
+ ## PipelineContext Schema
10
+
11
+ The `PipelineContext` is the structured handoff object passed between pipeline phases. Each phase reads its inputs and writes its outputs to this context.
12
+
13
+ ```
14
+ PipelineContext {
15
+ correlationId: string // UUID v4, generated before Phase 1
16
+ taskType: "bug" | "feature" | "refactor" | "qa"
17
+ issueRef: string | null // Issue number or null for plain chat
18
+ deepContextTier: 1 | 2 | 3 // From hatch3r-deep-context scoring
19
+
20
+ // Phase 1 outputs (Research)
21
+ researchFindings: {
22
+ modes: string[] // Researcher modes used
23
+ affectedFiles: string[] // Files to create/modify/delete
24
+ blastRadius: string[] // Downstream consumers
25
+ existingTests: string[] // Test files covering affected code
26
+ dependencies: string[] // Internal + external dependencies
27
+ conventions: object | null // From similar-implementation mode
28
+ resolvedRequirements: object | null // From requirements-elicitation
29
+ }
30
+
31
+ // Phase 2 outputs (Implementation)
32
+ implementationResult: {
33
+ filesChanged: string[]
34
+ testsWritten: string[]
35
+ status: "SUCCESS" | "PARTIAL" | "FAILED"
36
+ reason: string | null
37
+ }
38
+
39
+ // Phase 3 outputs (Review)
40
+ reviewResult: {
41
+ iterations: number // 1-3
42
+ finalVerdict: "CLEAN" | "UNRESOLVED"
43
+ findings: ReviewFinding[]
44
+ confirmationPassResult: "PASS" | "FAIL"
45
+ }
46
+
47
+ // Phase 4 outputs (Quality)
48
+ qualityResults: {
49
+ specialists: SpecialistResult[]
50
+ validationPass: {
51
+ testsPass: boolean
52
+ typecheckPass: boolean
53
+ fixAttempts: number
54
+ regressionsPersist: boolean
55
+ }
56
+ }
57
+
58
+ // Metadata
59
+ startedAt: string // ISO-8601
60
+ completedAt: string | null
61
+ totalDuration: number | null // milliseconds
62
+ }
63
+ ```
64
+
65
+ ## Resilience and Failure Handling
66
+
67
+ ### Phase Failure Protocols
68
+
69
+ | Phase | Failure Mode | Protocol |
70
+ |-------|-------------|----------|
71
+ | Phase 1 (Research) | Researcher timeout | Proceed with partial findings; flag missing modes. |
72
+ | Phase 1 (Research) | No relevant findings | Surface to user; ask whether to proceed with implementation. |
73
+ | Phase 2 (Implementation) | Build/test failure | Attempt self-fix (max 2 iterations). Escalate to user if unresolved. |
74
+ | Phase 2 (Implementation) | Scope creep detected | Halt. Surface deviation to user. Resume only with approval. |
75
+ | Phase 3 (Review) | Max iterations (3) | Surface unresolved findings to user. Do not merge. |
76
+ | Phase 3 (Review) | Fixer introduces regressions | Revert fixer changes. Surface original findings + regression to user. |
77
+ | Phase 4 (Quality) | Specialist timeout | Log timeout. Continue with available results. Flag in output. |
78
+ | Phase 4 (Quality) | Validation pass fails | Spawn fixer (max 2 attempts). Surface if unresolved. |
79
+
80
+ ### Subagent Error Recovery
81
+
82
+ 1. **Timeout:** Forward partial output. Mark status `TIMEOUT`. Continue pipeline.
83
+ 2. **Crash/no output:** Mark status `FAILED`. Log reason. Continue if non-blocking.
84
+ 3. **Conflicting outputs:** When two specialists disagree (e.g., security vs performance), escalate to user with both positions.
85
+ 4. **Resource exhaustion:** If context window is exhausted, summarize prior context and continue with summary.
86
+
87
+ ### Retry Policies
88
+
89
+ - Subagent retries: 0 (spawn a new agent with adjusted prompt instead).
90
+ - Phase retries: Phase 3 review loop retries up to 3 iterations. All other phases: 0 retries (escalate to user).
91
+ - Never retry the same failed operation identically — adjust the prompt or approach.
92
+
93
+ ## Observability Integration
94
+
95
+ ### Structured Logging
96
+
97
+ All pipeline events should produce structured log entries when the project has observability infrastructure:
98
+
99
+ ```
100
+ {
101
+ "event": "pipeline.phase.start" | "pipeline.phase.end" | "subagent.spawn" | "subagent.complete",
102
+ "correlationId": "...",
103
+ "phase": 1-4,
104
+ "agent": "hatch3r-implementer",
105
+ "status": "SUCCESS" | "PARTIAL" | "FAILED" | "TIMEOUT",
106
+ "duration": 12345,
107
+ "metadata": {}
108
+ }
109
+ ```
110
+
111
+ ### Metrics to Track
112
+
113
+ | Metric | Description |
114
+ |--------|-------------|
115
+ | Pipeline duration | Total time from Phase 1 start to Phase 4 end |
116
+ | Phase duration | Time per phase |
117
+ | Review iterations | Number of Phase 3 review cycles |
118
+ | Specialist invocations | Count of Phase 4 specialists launched |
119
+ | Fix attempts | Number of fixer invocations across all phases |
120
+ | Failure rate | Proportion of tasks not reaching SUCCESS |
121
+
122
+ ### Correlation ID Propagation
123
+
124
+ The correlation ID generated before Phase 1 MUST be:
125
+ - Included in every subagent prompt
126
+ - Included in every structured log entry
127
+ - Included in every status report and output
128
+ - Used as the key for cross-referencing pipeline artifacts
129
+
130
+ ## Auto-Mode Guardrails
131
+
132
+ When operating in unattended/auto mode (no human in the loop), enforce these guardrails after each phase:
133
+
134
+ ### Scope Containment
135
+
136
+ - **File scope:** Only modify files identified in Phase 1 research + files discovered during implementation that are direct dependencies. No drive-by refactors.
137
+ - **Dependency scope:** Do not add new external dependencies without explicit approval.
138
+ - **Destructive operations:** Never execute `rm -rf`, `DROP TABLE`, force push, or other destructive operations in auto mode. Queue for human review.
139
+
140
+ ### Output Schema Compliance
141
+
142
+ After each phase, validate that the output conforms to the expected PipelineContext schema fields. Missing required fields trigger a HALT.
143
+
144
+ ### Escalation Triggers
145
+
146
+ Auto-mode MUST halt and surface to user when:
147
+ 1. A CRITICAL finding is detected in Phase 3.
148
+ 2. Phase 4 validation pass fails after 2 fix attempts.
149
+ 3. Any specialist reports FAILED status.
150
+ 4. Scope containment violation detected.
151
+ 5. Implementation touches more than 20 files (may indicate scope creep).
152
+
153
+ ### Budget Guards
154
+
155
+ - **Token budget:** If cumulative subagent token usage exceeds 80% of estimated budget, surface to user before spawning additional agents.
156
+ - **Time budget:** If pipeline duration exceeds 2x the estimated time (based on deep context tier), surface status and request continuation approval.