doc-ears-fixer
Apply fixes to an EARS document from the latest doc-ears-audit report - structure, links, element IDs, EARS syntax, references, and upstream drift. Use after an audit reports issues.
What this skill does
# doc-ears-fixer
## Purpose
Read the latest audit report and apply fixes to an EARS document, bridging
`../doc-ears-audit/SKILL.md` and a passing EARS so the audit↔fix cycle can
converge.
**Layer**: 3 (EARS quality improvement).
**Upstream**: the EARS document + `EARS-NN.A_audit_report_vNNN.md`.
**Downstream**: the fixed EARS + `EARS-NN.F_fix_report_vNNN.md`.
## When to Use
After `doc-ears-audit` returns `FAIL`, as part of an Audit → Fix → Audit loop.
Do **not** use without an audit report (run the audit first) or to create a new
EARS (use `../doc-ears/SKILL.md` / `../doc-ears-autopilot/SKILL.md`).
## Input Contract
Consume the latest `EARS-NN.A_audit_report_vNNN.md`. Back up the EARS before
editing (`tmp/backup/EARS-NN_<ts>/`); on error, restore. Element-ID standards
come from `${CLAUDE_PLUGIN_ROOT}/framework/governance/ID_NAMING_STANDARDS.md`; structure and syntax
rules from `${CLAUDE_PLUGIN_ROOT}/framework/layers/03_EARS/EARS-TEMPLATE.yaml` and `README.md`.
## Remediate Mode
Resolve `review_mode` from `.aidoc/profile.yaml`; if unset, fall through
to the framework default `team` per the precedence chain in
`${CLAUDE_PLUGIN_ROOT}/framework/governance/ADAPTATION.md`. Same
fallback applies to other adaptation knobs (`section_toggles`).
### team mode (per REVIEW_TEAM.md §Operations §Remediate)
1. **Read the audit report** at `EARS-NN.A_audit_report_vNNN.md` AND,
when present, the per-persona slots under
`.aidoc/review/03_EARS/<EARS-id>/` (where `<EARS-id>` is the short
artifact ID, e.g. `EARS-01`).
- **Prefer the per-persona slots** for the structured findings —
stable ids, priorities, locations, recommendations.
- **Slots are optional** — when absent (e.g. single_pass run
produced no synthesizer output), fall back to parsing the audit
report's Findings sections directly.
2. **Resolve responsible lenses per finding.** Each blocking finding
(P0 + P1) carries a `personas` array in the synthesizer's reduced
form OR can be inferred from per-lens slot membership. Dispatch
rules:
- **Single-lens finding** (1 persona): dispatch that lens.
- **Multi-lens finding** (2+ personas): dispatch **all** listed
lenses in parallel. Each writes its own `<persona>.fix_<N>.json`
slot. The fix is accepted only when **every** dispatched lens
returns no new P0/P1 (any one lens regressing reverts the patch).
- **No-persona / orphan finding** (empty or missing `personas`):
dispatch the EARS crew's author lens (per
`REVIEW_CREWS.yaml`: `requirements_specialist` for EARS) as the
default responsible reviewer.
Lens → agent map for EARS:
| Lens | Agent |
|------|-------|
| `requirements_specialist` | `requirements-analyst` |
| `tech_lead` | `solutions-architect` |
| `qa_lead` | `test-architect` |
| `chaos_engineer` | `chaos-engineer` |
| `security_engineer` | `security-engineer` |
EARS crew weights: `{requirements_specialist: 35, tech_lead: 25,
qa_lead: 20, chaos_engineer: 12, security_engineer: 8}`.
P2/P3 are advisory — apply deterministically without lens
validation.
3. **Propose and apply a patch** per blocking finding. Fix Phases 0–7
below describe the patch shapes; the catalogue is the same in both
modes. Back up first per the existing Input Contract.
4. **Validate non-regression.** For each responsible lens identified
in step 2, dispatch one `Task` subagent in patch-validation mode:
`subagent_type=<mapped agent>`; brief = the patched region + the
original finding + the patch diff; output = a fresh persona-output
record (lens_score for the patched region + any new findings).
Persist each lens's output as
`.aidoc/review/03_EARS/<EARS-id>/<persona>.fix_<N>.json` (`<N>` =
sequential fix-iteration counter, starting at 1). Multi-lens
findings produce one slot file per responsible lens for the same
`<N>`.
5. **Revert regressions.** If any lens returns new P0/P1 on the patch,
revert that patch and flag `manual_required` for the original
finding. **Never silently keep a regressing fix.**
6. **Dispatch the synthesizer once**, after all patches are validated,
to emit the unified fix report. Persist
`EARS-NN.F_fix_report_vNNN.md` with both the Fixes Applied table
AND a Validation Slots index.
### single_pass mode (fallback)
Apply Phase 0–7 directly, single-handed, no lens validation. Unchanged
legacy behaviour — required when the profile says so, when `Task` subagent
dispatch is unavailable, or when no slots are present.
In both modes, P2/P3 advisory findings are applied without lens
validation; only blocking findings (P0/P1) go through the
patch-validation loop in team mode.
## Saga interaction
When invoked by `doc-ears-autopilot` (or directly), this skill reads
and updates the saga journal at
`.aidoc/review/03_EARS/<EARS-id>/saga.json` per
`${CLAUDE_PLUGIN_ROOT}/framework/governance/REVIEW_SAGA.md`. The fixer
acts as the **remediation stage** of the saga: it transitions
branches to `BRANCH_COMPENSATING` during patch validation, then back
to `BRANCH_COMPLETED` (validated) or `BRANCH_FAILED` (regression
detected).
### On entry
At entry, write the fixer's start epoch:
```sh
Bash: mkdir -p .aidoc/review/03_EARS/<EARS-id>/ && date +%s > .aidoc/review/03_EARS/<EARS-id>/.skill-start.fixer
```
If `.aidoc/review/03_EARS/<EARS-id>/saga.json` exists, read it. Validate
that current saga `status` is `FANIN_REDUCED` (post-audit) or
`BRANCH_FAILED` (re-entering after a prior fixer regression). If
status is something else, log a warning and proceed.
### During patch validation (team mode)
For each blocking finding (P0/P1) that requires lens validation:
1. Before dispatching the responsible lens validator(s): for each
lens in the finding's `personas[]` list, append a transition:
`{"ts": "<now>", "from": "BRANCH_COMPLETED", "to":
"BRANCH_COMPENSATING", "scope": "branch:<lens>"}`. Update
`branches[<lens>].status` to `"BRANCH_COMPENSATING"`. Append an
entry to `compensation_actions[]`:
`{"ts": "<now>", "branch": "<lens>", "reason": "<finding_id>:
<message>", "action": "retry"}`.
2. After the validation Task subagent returns:
- If patch validated (no regression): transition back to
`BRANCH_COMPLETED`. Update `compensation_actions[]` last entry
with the validation result.
- If patch regresses (lens flags new P0/P1 on patched region):
transition to `BRANCH_FAILED`. Set
`compensation_actions[]` last entry's `action` to `"escalate"`.
The finding becomes `manual_required`.
### Before synthesizer dispatch
Per `REVIEW_SAGA.md` §"Break-circuit policy" — the fixer's
checkpoint boundary is **between multi-lens validation dispatches**
(each blocking finding's per-lens validation is one boundary).
Before dispatching the next validation:
```sh
Bash: echo $(( $(date +%s) - $(cat .aidoc/review/03_EARS/<EARS-id>/.skill-start.fixer) ))
```
If elapsed > `SOFT_DEADLINE` (1500s):
- Append transition: `{"ts": "<now>", "from": "BRANCH_COMPENSATING",
"to": "PARTIAL_TIMEOUT", "scope": "run"}`.
- Set saga `status: "PARTIAL_TIMEOUT"`. Preserve all completed
validations (their `fix_N.json` slots remain durable). Set
`current_phase: "fixer"` so the resume invocation knows to
continue the remaining validations.
- Update `updated_at`. Write `saga.json`. Exit cleanly.
The remaining validations resume on next invocation per
`doc-ears-autopilot`'s §3.4 resume logic.
### After synthesizer reduce
- Append transition: `{"ts": "<now>", "from": "BRANCH_COMPENSATING",
"to": "BRANCH_COMPLETED", "scope": "run"}` (run-level: fixer
pass complete).
- Update saga `status: "BRANCH_COMPLETED"` (autopilot's next phase
will be `re-review`).
- Update `updated_at`. Write `saga.json`.
### When invoked standalone (no saga.json on entry)
If `.aidoc/review/03_EARS/<EARS-id>/saga.json` does NOT exist (user
runs `/aidoc-flow:doc-ears-fixer` directly outside the autopilot
loop), do NOT initialize the Related in Security
mac-ops
IncludedComprehensive macOS workstation operations — diagnose kernel panics, identify failing drives, audit launchd startup items, decode wake reasons, triage TCC permission denials, manage APFS snapshots, recover from no-boot. Use for: Mac is slow, slow bootup, won't boot, kernel panic, kernel_task hot, mds_stores CPU, photoanalysisd, cloudd, login loop, gray screen, sleep wake failure, drive failing, IO errors, APFS snapshots eating space, Time Machine local snapshots, Spotlight indexing, launchd, LaunchAgent, LaunchDaemon, login items, TCC permissions, Full Disk Access, Screen Recording denied, Gatekeeper, quarantine, com.apple.quarantine, app is damaged, helper tool, /Library/PrivilegedHelperTools, pmset, wake reasons, dark wake, sysdiagnose, panic.ips, DiagnosticReports, configuration profile, MDM profile, remote diagnostics over SSH.
a11y-audit
IncludedRun accessibility audits on web projects combining automated scanning (axe-core, Lighthouse) with WCAG 2.1 AA compliance mapping, manual check guidance, and structured reporting. Output is configurable: markdown report only, markdown plus machine-readable JSON, or markdown plus issue tracker integration. Use this skill whenever the user mentions "accessibility audit", "a11y audit", "WCAG audit", "accessibility check", "compliance scan", or asks to check a web project for accessibility issues. Also trigger when the user wants to verify WCAG conformance or map findings to a specific standard (CAN-ASC-6.2, EN 301 549, ADA/AODA).
erpclaw
IncludedAI-native ERP system with self-extending OS. Full accounting, invoicing, inventory, purchasing, tax, billing, HR, payroll, advanced accounting (ASC 606/842, intercompany, consolidation), and financial reporting. 413 actions across 14 domains, 43 expansion modules. Constitutional guardrails, adversarial audit, schema migration. Double-entry GL, immutable audit trail, US GAAP.
assess
IncludedAssesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use when evaluating code, designs, architectures, or comparing alternative approaches.
spring-boot-security-jwt
IncludedProvides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based access control using Spring Security 6.x. Use when implementing authentication or authorization in Spring Boot applications.
code-hardcode-audit
IncludedDetect hardcoded values, magic numbers, and leaked secrets. TRIGGERS - hardcode audit, magic numbers, PLR2004, secret scanning.