You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make skill explicit that ready-to-run commands still need user approval,
even in auto mode. Require markdown-table summary on step 1.
list-errors.sh: collapse HTTP 422 OperationOutcome into a short
`HTTP <code> <kind> [schema] <expression> — <diagnostics>` line and
render unmappedCodes directly for code_mapping_error rows.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/check-errors/SKILL.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,9 @@ description: Check recent HL7v2 processing errors in Aidbox, diagnose root cause
5
5
6
6
# Check HL7v2 Processing Errors
7
7
8
-
Diagnose and help resolve `IncomingHL7v2Message` errors from the HL7v2→FHIR pipeline. Work iteratively — summary first, one error at a time, never auto-fix without approval.
8
+
Diagnose and help resolve `IncomingHL7v2Message` errors from the HL7v2→FHIR pipeline. Work iteratively — summary first, one error at a time.
9
+
10
+
**MANDATORY APPROVAL GATE.** Never run any fix command without explicit user approval, even in auto mode and even when the inspect script prints a "ready-to-run" line. "Ready-to-run" means *ready for the user to approve*, not *ready for you to execute*. Present the proposed command, wait for an explicit "yes" / "do it" / "go ahead", then run. This applies to `wire-preprocessor.ts`, `defer.sh`, `resolve-mapping.sh`, `verify-retry.sh`, `mark-for-retry`, config edits, and any other state-changing action. Read-only inspection (`list-errors.sh`, `triage.sh`, `inspect-error.sh`, `status.sh`, `loinc-search.sh`, `list-preprocessors.sh`, `check-message-support.ts`) does not require approval.
9
11
10
12
## Step 1: Summary
11
13
@@ -27,6 +29,8 @@ Prints each error with a suggested class (auto-swap / fhir-422 / sender-missing
27
29
28
30
Ask: **"Which error would you like me to investigate?"** Skip `deferred` rows unless the user explicitly asks.
29
31
32
+
**Present the summary back to the user as a markdown table** (not a bullet list), even when condensing or rewording the script output. Columns: `#`, `Type`, short `Summary`, `ID`.
Emits: status, type, sender, full error, unmapped codes (if present), raw HL7v2 saved to `/tmp/hl7v2-<id>.hl7`, and an `hl7v2-inspect` overview for `parsing_error`/`conversion_error`. **You do not need to curl the resource yourself.**
37
41
38
-
For `HTTP 422` conversion errors the script also prints the **current values** of each candidate HL7v2 field, so you typically don't need an additional `hl7v2-inspect --field` call. For `per-1` (reversed period) it also emits a **ready-to-run**`wire-preprocessor.ts` command — just copy/run it. For `code_mapping_error` with any `observation-code-loinc` task, peer OBX rows are dumped automatically AND LOINC candidates are fetched via ValueSet/$expand on each localDisplay — you usually have everything needed to pick the right LOINC without another call.
42
+
For `HTTP 422` conversion errors the script also prints the **current values** of each candidate HL7v2 field, so you typically don't need an additional `hl7v2-inspect --field` call. For `per-1` (reversed period) it also emits a **ready-to-run**`wire-preprocessor.ts` command — present it to the user for approval, do NOT run it yourself. For `code_mapping_error` with any `observation-code-loinc` task, peer OBX rows are dumped automatically AND LOINC candidates are fetched via ValueSet/$expand on each localDisplay — you usually have everything needed to pick the right LOINC without another call.
39
43
40
44
Pick the playbook below by the `Status` line from Step 2.
41
45
@@ -148,7 +152,7 @@ scripts/errors/status.sh <id>
148
152
## Rules
149
153
150
154
- Summary first, then one error at a time.
151
-
- Never auto-fix without approval.
155
+
- **Never run a fix command without explicit user approval** — applies even in auto mode, even when a "ready-to-run" command is printed, even when the fix seems obvious. Propose → wait for "yes" → run. Covers `wire-preprocessor.ts`, `defer.sh`, `resolve-mapping.sh`, `verify-retry.sh`, `mark-for-retry`, and any config edit.
152
156
- Skip `deferred` rows in the summary unless the user asks about them.
153
157
- Don't hand-count pipes — the inspect script already ran `hl7v2-inspect.sh`. For deeper field lookup use `scripts/hl7v2-inspect.sh --field SEG.N`.
154
158
- Use the `hl7v2-info` skill to verify HL7v2 spec compliance when needed.
0 commit comments