hatch3r 1.7.0 → 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.
- package/README.md +38 -12
- package/agents/hatch3r-a11y-auditor.md +4 -0
- package/agents/hatch3r-architect.md +5 -1
- package/agents/hatch3r-ci-watcher.md +4 -0
- package/agents/hatch3r-context-rules.md +4 -0
- package/agents/hatch3r-creator.md +4 -0
- package/agents/hatch3r-dependency-auditor.md +4 -0
- package/agents/hatch3r-devops.md +4 -0
- package/agents/hatch3r-docs-writer.md +4 -0
- package/agents/hatch3r-fixer.md +5 -1
- package/agents/hatch3r-handoff-loader.md +243 -0
- package/agents/hatch3r-handoff-preparer.md +134 -0
- package/agents/hatch3r-implementer.md +5 -1
- package/agents/hatch3r-learnings-loader.md +4 -0
- package/agents/hatch3r-lint-fixer.md +4 -0
- package/agents/hatch3r-perf-profiler.md +8 -0
- package/agents/hatch3r-researcher.md +5 -1
- package/agents/hatch3r-reviewer.md +92 -0
- package/agents/hatch3r-security-auditor.md +24 -0
- package/agents/hatch3r-test-writer.md +4 -0
- package/agents/modes/requirements-elicitation.md +5 -1
- package/agents/modes/similar-implementation.md +6 -0
- package/agents/modes/user-flows.md +76 -0
- package/agents/shared/quality-charter.md +129 -0
- package/agents/shared/user-question-protocol.md +95 -0
- package/commands/board/shared-azure-devops.md +2 -0
- package/commands/board/shared-github.md +17 -0
- package/commands/board/shared-gitlab.md +4 -0
- package/commands/hatch3r-board-fill.md +2 -1
- package/commands/hatch3r-board-pickup.md +1 -1
- package/commands/hatch3r-board-shared.md +21 -0
- package/commands/hatch3r-create.md +2 -0
- package/commands/hatch3r-handoff.md +126 -0
- package/commands/hatch3r-pr-resolve.md +672 -0
- package/commands/hatch3r-quick-change.md +5 -3
- package/commands/hatch3r-report.md +167 -0
- package/commands/hatch3r-revision.md +1 -1
- package/commands/hatch3r-workflow.md +3 -1
- package/dist/cli/index.js +3144 -979
- package/dist/cli/index.js.map +1 -1
- package/package.json +4 -2
- package/rules/hatch3r-accessibility-standards.md +21 -0
- package/rules/hatch3r-accessibility-standards.mdc +21 -0
- package/rules/hatch3r-agent-orchestration.md +32 -1
- package/rules/hatch3r-agent-orchestration.mdc +32 -1
- package/rules/hatch3r-ai-evals.md +158 -0
- package/rules/hatch3r-ai-evals.mdc +154 -0
- package/rules/hatch3r-ai-ux-patterns.md +131 -0
- package/rules/hatch3r-ai-ux-patterns.mdc +127 -0
- package/rules/hatch3r-api-design.md +67 -9
- package/rules/hatch3r-api-design.mdc +67 -9
- package/rules/hatch3r-api-versioning.md +119 -0
- package/rules/hatch3r-api-versioning.mdc +115 -0
- package/rules/hatch3r-auth-patterns.md +170 -0
- package/rules/hatch3r-auth-patterns.mdc +166 -0
- package/rules/hatch3r-component-conventions.md +30 -0
- package/rules/hatch3r-component-conventions.mdc +30 -0
- package/rules/hatch3r-container-hardening.md +131 -0
- package/rules/hatch3r-container-hardening.mdc +127 -0
- package/rules/hatch3r-contract-testing.md +117 -0
- package/rules/hatch3r-contract-testing.mdc +113 -0
- package/rules/hatch3r-deep-context.md +3 -1
- package/rules/hatch3r-deep-context.mdc +3 -1
- package/rules/hatch3r-dependency-management.md +73 -1
- package/rules/hatch3r-dependency-management.mdc +72 -0
- package/rules/hatch3r-design-system-detection.md +142 -0
- package/rules/hatch3r-design-system-detection.mdc +138 -0
- package/rules/hatch3r-event-schema-evolution.md +90 -0
- package/rules/hatch3r-event-schema-evolution.mdc +86 -0
- package/rules/hatch3r-handoff-readiness.md +45 -0
- package/rules/hatch3r-handoff-readiness.mdc +40 -0
- package/rules/hatch3r-i18n.md +13 -0
- package/rules/hatch3r-i18n.mdc +13 -0
- package/rules/hatch3r-iteration-summary.md +2 -0
- package/rules/hatch3r-iteration-summary.mdc +2 -0
- package/rules/hatch3r-migrations.md +61 -16
- package/rules/hatch3r-migrations.mdc +61 -16
- package/rules/hatch3r-observability-logging.md +1 -1
- package/rules/hatch3r-observability-logging.mdc +1 -1
- package/rules/hatch3r-observability-metrics.md +1 -1
- package/rules/hatch3r-observability-metrics.mdc +1 -1
- package/rules/hatch3r-observability-tracing-detail.md +1 -1
- package/rules/hatch3r-observability-tracing-detail.mdc +1 -1
- package/rules/hatch3r-observability-tracing.md +1 -1
- package/rules/hatch3r-observability-tracing.mdc +1 -1
- package/rules/hatch3r-observability.md +1 -0
- package/rules/hatch3r-observability.mdc +1 -0
- package/rules/hatch3r-operability.md +149 -0
- package/rules/hatch3r-operability.mdc +145 -0
- package/rules/hatch3r-passkey-server.md +181 -0
- package/rules/hatch3r-passkey-server.mdc +177 -0
- package/rules/hatch3r-progressive-delivery.md +120 -0
- package/rules/hatch3r-progressive-delivery.mdc +116 -0
- package/rules/hatch3r-resilience-patterns.md +154 -0
- package/rules/hatch3r-resilience-patterns.mdc +150 -0
- package/rules/hatch3r-secrets-management.md +29 -0
- package/rules/hatch3r-secrets-management.mdc +29 -0
- package/rules/hatch3r-testing.md +139 -43
- package/rules/hatch3r-testing.mdc +139 -43
- package/rules/hatch3r-ux-states-and-flows.md +149 -0
- package/rules/hatch3r-ux-states-and-flows.mdc +145 -0
- package/skills/hatch3r-a11y-audit/SKILL.md +14 -0
- package/skills/hatch3r-ai-feature/SKILL.md +134 -0
- package/skills/hatch3r-api-spec/SKILL.md +5 -0
- package/skills/hatch3r-architecture-review/SKILL.md +14 -0
- package/skills/hatch3r-bug-fix/SKILL.md +5 -0
- package/skills/hatch3r-ci-pipeline/SKILL.md +14 -0
- package/skills/hatch3r-cli-aichat/SKILL.md +84 -0
- package/skills/hatch3r-cli-ast-grep/SKILL.md +85 -0
- package/skills/hatch3r-cli-az-devops/SKILL.md +89 -0
- package/skills/hatch3r-cli-bat/SKILL.md +85 -0
- package/skills/hatch3r-cli-comby/SKILL.md +85 -0
- package/skills/hatch3r-cli-csvkit/SKILL.md +84 -0
- package/skills/hatch3r-cli-delta/SKILL.md +86 -0
- package/skills/hatch3r-cli-difftastic/SKILL.md +84 -0
- package/skills/hatch3r-cli-docker/SKILL.md +89 -0
- package/skills/hatch3r-cli-duckdb/SKILL.md +84 -0
- package/skills/hatch3r-cli-fd/SKILL.md +85 -0
- package/skills/hatch3r-cli-fzf/SKILL.md +84 -0
- package/skills/hatch3r-cli-gh/SKILL.md +90 -0
- package/skills/hatch3r-cli-glab/SKILL.md +89 -0
- package/skills/hatch3r-cli-jq/SKILL.md +85 -0
- package/skills/hatch3r-cli-lazygit/SKILL.md +78 -0
- package/skills/hatch3r-cli-llm/SKILL.md +84 -0
- package/skills/hatch3r-cli-miller/SKILL.md +84 -0
- package/skills/hatch3r-cli-mods/SKILL.md +84 -0
- package/skills/hatch3r-cli-overview/SKILL.md +60 -0
- package/skills/hatch3r-cli-playwright/SKILL.md +89 -0
- package/skills/hatch3r-cli-podman/SKILL.md +84 -0
- package/skills/hatch3r-cli-ripgrep/SKILL.md +85 -0
- package/skills/hatch3r-cli-rtk/SKILL.md +91 -0
- package/skills/hatch3r-cli-sd/SKILL.md +85 -0
- package/skills/hatch3r-cli-stagehand/SKILL.md +79 -0
- package/skills/hatch3r-cli-taplo/SKILL.md +84 -0
- package/skills/hatch3r-cli-xsv/SKILL.md +89 -0
- package/skills/hatch3r-cli-yq/SKILL.md +85 -0
- package/skills/hatch3r-cli-zstd/SKILL.md +85 -0
- package/skills/hatch3r-context-health/SKILL.md +14 -0
- package/skills/hatch3r-cost-tracking/SKILL.md +14 -0
- package/skills/hatch3r-customize/SKILL.md +14 -0
- package/skills/hatch3r-dep-audit/SKILL.md +14 -0
- package/skills/hatch3r-design-system-detect/SKILL.md +162 -0
- package/skills/hatch3r-feature/SKILL.md +2 -0
- package/skills/hatch3r-gh-agentic-workflows/SKILL.md +13 -0
- package/skills/hatch3r-handoff-prepare/SKILL.md +160 -0
- package/skills/hatch3r-handoff-resume/SKILL.md +171 -0
- package/skills/hatch3r-incident-response/SKILL.md +14 -0
- package/skills/hatch3r-issue-workflow/SKILL.md +5 -0
- package/skills/hatch3r-logical-refactor/SKILL.md +14 -0
- package/skills/hatch3r-migration/SKILL.md +14 -0
- package/skills/hatch3r-observability-verify/SKILL.md +133 -0
- package/skills/hatch3r-perf-audit/SKILL.md +14 -0
- package/skills/hatch3r-pr-creation/SKILL.md +14 -0
- package/skills/hatch3r-qa-validation/SKILL.md +18 -0
- package/skills/hatch3r-recipe/SKILL.md +14 -0
- package/skills/hatch3r-refactor/SKILL.md +14 -0
- package/skills/hatch3r-release/SKILL.md +14 -0
- package/skills/hatch3r-reliability-verify/SKILL.md +144 -0
- package/skills/hatch3r-ui-ux-verify/SKILL.md +136 -0
- package/skills/hatch3r-visual-refactor/SKILL.md +15 -1
|
@@ -95,7 +95,7 @@ If Tier 1, run inline. If Tier 2, run the implementer-only pipeline below. If Ti
|
|
|
95
95
|
|
|
96
96
|
## Workflow
|
|
97
97
|
|
|
98
|
-
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
98
|
+
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK. For every ASK checkpoint, use the platform-native question tool per `agents/shared/user-question-protocol.md`.
|
|
99
99
|
|
|
100
100
|
### Step 1: Input and Batch Parsing
|
|
101
101
|
|
|
@@ -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
|
|
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:
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: hatch3r-report
|
|
3
|
+
type: command
|
|
4
|
+
orchestrator: false
|
|
5
|
+
description: Generate an in-chat session report from the active or named transcript — every tool call, sub-agent delegation, and file edit, with diagnostics for missed parallelism, redundant work, and over-serialization.
|
|
6
|
+
tags: [maintenance]
|
|
7
|
+
quality_charter: agents/shared/quality-charter.md
|
|
8
|
+
efficiency_patterns: agents/shared/efficiency-patterns.md
|
|
9
|
+
cache_friendly: true
|
|
10
|
+
parallel_tool_default: true
|
|
11
|
+
---
|
|
12
|
+
## Agent Pipeline
|
|
13
|
+
|
|
14
|
+
This command runs inline and does not spawn sub-agents. Parsing is driven by Bash + jq over the on-disk session transcript; the LLM only sees aggregated counts and triggered-heuristic evidence, never the raw JSONL. This keeps the command efficient (P7) even on 1000+ record sessions.
|
|
15
|
+
|
|
16
|
+
# Session Report — Agentic Action Replay
|
|
17
|
+
|
|
18
|
+
Render an in-chat report of what happened in a Claude Code session: every tool call, every sub-agent `Agent` delegation, every file edit, every hook event. Default = current session, executive summary, in-chat. Flags extend scope and depth. Two audiences: (a) users who want to understand the session end-to-end; (b) maintainers investigating runtime shape for framework-level optimizations.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Argument Parsing
|
|
23
|
+
|
|
24
|
+
| Flag | Effect |
|
|
25
|
+
|------|--------|
|
|
26
|
+
| `--session <id\|path>` | Target a UUID under the project slug dir, or an absolute `.jsonl` path. Default = newest-mtime jsonl in current project slug. |
|
|
27
|
+
| `--list` | Exclusive. Print the 5 most-recent sessions in this project (sessionId, mtime, first-user-message preview 60 chars). Skips all other rendering. |
|
|
28
|
+
| `--verbose` | Append a chronological per-turn timeline after the executive summary. |
|
|
29
|
+
| `--save` | After rendering in-chat, also write to `.hatch3r/reports/{sessionId-short8}-{YYYYMMDD-HHMMSS}.md`. |
|
|
30
|
+
|
|
31
|
+
`--list` takes precedence over `--session`, `--verbose`, `--save`. All other flags compose.
|
|
32
|
+
|
|
33
|
+
## Step 1 — Discover the Session
|
|
34
|
+
|
|
35
|
+
Compute the project slug from the working directory: `SLUG="$(pwd | sed 's|/|-|g')"`. The transcript directory is `~/.claude/projects/${SLUG}`. List `*.jsonl` files; the active session is the newest by mtime (`ls -t *.jsonl | head -1`). When `--session <value>` is provided, resolve a 36-char UUID against the slug dir as `${value}.jsonl`, otherwise treat as an absolute path. When `--list` is set, enumerate the top-5 newest jsonl files; for each, parse the first `type=user` record and emit `<short-id> <mtime> <first-60-chars-of-user-text>`.
|
|
36
|
+
|
|
37
|
+
## Step 2 — Aggregate via jq
|
|
38
|
+
|
|
39
|
+
Run jq over the JSONL to produce a single structured JSON of counts. Persist to `$(mktemp)` so the LLM reads aggregated data only. Sample pipeline:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
jq -s '
|
|
43
|
+
def tu: [.[] | select(.message.content?) | .message.content[] | select(.type=="tool_use")];
|
|
44
|
+
def tr: [.[] | select(.message.content?) | .message.content[] | select(.type=="tool_result")];
|
|
45
|
+
def asst_turns: [.[] | select(.type=="assistant" and (.message.content?))];
|
|
46
|
+
def thinks: [.[] | select(.message.content?) | .message.content[] | select(.type=="thinking") | .text];
|
|
47
|
+
{
|
|
48
|
+
sessionId: .[0].sessionId, firstTs: .[0].timestamp, lastTs: .[-1].timestamp,
|
|
49
|
+
cwd: .[0].cwd, gitBranch: .[0].gitBranch, records: length,
|
|
50
|
+
toolCounts: (tu | group_by(.name) | map({tool: .[0].name, count: length}) | sort_by(-.count)),
|
|
51
|
+
distinctReads: (tu | map(select(.name=="Read") | .input.file_path) | unique | length),
|
|
52
|
+
distinctEdits: (tu | map(select(.name=="Edit" or .name=="Write") | .input.file_path) | unique | length),
|
|
53
|
+
topReads: (tu | map(select(.name=="Read") | .input.file_path) | group_by(.) | map({path: .[0], count: length}) | sort_by(-.count) | .[0:3]),
|
|
54
|
+
agentCalls: (tu | map(select(.name=="Agent") | {sub: (.input.subagent_type // "general-purpose"), prompt: (.input.prompt[:80] // "")})),
|
|
55
|
+
bashCmds: (tu | map(select(.name=="Bash") | .input.command)),
|
|
56
|
+
turnLens: [asst_turns[] | (.message.content | map(select(.type=="tool_use")) | length)],
|
|
57
|
+
thinkingChars: ([thinks[] | length] | add // 0),
|
|
58
|
+
errorResults: (tr | map(select((.content | tostring) | test("error|failed"; "i"))) | length),
|
|
59
|
+
totalResults: (tr | length)
|
|
60
|
+
}' "$JSONL"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`thinkingChars` is the summed length of every `thinking` block's text — required input for D-LOOP-01 (`thinking chars ÷ (tool_use count + 1) > 1200`).
|
|
64
|
+
|
|
65
|
+
The LLM reads the resulting JSON, computes derived metrics (parallel-batch count = turns with ≥2 tool_use; sequential count = turns with exactly 1), and builds the rendered tables.
|
|
66
|
+
|
|
67
|
+
## Step 3 — Compute Diagnostics
|
|
68
|
+
|
|
69
|
+
Apply each rule in §Diagnostic Heuristics over the aggregated structure. Each fired diagnostic produces a record `{id, severity, turns:[...], evidence, suggestion}`. Emit at most one fire per rule per session (consolidate same-rule fires across turns into one record). If zero rules fire, render `None — execution shape is clean.`
|
|
70
|
+
|
|
71
|
+
## Step 4 — Render Executive Summary
|
|
72
|
+
|
|
73
|
+
Always emit. Headings, order, and content per §Output Format. Mask obvious secret patterns (`sk-...`, `ghp_...`, `xoxb-...`, `AIza...`, `Bearer ...`) in any rendered tool_use input field. Truncate Bash commands and Agent prompts to ≤80 chars in tables.
|
|
74
|
+
|
|
75
|
+
## Step 5 — Render Verbose Timeline (--verbose only)
|
|
76
|
+
|
|
77
|
+
Append `## Timeline`. For each assistant turn containing ≥1 tool_use, emit a numbered block: turn index, ISO timestamp, elapsed-since-start, optional `thinking: N chars` summary, one line per tool_use (tool name + first 60 chars of primary input field), and a parallel/sequential marker — `→ {n} tool_use blocks ✓ parallel` when n≥2, `→ 1 tool_use ⚠ sequential` when n=1.
|
|
78
|
+
|
|
79
|
+
## Step 6 — Save to Disk (--save only)
|
|
80
|
+
|
|
81
|
+
Create `.hatch3r/reports/` if missing. Write the rendered markdown (executive summary + timeline if `--verbose` set) to `.hatch3r/reports/{sessionId-short8}-{YYYYMMDD-HHMMSS}.md`. Append a `## Raw Counts (machine-readable)` section containing the jq-aggregated JSON in a fenced ```json``` block — this lets future tooling grep across sessions without re-parsing the source JSONL. Print the file path back to chat. The `.hatch3r/` directory is gitignored.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Output Format
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
## Session Report — a5d750f7
|
|
89
|
+
|
|
90
|
+
**Window:** 2026-05-12 09:14:03 → 09:47:21 (33m 18s, 272 records)
|
|
91
|
+
**Project:** hatch3r (release/1.7.1)
|
|
92
|
+
|
|
93
|
+
### Tool Activity (91 tool calls)
|
|
94
|
+
|
|
95
|
+
| Tool | Calls | Notable |
|
|
96
|
+
|------|------:|---------|
|
|
97
|
+
| Read | 47 | 12 distinct files; validate.ts read 4x |
|
|
98
|
+
| Bash | 21 | 6 parallel batches, 15 sequential |
|
|
99
|
+
| Edit | 18 | 9 distinct files |
|
|
100
|
+
| Task | 4 | 3 general-purpose, 1 explore — all sequential |
|
|
101
|
+
| Grep | 1 | — |
|
|
102
|
+
|
|
103
|
+
### Sub-Agent Delegation (4 Agent calls)
|
|
104
|
+
|
|
105
|
+
| # | Subagent | Prompt (first 60) | Files touched |
|
|
106
|
+
|---|----------|-------------------|---------------|
|
|
107
|
+
| 1 | general-purpose | "Find references to validateCommandOrch..." | 0 |
|
|
108
|
+
| 2 | Explore | "Map existing commands that overlap..." | 0 |
|
|
109
|
+
| 3 | Explore | "Find conversation transcript access..." | 0 |
|
|
110
|
+
| 4 | Plan | "Design hatch3r-report command..." | 0 |
|
|
111
|
+
|
|
112
|
+
### File Footprint
|
|
113
|
+
|
|
114
|
+
- 12 distinct files read; 9 distinct files edited
|
|
115
|
+
- Top 3 most-read: src/cli/commands/validate.ts (4x), commands/hatch3r-context-health.md (2x), CHANGELOG.md (2x)
|
|
116
|
+
|
|
117
|
+
### Diagnostics
|
|
118
|
+
|
|
119
|
+
- WARN D-PAR-01 Missed parallelism: turns 7, 9, 11 each issued one Read on disjoint paths → batch into one assistant turn.
|
|
120
|
+
- WARN D-RED-01 Redundant Read: src/cli/commands/validate.ts read at turns 4, 8, 22, 31 with no Edit between turns 4 and 31.
|
|
121
|
+
- INFO D-PAR-02 Sub-agent fan-out: 4 Agent calls at turns 44, 53, 67, 78 — disjoint subsystems → eligible for parallel fan-out.
|
|
122
|
+
|
|
123
|
+
### Suggested Next Action
|
|
124
|
+
|
|
125
|
+
Re-run `/hatch3r-report --verbose` for the chronological timeline.
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Diagnostic Heuristics
|
|
131
|
+
|
|
132
|
+
| ID | Heuristic | Trigger | Severity |
|
|
133
|
+
|----|-----------|---------|----------|
|
|
134
|
+
| D-PAR-01 | Missed parallelism (same-tool sequential) | ≥3 consecutive assistant turns each with exactly 1 `tool_use` of the **same** tool type targeting disjoint inputs | WARN |
|
|
135
|
+
| D-PAR-02 | Sub-agent fan-out missed | ≥2 `Agent` tool_use blocks within 10 turns where prompt subjects target disjoint path prefixes | WARN |
|
|
136
|
+
| D-RED-01 | Redundant Read | Same `Read.file_path` in ≥3 tool_use blocks with no intervening `Edit`/`Write` on that path | WARN |
|
|
137
|
+
| D-RED-02 | Re-Bash identical command | Same `Bash.command` (trimmed exact match) ≥2 times within 20 turns | INFO |
|
|
138
|
+
| D-LOOP-01 | High thinking-to-action ratio | Total `thinking` chars ÷ (tool_use count + 1) > 1200 AND tool_use count < 8 | WARN |
|
|
139
|
+
| D-LOOP-02 | Tool burst → stall | One turn with ≥5 tool_use blocks AND next turn with 0 AND ≥3 subsequent turns with 0 tool_use | INFO |
|
|
140
|
+
| D-ERR-01 | Tool-result error rate | `tool_result.content` matches `/error\|failed/i` in >20% of results | WARN |
|
|
141
|
+
| D-PATH-01 | File staleness | Path read at turn N, edited at turn M, re-read at turn P>M+15 with no intervening edit on that path | INFO |
|
|
142
|
+
| D-SUB-01 | Sub-agent returning empty | `Agent` tool_result body <200 chars AND no subsequent Edit on any path the prompt referenced | WARN |
|
|
143
|
+
|
|
144
|
+
Each fired record: `{id, severity, turns:[n,...], evidence, suggestion}`. Consolidate same-rule fires into one record per session.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Error Handling
|
|
149
|
+
|
|
150
|
+
| Condition | Action |
|
|
151
|
+
|-----------|--------|
|
|
152
|
+
| `~/.claude/projects/{slug}` does not exist | Print: "No Claude Code transcripts found for this project. Slug: {slug}". Exit. |
|
|
153
|
+
| Slug dir exists but contains no `*.jsonl` | Print: "Project directory empty — no sessions to report on." Exit. |
|
|
154
|
+
| `--session <id>` does not resolve to a readable file | Print: "Session {id} not found under {slug}. Use --list to see available sessions." Exit. |
|
|
155
|
+
| `jq` not installed | Print: "jq is required. Install via `brew install jq` (macOS) or your distro's package manager, then retry." Exit. |
|
|
156
|
+
| Malformed JSONL record encountered | Skip the record; increment a `skipped` counter; surface the count in the executive summary footer when non-zero. |
|
|
157
|
+
| Read access denied to a transcript file | Print: "Cannot read {path}: permission denied." Exit. |
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Guardrails
|
|
162
|
+
|
|
163
|
+
- **Never modify the JSONL.** Read-only access. All scratch files go to `$(mktemp)` and are deleted at end-of-run.
|
|
164
|
+
- **Mask obvious secret patterns** (`sk-`, `ghp_`, `xoxb-`, `AIza`, `Bearer `) in any rendered tool_use input — substitute `{REDACTED-{prefix}}`. The transcript may contain ephemeral tokens from user pastes.
|
|
165
|
+
- **Never write outside `.hatch3r/reports/`.** The `--save` target is fixed; do not honor flags or env vars that redirect output to other paths.
|
|
166
|
+
- **Never abort on a malformed record.** Skip-and-count is the contract; aborting would hide the rest of the session from the operator (Silent Failure Contract — surface the skip count rather than swallowing it).
|
|
167
|
+
- **Honor the iteration summary contract** (`rules/hatch3r-iteration-summary.md`) at the end of the parent assistant turn that invoked this command. The report content is not a substitute for the canonical Status / Outcome / Done block.
|
|
@@ -145,7 +145,7 @@ Revision Context:
|
|
|
145
145
|
|
|
146
146
|
**ASK:** "Is this the work you want to revise? Any additional context I should know about? (yes / provide context / wrong branch)"
|
|
147
147
|
|
|
148
|
-
If the user provides additional context (e.g., a different issue number, clarifications, or scope adjustments), incorporate it before proceeding.
|
|
148
|
+
When asking, use the platform-native question tool per `agents/shared/user-question-protocol.md`. If the user provides additional context (e.g., a different issue number, clarifications, or scope adjustments), incorporate it before proceeding.
|
|
149
149
|
|
|
150
150
|
---
|
|
151
151
|
|
|
@@ -77,7 +77,7 @@ If Tier 1, take Quick Mode with reduced sub-agent prompts. If Tier 2, take Quick
|
|
|
77
77
|
|
|
78
78
|
## Workflow
|
|
79
79
|
|
|
80
|
-
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK.
|
|
80
|
+
Execute these steps in order. **Do not skip any step.** Ask the user at every checkpoint marked with ASK. For every ASK checkpoint, use the platform-native question tool per `agents/shared/user-question-protocol.md`.
|
|
81
81
|
|
|
82
82
|
### Step 0: Triage (Scale-Adaptive Mode Selection)
|
|
83
83
|
|
|
@@ -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.
|