skills/practices/load-bearing-markers/SKILL.md
Mark and preserve non-obvious code that looks removable but isn't. Defensive patterns, workarounds for library bugs, and fixes that survived painful debugging deserve a marker so the next refactor doesn't silently regress them.
npx skillsauth add devjarus/coding-agent load-bearing-markersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Code that looks redundant, overly defensive, or oddly specific is often load-bearing — it exists because of a bug that was painful to find and costly to re-learn. Without a marker, the next refactor simplifies it away and the bug comes back.
Use one of these comment forms directly above the load-bearing line(s):
| Marker | Use when |
|--------|---------|
| // LOAD-BEARING: <reason> | The line fixes or works around a real bug. Reason is 1 sentence — what breaks if this is removed. |
| // F-NNN: <short-ref> | Preferred when the fix has a tracking ID (Linear, Jira, GitHub issue, internal RFC). NNN is the ID number. |
| // HACK: <reason> | Workaround you'd like to remove but can't yet (e.g., pending upstream fix). Include what would let you remove it. |
| // FIXME: <reason> | Known defect, not yet fixed. Not load-bearing — means "this is broken." |
LOAD-BEARING and F-NNN are the load-bearing markers. HACK and FIXME are included for completeness so the grep pattern below catches all maintenance-sensitive lines.
// LOAD-BEARING: tsx in CJS mode does not populate import.meta.dirname,
// so we must derive the directory from import.meta.url manually.
const __dirname = path.dirname(fileURLToPath(import.meta.url));
Without the marker, the next refactor deletes the URL dance and replaces it with import.meta.dirname, which silently returns undefined under tsx/CJS.
Before rewriting or refactoring any file, run:
grep -nE '// *(LOAD-BEARING|HACK|FIXME|F-[0-9]+)' <file>
If matches are found:
// LOAD-BEARING: needed is useless. Say what breaks if removed.LOAD-BEARING when there's no ticket.The alternative is oral tradition: "don't touch that line, it fixes a bug." Oral tradition doesn't survive team turnover or conversation compaction. A grep-able marker does.
testing
Multi-source research method — decompose a question, fan out parallel investigators, interleaved-think each result, verify claims adversarially, synthesize a cited answer. Use for breadth-heavy research, stack comparisons, "which approach wins" questions.
testing
Decide when to use unit vs integration vs e2e tests, and when to mock vs use the real thing per dependency. Dependency injection is the enabler — without it you end up monkey-patching imports. Apply when writing tests of any kind.
development
Test-driven development process — write failing test, implement to pass, refactor. Use when implementing any feature or fixing bugs.
development
Patterns for sharing types, API contracts, and validation schemas between frontend and backend. Use when multiple domains consume the same data shapes to prevent contract drift.