doc-tdd-fixer
Apply fixes to a TDD from the latest doc-tdd-audit report - structure, links, element IDs, test-case content, references, and upstream SPEC drift. Use after an audit reports issues.
What this skill does
# doc-tdd-fixer
## Purpose
Read the latest audit report and apply fixes to a TDD, bridging
`../doc-tdd-audit/SKILL.md` and a passing TDD so the audit↔fix cycle can
converge.
**Layer**: 7 (TDD quality improvement).
**Upstream**: the TDD document + `TDD-NN.A_audit_report_vNNN.md`.
**Downstream**: the fixed TDD + `TDD-NN.F_fix_report_vNNN.md`.
## When to Use
After `doc-tdd-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
TDD (use `../doc-tdd/SKILL.md` / `../doc-tdd-autopilot/SKILL.md`).
## Input Contract
Consume the latest `TDD-NN.A_audit_report_vNNN.md`. Back up the TDD before
editing (`tmp/backup/TDD-NN_<ts>/`); on error, restore. Element-ID standards
come from `${CLAUDE_PLUGIN_ROOT}/framework/governance/ID_NAMING_STANDARDS.md`; structure rules from
`${CLAUDE_PLUGIN_ROOT}/framework/layers/07_TDD/TDD-TEMPLATE.yaml` and `README.md`.
## Fix Phases
Run in order; later phases assume the earlier ones succeeded.
| Phase | Scope | Representative actions |
|-------|-------|------------------------|
| 0 — Structure | location/filename | move TDD into `docs/07_TDD/`; rename to `TDD-NN_{slug}.yaml`; align slug with the parent SPEC component; fix relative links after the move |
| 1 — Missing files | referenced-but-absent | create index / fixture / reference placeholders from templates |
| 2 — Links | broken/abs paths | recompute relative paths; convert absolute → relative |
| 3 — Element IDs | legacy/invalid IDs | re-derive `TDD.NN.04.xxxx` (Section 4 + content hash); drop legacy 3-segment `TDD.NN.xxxx` and `TC-XXX`/`UT-XXX`/`IT-XXX`/`ST-XXX`/`FT-XXX` (set the `type` attribute instead) |
| 4 — Content | placeholders, malformed cases | fill template dates; add missing inputs/expected output/edge cases; set a `type` attribute; repair the BDD→test mapping; flag `[TODO]`/`[TBD]` for manual completion |
| 5 — References | traceability | add missing `@spec:`/`@bdd:` tags; fix cross-doc paths; update Section 7 traceability and the coverage table |
| 6 — Upstream | metadata + drift | fix `deliverable_type`/`document_type`; when the parent SPEC has changed, apply tiered drift merge (below) |
| 7 — Style | STY01 banned phrases, STY02/03 oversized prose, FM01 frontmatter mismatch | substitute filler; replace flagged superlatives; collapse paragraph (≥ 3 banned phrases in one section) to bullets; reconcile frontmatter ↔ Document Control rows; STY02/03 — split oversized Test Case sections at type/category boundaries, or mark `manual_required`. Authority: `${CLAUDE_PLUGIN_ROOT}/framework/governance/AUTHORING_STYLE.md` |
**Element ID re-derivation:** `ID = TDD.{doc_id}.04.<first 4 hex of
SHA256(case content)>` (extend to 8 on collision). Test type stays a `type`
attribute, never an ID code. Document-level refs (`SPEC-NN`, `ADR-NN`,
`IPLAN-NN`) stay in dash form.
**Tiered upstream drift** (when the parent SPEC changed): <5% change → Tier 1
auto-merge new test-case stubs (patch bump); 5–15% → Tier 2 auto-merge + flag
affected cases for review + changelog (minor bump); >15% → Tier 3 archive
current + regenerate via autopilot (major bump). Never delete tests — mark
`[DEPRECATED]` and retain for traceability. Record results in
`.drift_cache.json`.
## Confidence Classification
Tag every applied fix and surface counts in the report:
| Confidence | Meaning |
|------------|---------|
| `auto-safe` | deterministic, low semantic risk (link/path, ID conversion, date fill) |
| `auto-assisted` | template insertion with partial assumptions (scaffolded test-case fields, coverage rows) |
| `manual-required` | domain content cannot be inferred (unresolved TODO/TBD, test logic, assertions) |
## Content-Preservation Rules
- Never delete existing test logic, assertions, test data, or fixtures; insert
template blocks only where a case or section is missing required structure.
- Normalize equivalent headings/cases in place rather than duplicating them.
- Deprecated tests are marked, not removed; recalculate coverage after fixes.
## Fix Report Format
Write `TDD-NN.F_fix_report_vNNN.md` with: **Summary** (issues in / fixed /
remaining; files created / modified; test cases repaired) · **Fixes Applied**
(code, issue, fix, file, confidence) · **Manual-Review Queue** · **Validation
After Fix** (score/errors/warnings before→after) · **Cleanup Summary** (delete
superseded fix reports) · **Next Steps** (re-run `doc-tdd-audit`). Loop until
score ≥ threshold or max iterations reached.
## Adaptation
Before applying fixes, read the project adaptation profile
(`.aidoc/profile.yaml`). Honor `section_toggles`: do not reintroduce an
**optional** section the project has toggled off. Ignore any unknown or
out-of-surface key.
Authority: `${CLAUDE_PLUGIN_ROOT}/framework/governance/ADAPTATION.md`.
## Related Resources
- Audit (input): `../doc-tdd-audit/SKILL.md` · Create: `../doc-tdd/SKILL.md`
- Orchestration: `../doc-tdd-autopilot/SKILL.md` · IDs: `../doc-naming/SKILL.md`
- Authority: `${CLAUDE_PLUGIN_ROOT}/framework/layers/07_TDD/TDD-TEMPLATE.yaml`,
`${CLAUDE_PLUGIN_ROOT}/framework/governance/ID_NAMING_STANDARDS.md`
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.