hatch3r 1.7.1 → 1.7.5

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 (150) hide show
  1. package/README.md +37 -11
  2. package/agents/hatch3r-a11y-auditor.md +4 -0
  3. package/agents/hatch3r-architect.md +4 -0
  4. package/agents/hatch3r-ci-watcher.md +4 -0
  5. package/agents/hatch3r-context-rules.md +4 -0
  6. package/agents/hatch3r-creator.md +4 -0
  7. package/agents/hatch3r-dependency-auditor.md +4 -0
  8. package/agents/hatch3r-devops.md +4 -0
  9. package/agents/hatch3r-docs-writer.md +4 -0
  10. package/agents/hatch3r-fixer.md +4 -0
  11. package/agents/hatch3r-handoff-loader.md +243 -0
  12. package/agents/hatch3r-handoff-preparer.md +134 -0
  13. package/agents/hatch3r-implementer.md +4 -0
  14. package/agents/hatch3r-learnings-loader.md +4 -0
  15. package/agents/hatch3r-lint-fixer.md +4 -0
  16. package/agents/hatch3r-perf-profiler.md +8 -0
  17. package/agents/hatch3r-researcher.md +4 -0
  18. package/agents/hatch3r-reviewer.md +92 -0
  19. package/agents/hatch3r-security-auditor.md +24 -0
  20. package/agents/hatch3r-test-writer.md +4 -0
  21. package/agents/modes/requirements-elicitation.md +4 -1
  22. package/agents/modes/similar-implementation.md +6 -0
  23. package/agents/modes/user-flows.md +76 -0
  24. package/agents/shared/quality-charter.md +128 -0
  25. package/commands/hatch3r-board-fill.md +1 -0
  26. package/commands/hatch3r-create.md +2 -0
  27. package/commands/hatch3r-handoff.md +126 -0
  28. package/commands/hatch3r-pr-resolve.md +4 -0
  29. package/commands/hatch3r-quick-change.md +4 -2
  30. package/commands/hatch3r-workflow.md +2 -0
  31. package/dist/cli/index.js +2321 -460
  32. package/dist/cli/index.js.map +1 -1
  33. package/package.json +4 -2
  34. package/rules/hatch3r-accessibility-standards.md +21 -0
  35. package/rules/hatch3r-accessibility-standards.mdc +21 -0
  36. package/rules/hatch3r-agent-orchestration.md +9 -1
  37. package/rules/hatch3r-agent-orchestration.mdc +9 -1
  38. package/rules/hatch3r-ai-evals.md +158 -0
  39. package/rules/hatch3r-ai-evals.mdc +154 -0
  40. package/rules/hatch3r-ai-ux-patterns.md +131 -0
  41. package/rules/hatch3r-ai-ux-patterns.mdc +127 -0
  42. package/rules/hatch3r-api-design.md +67 -9
  43. package/rules/hatch3r-api-design.mdc +67 -9
  44. package/rules/hatch3r-api-versioning.md +119 -0
  45. package/rules/hatch3r-api-versioning.mdc +115 -0
  46. package/rules/hatch3r-auth-patterns.md +170 -0
  47. package/rules/hatch3r-auth-patterns.mdc +166 -0
  48. package/rules/hatch3r-component-conventions.md +30 -0
  49. package/rules/hatch3r-component-conventions.mdc +30 -0
  50. package/rules/hatch3r-container-hardening.md +131 -0
  51. package/rules/hatch3r-container-hardening.mdc +127 -0
  52. package/rules/hatch3r-contract-testing.md +117 -0
  53. package/rules/hatch3r-contract-testing.mdc +113 -0
  54. package/rules/hatch3r-deep-context.md +2 -0
  55. package/rules/hatch3r-deep-context.mdc +2 -0
  56. package/rules/hatch3r-dependency-management.md +73 -1
  57. package/rules/hatch3r-dependency-management.mdc +72 -0
  58. package/rules/hatch3r-design-system-detection.md +142 -0
  59. package/rules/hatch3r-design-system-detection.mdc +138 -0
  60. package/rules/hatch3r-event-schema-evolution.md +90 -0
  61. package/rules/hatch3r-event-schema-evolution.mdc +86 -0
  62. package/rules/hatch3r-handoff-readiness.md +45 -0
  63. package/rules/hatch3r-handoff-readiness.mdc +40 -0
  64. package/rules/hatch3r-i18n.md +13 -0
  65. package/rules/hatch3r-i18n.mdc +13 -0
  66. package/rules/hatch3r-migrations.md +61 -16
  67. package/rules/hatch3r-migrations.mdc +61 -16
  68. package/rules/hatch3r-observability-logging.md +1 -1
  69. package/rules/hatch3r-observability-logging.mdc +1 -1
  70. package/rules/hatch3r-observability-metrics.md +1 -1
  71. package/rules/hatch3r-observability-metrics.mdc +1 -1
  72. package/rules/hatch3r-observability-tracing-detail.md +1 -1
  73. package/rules/hatch3r-observability-tracing-detail.mdc +1 -1
  74. package/rules/hatch3r-observability-tracing.md +1 -1
  75. package/rules/hatch3r-observability-tracing.mdc +1 -1
  76. package/rules/hatch3r-observability.md +1 -0
  77. package/rules/hatch3r-observability.mdc +1 -0
  78. package/rules/hatch3r-operability.md +149 -0
  79. package/rules/hatch3r-operability.mdc +145 -0
  80. package/rules/hatch3r-passkey-server.md +181 -0
  81. package/rules/hatch3r-passkey-server.mdc +177 -0
  82. package/rules/hatch3r-progressive-delivery.md +120 -0
  83. package/rules/hatch3r-progressive-delivery.mdc +116 -0
  84. package/rules/hatch3r-resilience-patterns.md +154 -0
  85. package/rules/hatch3r-resilience-patterns.mdc +150 -0
  86. package/rules/hatch3r-secrets-management.md +29 -0
  87. package/rules/hatch3r-secrets-management.mdc +29 -0
  88. package/rules/hatch3r-testing.md +139 -43
  89. package/rules/hatch3r-testing.mdc +139 -43
  90. package/rules/hatch3r-ux-states-and-flows.md +149 -0
  91. package/rules/hatch3r-ux-states-and-flows.mdc +145 -0
  92. package/skills/hatch3r-a11y-audit/SKILL.md +14 -0
  93. package/skills/hatch3r-ai-feature/SKILL.md +134 -0
  94. package/skills/hatch3r-api-spec/SKILL.md +5 -0
  95. package/skills/hatch3r-architecture-review/SKILL.md +14 -0
  96. package/skills/hatch3r-bug-fix/SKILL.md +5 -0
  97. package/skills/hatch3r-ci-pipeline/SKILL.md +14 -0
  98. package/skills/hatch3r-cli-aichat/SKILL.md +84 -0
  99. package/skills/hatch3r-cli-ast-grep/SKILL.md +85 -0
  100. package/skills/hatch3r-cli-az-devops/SKILL.md +89 -0
  101. package/skills/hatch3r-cli-bat/SKILL.md +85 -0
  102. package/skills/hatch3r-cli-comby/SKILL.md +85 -0
  103. package/skills/hatch3r-cli-csvkit/SKILL.md +84 -0
  104. package/skills/hatch3r-cli-delta/SKILL.md +86 -0
  105. package/skills/hatch3r-cli-difftastic/SKILL.md +84 -0
  106. package/skills/hatch3r-cli-docker/SKILL.md +89 -0
  107. package/skills/hatch3r-cli-duckdb/SKILL.md +84 -0
  108. package/skills/hatch3r-cli-fd/SKILL.md +85 -0
  109. package/skills/hatch3r-cli-fzf/SKILL.md +84 -0
  110. package/skills/hatch3r-cli-gh/SKILL.md +90 -0
  111. package/skills/hatch3r-cli-glab/SKILL.md +89 -0
  112. package/skills/hatch3r-cli-jq/SKILL.md +85 -0
  113. package/skills/hatch3r-cli-lazygit/SKILL.md +78 -0
  114. package/skills/hatch3r-cli-llm/SKILL.md +84 -0
  115. package/skills/hatch3r-cli-miller/SKILL.md +84 -0
  116. package/skills/hatch3r-cli-mods/SKILL.md +84 -0
  117. package/skills/hatch3r-cli-overview/SKILL.md +60 -0
  118. package/skills/hatch3r-cli-playwright/SKILL.md +89 -0
  119. package/skills/hatch3r-cli-podman/SKILL.md +84 -0
  120. package/skills/hatch3r-cli-ripgrep/SKILL.md +85 -0
  121. package/skills/hatch3r-cli-rtk/SKILL.md +91 -0
  122. package/skills/hatch3r-cli-sd/SKILL.md +85 -0
  123. package/skills/hatch3r-cli-stagehand/SKILL.md +79 -0
  124. package/skills/hatch3r-cli-taplo/SKILL.md +84 -0
  125. package/skills/hatch3r-cli-xsv/SKILL.md +89 -0
  126. package/skills/hatch3r-cli-yq/SKILL.md +85 -0
  127. package/skills/hatch3r-cli-zstd/SKILL.md +85 -0
  128. package/skills/hatch3r-context-health/SKILL.md +14 -0
  129. package/skills/hatch3r-cost-tracking/SKILL.md +14 -0
  130. package/skills/hatch3r-customize/SKILL.md +14 -0
  131. package/skills/hatch3r-dep-audit/SKILL.md +14 -0
  132. package/skills/hatch3r-design-system-detect/SKILL.md +162 -0
  133. package/skills/hatch3r-feature/SKILL.md +2 -0
  134. package/skills/hatch3r-gh-agentic-workflows/SKILL.md +13 -0
  135. package/skills/hatch3r-handoff-prepare/SKILL.md +160 -0
  136. package/skills/hatch3r-handoff-resume/SKILL.md +171 -0
  137. package/skills/hatch3r-incident-response/SKILL.md +14 -0
  138. package/skills/hatch3r-issue-workflow/SKILL.md +5 -0
  139. package/skills/hatch3r-logical-refactor/SKILL.md +14 -0
  140. package/skills/hatch3r-migration/SKILL.md +14 -0
  141. package/skills/hatch3r-observability-verify/SKILL.md +133 -0
  142. package/skills/hatch3r-perf-audit/SKILL.md +14 -0
  143. package/skills/hatch3r-pr-creation/SKILL.md +14 -0
  144. package/skills/hatch3r-qa-validation/SKILL.md +18 -0
  145. package/skills/hatch3r-recipe/SKILL.md +14 -0
  146. package/skills/hatch3r-refactor/SKILL.md +14 -0
  147. package/skills/hatch3r-release/SKILL.md +14 -0
  148. package/skills/hatch3r-reliability-verify/SKILL.md +144 -0
  149. package/skills/hatch3r-ui-ux-verify/SKILL.md +136 -0
  150. package/skills/hatch3r-visual-refactor/SKILL.md +15 -1
@@ -0,0 +1,126 @@
1
+ ---
2
+ id: hatch3r-handoff
3
+ type: command
4
+ orchestrator: true
5
+ agentPipeline: [hatch3r-handoff-preparer]
6
+ description: Prepare, resume, list, complete, and prune cross-session handoff documents.
7
+ tags: [core, maintenance]
8
+ quality_charter: agents/shared/quality-charter.md
9
+ efficiency_patterns: agents/shared/efficiency-patterns.md
10
+ cache_friendly: true
11
+ parallel_tool_default: true
12
+ triage_tiers: [1, 2]
13
+ ---
14
+
15
+ ## Agent Pipeline
16
+
17
+ The `prepare` subcommand delegates to `hatch3r-handoff-preparer` via the Task tool. The other four subcommands (`resume`, `list`, `complete`, `prune`) run inline within this command — they read, list, transition status, or archive files and do not require a sub-agent.
18
+
19
+ ## Learnings Consultation
20
+
21
+ Before starting, scan `.agents/learnings/` for entries tagged `handoff`, `context-switch`, `resume`, or `session-state`. Apply the protocol in `rules/hatch3r-learning-consult.md` (frontmatter-first scan; surface top 5 by confidence). Skip if the directory has fewer than 3 files.
22
+
23
+ # Handoff Management — Cross-Session Work Continuity
24
+
25
+ Manage canonical handoff documents at `.agents/handoffs/active/` for mid-work state capture and resumption across sessions, tools, or developers.
26
+
27
+ ---
28
+
29
+ ## Step 0: Triage
30
+
31
+ Classify the handoff request by subcommand and operation size before routing:
32
+
33
+ - **Tier 1 (trivial)**: `list`, `complete`, `prune --dry-run`. Filesystem-read or single-file rename; no body composition, no validation gate, no sub-agent. Run inline.
34
+ - **Tier 2 (standard)**: `prepare`, `resume`, `prune` (non-dry-run). Body composition with readiness gate (`prepare`), drift check + status transition (`resume`), or batch archival (`prune`). `prepare` delegates to `hatch3r-handoff-preparer` via the Task tool; the others run inline.
35
+
36
+ There is no Tier 3 for this command — multi-issue or epic-scale handoffs are out of scope; the caller decomposes into per-work-item handoffs upstream.
37
+
38
+ ## Workflow
39
+
40
+ Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with **ASK**.
41
+
42
+ ### Step 1: Detect Subcommand
43
+
44
+ Read the first positional argument and route to the matching subcommand. If absent or unrecognized:
45
+
46
+ **ASK:** "Which handoff action? `prepare | resume | list | complete | prune`."
47
+
48
+ ### Step 2: Route
49
+
50
+ | Subcommand | Semantics |
51
+ |------------|-----------|
52
+ | `prepare` | Capture current session state into a new handoff document |
53
+ | `resume` | Load and surface a previously-prepared handoff for continuation |
54
+ | `list` | Show active (and optionally archived) handoffs in a table |
55
+ | `complete`| Transition a handoff to `completed` and move to `archived/` |
56
+ | `prune` | Archive expired actives and prune archives older than 90 days |
57
+
58
+ ---
59
+
60
+ ## Subcommand: prepare
61
+
62
+ 1. Parse optional flags: `--work-item <ref>` (e.g. `gh:owner/repo#42`, `ado:org/project:work-item/123`, `gl:owner/repo!42`), `--summary "<text>"`.
63
+ 2. Invoke `hatch3r-handoff-preparer` via the Task tool. Pass `work_item` and `summary` if provided.
64
+ 3. The preparer returns the written path plus an Iteration Summary block. Surface both to the user.
65
+
66
+ **ASK** (before invocation): "Capturing handoff for {current branch}. Confirm or specify `--work-item` / `--summary`."
67
+
68
+ ## Subcommand: resume
69
+
70
+ 1. Parse optional `<id>` positional. If provided, route directly to `skills/hatch3r-handoff-resume` with that id.
71
+ 2. If `<id>` absent, call `listHandoffs({ status: ["open","in-progress","blocked","handed-off"] })` from `src/content/handoffs/index.ts` and present a numbered table (id, status, branch, summary, updated).
72
+
73
+ **ASK:** "Which handoff to resume? (number, or `cancel`)"
74
+
75
+ 3. Invoke `skills/hatch3r-handoff-resume` with the chosen id. The skill performs validation, drift check, and status transition.
76
+
77
+ ## Subcommand: list
78
+
79
+ 1. Parse flags: `--status <status>`, `--work-item <ref>`, `--include-archived`.
80
+ 2. Call `listHandoffs(filter)` and render:
81
+
82
+ ```
83
+ ID STATUS BRANCH SUMMARY UPDATED
84
+ 2026-05-17_T1430_a3f2c_issue-42-cache-refactor in-progress feat/cache-refactor Token caching for board-fill researcher 2026-05-17 14:30
85
+ ```
86
+
87
+ 3. If empty, display: `No active handoffs. Run 'hatch3r-handoff prepare' to capture one.`
88
+
89
+ ## Subcommand: complete
90
+
91
+ 1. Parse positional `<id>` (required). If absent, **ASK** the user to pick from `list`.
92
+ 2. Read the handoff via `readHandoff(id)`. Display the `summary` and `Work Remaining` section.
93
+ 3. Parse optional `--reason "<text>"` for the archival notice.
94
+
95
+ **ASK:** "Mark `{id}` completed and archive? (y/N). Reason will be recorded: `{reason or 'no reason given'}`."
96
+
97
+ 4. On confirm: transition `status` to `completed`, stamp `updated` to now, prepend the archival notice (mirrors learnings archival format), then atomic-rename to `.agents/handoffs/archived/<id>.md`.
98
+
99
+ ## Subcommand: prune
100
+
101
+ 1. Parse `--dry-run` flag.
102
+ 2. Scan `.agents/handoffs/active/`: collect entries whose `expires_after` ISO-8601 timestamp is at-or-before now (preparer default stamps `created + 30 days`).
103
+ 3. Scan `.agents/handoffs/archived/`: collect entries where `updated` is older than 90 days.
104
+ 4. Present a two-section preview (Active expirations to archive, Archives to delete).
105
+ 5. If `--dry-run`: print the preview and exit.
106
+
107
+ **ASK:** "Proceed with prune? Will archive {n} active and delete {m} archived. (y/N)"
108
+
109
+ 6. On confirm: archive each expired active (prepend `Expired on {date}` notice, move to `archived/`); delete each over-90-day archive.
110
+
111
+ ---
112
+
113
+ ## Error Handling
114
+
115
+ - `.agents/handoffs/active/` missing or empty: emit `No active handoffs. Run 'hatch3r-handoff prepare' to capture one.` and exit 0.
116
+ - Ambiguous `<id>` (multiple partial matches): list the matches and **ASK** the user to pick one.
117
+ - Write conflict (concurrent prepare for same `work_item`): surface the existing handoff path and **ASK** whether to overwrite (only if existing handoff is older than 24 hours per `writeHandoff` policy).
118
+ - `complete` or `prune` requested on a missing id: report the path that was looked up and suggest `hatch3r-handoff list`.
119
+
120
+ ## Guardrails
121
+
122
+ - **Never delete** a handoff without explicit user confirmation. Prune deletes only archives older than 90 days, and only after the confirm prompt.
123
+ - **Never modify** a file already in `.agents/handoffs/archived/`. Archived entries are immutable history.
124
+ - **Never include secrets** (API keys, tokens, credentials) in any handoff body. The preparer scans for credential-shaped strings; reject the write if any are detected.
125
+ - **Never write** outside `.agents/handoffs/active/` for new handoffs. Archival is the only path into `archived/`.
126
+ - **Always emit the Iteration Summary block** at the end of the iteration per `rules/hatch3r-iteration-summary.md`.
@@ -337,6 +337,8 @@ After Step 4 completes, recompute Step 0's tier using the now-known severities.
337
337
 
338
338
  ## Step 5: Triage Routing + ASK Checkpoint (only mutation gate)
339
339
 
340
+ **Tier-3 specialist mandate (P8 B2).** For Tier 3 PRs (6+ findings OR any Critical severity), the post-fix specialist pass (`hatch3r-test-writer`, `hatch3r-security-auditor`, `hatch3r-docs-writer`) MUST run in parallel. Specialists may NOT be deferred via "Needs your call" for cost reasons. Cost-dominance principle applies: token cost of specialist sub-agents is dominated by the quality gain of catching defects pre-merge.
341
+
340
342
  #### 5a. Apply Routing Heuristics
341
343
 
342
344
  | Severity | Confidence | Default Route |
@@ -381,6 +383,8 @@ NEEDS_CLARIFICATION ({n}):
381
383
  Needs your call ({n}):
382
384
  [7] @bob • inline src/cache.ts:88 • Important/Low → may be intentional eviction
383
385
 
386
+ Escalation for low-confidence accepted findings: trigger a mandatory `hatch3r-security-auditor` pass if any are security-adjacent (auth, crypto, input validation, access control, secret handling); otherwise flag in commit message for elevated reviewer attention.
387
+
384
388
  DEFER (cosmetic, with reply) ({n}):
385
389
  [8] @eve • inline src/auth.ts:55 • Cosmetic/Medium → naming nitpick
386
390
 
@@ -130,9 +130,9 @@ Aggregate across the batch for total estimated scope.
130
130
 
131
131
  **Hard block — Tier 3 (Deep):** If any item scores Tier 3, quick-change is not appropriate.
132
132
 
133
- **ASK:** "This change scores Tier 3 (Deep complexity): {reason}. Quick-change does not provide the research depth needed. Options: (a) switch to `hatch3r-workflow`, (b) narrow the scope."
133
+ **ASK:** "This change scores Tier 3 (Deep complexity): {reason}. Quick-change does not provide the research depth needed. Options: (a) switch to `/h4tcher-workflow`, (b) narrow the scope."
134
134
 
135
- Do NOT offer a "proceed anyway" option for Tier 3. The user must switch to workflow or narrow scope.
135
+ Do NOT offer a "proceed anyway" option for Tier 3. The user must switch to `/h4tcher-workflow` or narrow scope.
136
136
 
137
137
  **Soft guard — Tier 2 (Standard) or threshold triggers:** If any item scores Tier 2, or if any of these threshold triggers fire (any one is sufficient):
138
138
  - Estimated total exceeds **5 files**
@@ -140,6 +140,8 @@ Do NOT offer a "proceed anyway" option for Tier 3. The user must switch to workf
140
140
  - Changes touch security-sensitive areas
141
141
  - Changes require new dependencies or architectural decisions
142
142
 
143
+ **Threshold gate (P8 B2).** If any threshold trigger fires (>3 files, cross-module touch, schema change, or net new dependency), spawn the `hatch3r-researcher` with `requirements-elicitation:quick` mode IMMEDIATELY in Step 4b — do not defer research to discover scope creep mid-implementation. Tier-3 hard-block remains in effect.
144
+
143
145
  **ASK:** "This looks larger than a quick change: {reason}. Options: (a) proceed with lightweight research, (b) switch to `hatch3r-workflow` for full ceremony, (c) narrow the scope."
144
146
 
145
147
  If no threshold is triggered and all items are Tier 1, present the change list:
@@ -176,6 +176,8 @@ Task Analysis:
176
176
 
177
177
  **Goal:** Design the solution before implementing.
178
178
 
179
+ **Research-completeness directive (P8 B2).** If the Plan phase discovers unknowns not covered by Phase 1 research, spawn additional researcher modes before Phase 3 (Implementation). Do not defer research unknowns to implementation time. Spawning more researcher sub-agents is cheaper than discovered rework.
180
+
179
181
  #### 2a. Draft Implementation Plan
180
182
 
181
183
  1. List all files to create or modify.