swe-workflow-skills 0.5.1 → 0.6.0
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 +26 -16
- package/VERSION +1 -1
- package/catalog.json +7 -2
- package/package.json +1 -1
- package/roles.json +4 -1
- package/skills/code-reviewing/SKILL.md +1 -0
- package/skills/code-reviewing/references/review-checklist.md +16 -0
- package/skills/code-slop-cleanup/SKILL.md +90 -0
- package/skills/code-slop-cleanup/evals/evals.json +57 -0
- package/skills/code-slop-cleanup/references/slop-patterns.md +42 -0
- package/skills/dependency-management/SKILL.md +13 -3
- package/skills/git-workflow/SKILL.md +2 -0
- package/skills/project-documentation/SKILL.md +1 -1
- package/skills/refactoring/SKILL.md +1 -0
- package/skills/skill-router/SKILL.md +3 -2
- package/skills/tdd-workflow/SKILL.md +3 -1
- package/skills/technical-debt-review/SKILL.md +18 -1
- package/skills/technical-debt-review/evals/evals.json +3 -2
- package/skills/technical-debt-review/templates/debt-audit.md +33 -9
- package/skills/test-suite-design/SKILL.md +11 -0
package/README.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/swe-workflow-skills)
|
|
4
4
|
[](https://github.com/SWEStash/swe-workflow-skills/actions/workflows/roles-check.yml)
|
|
5
|
-

|
|
6
6
|
[](LICENSE)
|
|
7
7
|
|
|
8
|
-
A curated library of **
|
|
8
|
+
A curated library of **66 Claude Code Agent Skills** that walk Claude through the
|
|
9
9
|
software lifecycle the way a disciplined senior engineer would — planning, design,
|
|
10
10
|
TDD, review, security, deployment, incidents, and the project-management work around
|
|
11
11
|
them.
|
|
@@ -18,25 +18,34 @@ LLM-as-judge eval harness.
|
|
|
18
18
|
|
|
19
19
|
## Why this library
|
|
20
20
|
|
|
21
|
-
Not just a pile of skills —
|
|
22
|
-
full-SDLC breadth that popular collections
|
|
21
|
+
Not just a pile of skills — a routing layer over Claude Code's native skill
|
|
22
|
+
activation, an eval discipline, and full-SDLC breadth that popular collections
|
|
23
|
+
don't cover:
|
|
23
24
|
|
|
24
25
|
- **An orchestrator, not auto-trigger roulette.** A `skill-router` skill maps your
|
|
25
|
-
intent to the right skill(s) and chains them across phases.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
26
|
+
intent to the right skill(s) and chains them across phases. Community measurements put
|
|
27
|
+
Claude's own description-based auto-triggering at roughly a coin flip to ~84%; here
|
|
28
|
+
activation is *routed and deterministic* instead, and the routing eval harness measures
|
|
29
|
+
it (top-1 accuracy 1.00, zero misroutes on the committed baseline, regression-gated in
|
|
30
|
+
CI) — see the [routing benchmark](docs/ROUTING-BENCHMARK.md). This is the one thing the
|
|
31
|
+
platform still doesn't do for you.
|
|
32
|
+
- **Every skill stays reachable, no pre-picking.** Claude Code injects skill descriptions
|
|
33
|
+
only up to ~1% of context, so large libraries silently stop auto-triggering past ~20–40
|
|
34
|
+
skills. The fix is Claude Code's own **`name-only`** state (its docs recommend it for
|
|
35
|
+
low-priority skills); this library just applies it wholesale — keeping the router +
|
|
36
|
+
safety skills "loud" and listing the rest name-only — so the router can still invoke
|
|
37
|
+
every skill by name, with no cropping and without making you pre-pick a subset
|
|
38
|
+
([how it works](docs/ROLES.md)).
|
|
35
39
|
- **Tested like code, not prose.** Every skill ships 3 evals; two LLM-as-judge
|
|
36
40
|
harnesses (content quality and routing accuracy) replay them with skill loaded vs
|
|
37
41
|
absent and gate regressions in CI. Safety-critical skills (deploys, releases, tests,
|
|
38
42
|
incidents, security) are **hardened**: an Iron Law, a rationalization table distilled
|
|
39
43
|
from real baseline failures, and pressure tests that try to talk the agent out of it.
|
|
44
|
+
- **Curated, not a mega-catalog.** First-party skills, versioned and eval-gated in the
|
|
45
|
+
repo — no arbitrary third-party skills pulled from a hub, and nothing that executes on
|
|
46
|
+
its own (the content is instructions and templates; the only code is the open Node
|
|
47
|
+
installer). In an ecosystem where researchers have flagged hundreds of malicious
|
|
48
|
+
community skills, curated-and-reviewed is itself a feature — see [SECURITY.md](SECURITY.md).
|
|
40
49
|
- **Full-SDLC breadth.** Planning, architecture/ADRs, API and data design, TDD, review,
|
|
41
50
|
security, releases, deploys, GitOps, observability, incidents, MLOps, LLM apps
|
|
42
51
|
and AI evaluation, data pipelines and data quality, and the PM/strategy work
|
|
@@ -64,7 +73,7 @@ web, claude.ai chat, and Cowork):
|
|
|
64
73
|
**two-step** setup:
|
|
65
74
|
|
|
66
75
|
```bash
|
|
67
|
-
# 1. Install all
|
|
76
|
+
# 1. Install all 66 skills + router + /role + the hook script, and apply the baseline
|
|
68
77
|
npx swe-workflow-skills install --global
|
|
69
78
|
```
|
|
70
79
|
|
|
@@ -139,7 +148,7 @@ review) live in the `skill-router` skill and **[ROLES.md](docs/ROLES.md)**.
|
|
|
139
148
|
|
|
140
149
|
## What's included
|
|
141
150
|
|
|
142
|
-
|
|
151
|
+
66 skills — **[full catalog → SKILLS.md](docs/SKILLS.md)**:
|
|
143
152
|
|
|
144
153
|
| Area | Count | Examples |
|
|
145
154
|
|------|-------|----------|
|
|
@@ -161,6 +170,7 @@ review) live in the `skill-router` skill and **[ROLES.md](docs/ROLES.md)**.
|
|
|
161
170
|
- **[INSTALL-MATRIX.md](docs/INSTALL-MATRIX.md)** — every install method × surface, side by side.
|
|
162
171
|
- **[SKILLS.md](docs/SKILLS.md)** — the full skill catalog by area.
|
|
163
172
|
- **[EVALS.md](docs/EVALS.md)** — how the skills are tested (RED/GREEN, pressure tests, CI gate).
|
|
173
|
+
- **[ROUTING-BENCHMARK.md](docs/ROUTING-BENCHMARK.md)** — the routing reliability numbers, methodology, and how to reproduce them.
|
|
164
174
|
- **[AUTHORING.md](docs/AUTHORING.md)** — write or modify a skill (descriptions, budget, progressive disclosure, evals).
|
|
165
175
|
- **[RELEASING.md](docs/RELEASING.md)** — versioning policy and how to cut a release. Changes are tracked in **[CHANGELOG.md](CHANGELOG.md)**.
|
|
166
176
|
- **[SECURITY.md](SECURITY.md)** — the security model: trust boundaries, what runs automatically, supply-chain guarantees, and how to report a vulnerability.
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.6.0
|
package/catalog.json
CHANGED
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"description": "Structured code reviews enforcing DRY, KISS, YAGNI, SRP, best practices, and project conventions. Triggers: review this code, code review, check my code, what do you think of this implementation, review this PR, is this code good, feedback on my code, review staged changes before commit.",
|
|
62
62
|
"path": "code-reviewing/SKILL.md"
|
|
63
63
|
},
|
|
64
|
+
{
|
|
65
|
+
"name": "code-slop-cleanup",
|
|
66
|
+
"description": "Strip AI slop from a branch diff before PR — judge each hunk against the surrounding file's conventions, remove without changing behavior, re-run tests. Removal only: hunting bugs → code-reviewing; structural improvement → refactoring; repo-wide audit → technical-debt-review; pruning tests → test-suite-design. Triggers: deslop, AI slop, slop cleanup, tighten this diff, remove AI artifacts, clean the diff before PR, debug leftovers, stray PLAN.md, obvious comments, unnecessary try/catch, backwards-compat shim nobody asked for, diff hygiene.",
|
|
67
|
+
"path": "code-slop-cleanup/SKILL.md"
|
|
68
|
+
},
|
|
64
69
|
{
|
|
65
70
|
"name": "compliance-privacy",
|
|
66
71
|
"description": "Engineer for regulatory and privacy obligations — GDPR/CCPA privacy-by-design, PII data mapping and minimization, retention and deletion (right to erasure), data subject requests, consent, SOC 2 controls (access, change management, audit logging). Triggers: GDPR, CCPA, SOC 2, HIPAA, compliance, privacy review, PII, personal data, data retention, right to be forgotten, DSR, audit requirements, are we compliant. Vulnerabilities in code → security-audit; attack analysis of a design → threat-modeling.",
|
|
@@ -98,7 +103,7 @@
|
|
|
98
103
|
},
|
|
99
104
|
{
|
|
100
105
|
"name": "dependency-management",
|
|
101
|
-
"description": "Evaluate, audit, and upgrade project dependencies — assess libraries before adoption, audit CVEs, plan major upgrades, resolve conflicts. Triggers: should I use this library, npm audit, upgrade dependencies, dependency vulnerability, outdated packages, evaluate this package, is this library maintained, dependency conflict, lock file, breaking changes in upgrade.",
|
|
106
|
+
"description": "Evaluate, audit, and upgrade project dependencies — assess libraries before adoption, audit CVEs, plan major upgrades, resolve conflicts. Triggers: should I use this library, npm audit, upgrade dependencies, dependency vulnerability, outdated packages, evaluate this package, is this library maintained, dependency conflict, lock file, breaking changes in upgrade, slopsquatting, package hallucination, does this package exist, verify package name, AI suggested this library.",
|
|
102
107
|
"path": "dependency-management/SKILL.md"
|
|
103
108
|
},
|
|
104
109
|
{
|
|
@@ -288,7 +293,7 @@
|
|
|
288
293
|
},
|
|
289
294
|
{
|
|
290
295
|
"name": "tdd-workflow",
|
|
291
|
-
"description": "Guide test-driven development with red-green-refactor. Triggers: use tdd, test first, write the tests, red green refactor, test-driven, what should I test, write tests before code, failing test, implement using TDD.
|
|
296
|
+
"description": "Guide test-driven development with red-green-refactor. For NEW code via test-first — use test-suite-design for adding tests to existing code. Triggers: use tdd, test first, write the tests, red green refactor, test-driven, what should I test, write tests before code, failing test, implement using TDD.",
|
|
292
297
|
"path": "tdd-workflow/SKILL.md"
|
|
293
298
|
},
|
|
294
299
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swe-workflow-skills",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "A curated library of Claude Code Agent Skills covering the full software lifecycle, with orchestrator-routed activation that scales past the skill-listing budget.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/roles.json
CHANGED
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"configuration-strategy",
|
|
52
52
|
"security-audit",
|
|
53
53
|
"refactoring",
|
|
54
|
+
"code-slop-cleanup",
|
|
54
55
|
"deployment-checklist"
|
|
55
56
|
]
|
|
56
57
|
},
|
|
@@ -67,7 +68,8 @@
|
|
|
67
68
|
"test-suite-design",
|
|
68
69
|
"browser-verification",
|
|
69
70
|
"performance-optimization",
|
|
70
|
-
"refactoring"
|
|
71
|
+
"refactoring",
|
|
72
|
+
"code-slop-cleanup"
|
|
71
73
|
]
|
|
72
74
|
},
|
|
73
75
|
"devops": {
|
|
@@ -228,6 +230,7 @@
|
|
|
228
230
|
"test-data-strategy",
|
|
229
231
|
"browser-verification",
|
|
230
232
|
"code-reviewing",
|
|
233
|
+
"code-slop-cleanup",
|
|
231
234
|
"bug-investigating"
|
|
232
235
|
]
|
|
233
236
|
},
|
|
@@ -97,5 +97,6 @@ These are the lenses through which code is examined:
|
|
|
97
97
|
## Cross-Skill References
|
|
98
98
|
|
|
99
99
|
- `refactoring` — when the review surfaces code smells worth a structured cleanup
|
|
100
|
+
- `code-slop-cleanup` — strip AI-slop patterns from the diff before (or instead of) debating them in review
|
|
100
101
|
- `security-audit` — for a dedicated, deep security pass beyond the review checklist
|
|
101
102
|
- `verification-before-completion` — verify the change actually runs before approving, not from the diff alone
|
|
@@ -95,6 +95,10 @@ Flag when you see:
|
|
|
95
95
|
- [ ] No tests that merely re-verify third-party library behavior (e.g. asserting a compression lib's magic bytes or compression ratio, or that an ORM persists a row) — tests target our own logic and our boundary with the library, not what the vendor's own tests already cover
|
|
96
96
|
- [ ] Mocks/stubs are used appropriately (not over-mocked)
|
|
97
97
|
- [ ] Integration tests exist for cross-boundary interactions
|
|
98
|
+
- [ ] No assertions weakened or removed relative to the base branch
|
|
99
|
+
- [ ] No tests deleted or skipped without stated justification
|
|
100
|
+
- [ ] No expected values special-cased to match current (possibly buggy) output
|
|
101
|
+
- [ ] The unit under test is not itself mocked out
|
|
98
102
|
|
|
99
103
|
## Common Patterns to Flag
|
|
100
104
|
|
|
@@ -116,6 +120,18 @@ Flag when you see:
|
|
|
116
120
|
|
|
117
121
|
**Inappropriate intimacy**: Two classes that access each other's private details excessively. Restructure to restore proper boundaries.
|
|
118
122
|
|
|
123
|
+
## AI-Generated Code Tells
|
|
124
|
+
|
|
125
|
+
Patterns characteristic of AI-assisted diffs. Each is judged *relative to the surrounding code* — the same construct can be correct at one location and slop at another:
|
|
126
|
+
|
|
127
|
+
- **Defensive checks abnormal for the codepath**: try/catch, null guards, or re-validation deep in trusted paths whose inputs were already validated upstream. (Legitimate at process boundaries, external calls, and user input.)
|
|
128
|
+
- **Style inconsistent with the surrounding file**: naming, formatting, or idiom that doesn't match what the file already does.
|
|
129
|
+
- **A new helper duplicating an existing one**: grep for an existing implementation before accepting any new utility — AI assistants generate rather than search.
|
|
130
|
+
- **Unrequested backwards-compat shims**: `_legacy` wrappers, kept old code paths, re-exports nobody asked for — hedging instead of committing to the change.
|
|
131
|
+
- **Stray working files in the diff**: PLAN.md, NOTES.md, scratch scripts, or other session artifacts that shouldn't ship.
|
|
132
|
+
|
|
133
|
+
For the full taxonomy with severity levels and when-it's-NOT-slop guidance, see `code-slop-cleanup/references/slop-patterns.md` (if installed).
|
|
134
|
+
|
|
119
135
|
## Comments: Good vs Bad
|
|
120
136
|
|
|
121
137
|
**Good comments** (keep them):
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-slop-cleanup
|
|
3
|
+
description: "Strip AI slop from a branch diff before PR — judge each hunk against the surrounding file's conventions, remove without changing behavior, re-run tests. Removal only: hunting bugs → code-reviewing; structural improvement → refactoring; repo-wide audit → technical-debt-review; pruning tests → test-suite-design."
|
|
4
|
+
when_to_use: "Triggers: deslop, AI slop, slop cleanup, tighten this diff, remove AI artifacts, clean the diff before PR, debug leftovers, stray PLAN.md, obvious comments, unnecessary try/catch, backwards-compat shim nobody asked for, diff hygiene."
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Write, Edit, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Code Slop Cleanup
|
|
9
|
+
|
|
10
|
+
Strip the residue AI-assisted coding leaves in a branch — obvious comments, defensive theater, debug leftovers, stray files, hedging shims — so the diff that reaches review contains only the change itself. Runs after implementation, before `git-workflow`/`code-reviewing`. This pass **removes**; it never redesigns.
|
|
11
|
+
|
|
12
|
+
## ⛔ The Iron Law
|
|
13
|
+
|
|
14
|
+
**Remove only what you can prove is slop — never change behavior. If a removal could change behavior, keep the code and flag it instead.**
|
|
15
|
+
|
|
16
|
+
Slop cleanup that deletes a load-bearing check trades clutter for a bug — a strictly worse codebase. When in doubt, the code stays and the doubt goes in the report.
|
|
17
|
+
|
|
18
|
+
## Workflow
|
|
19
|
+
|
|
20
|
+
### Step 1: Scope the Diff
|
|
21
|
+
|
|
22
|
+
Branch state vs the default branch (live at skill load):
|
|
23
|
+
|
|
24
|
+
!`git diff main...HEAD --stat 2>/dev/null || git diff master...HEAD --stat 2>/dev/null || true`
|
|
25
|
+
|
|
26
|
+
Run the full `git diff <base>...HEAD` for the hunks, and `git status` for untracked strays — session artifacts (PLAN.md, scratch scripts) often aren't in the diff yet. Only changed/added code is in scope: pre-existing slop belongs to `technical-debt-review`, not this pass.
|
|
27
|
+
|
|
28
|
+
### Step 2: Judge Each Hunk Against Its Surroundings
|
|
29
|
+
|
|
30
|
+
Slop is relative — the same construct is correct in one place and slop in another. For each candidate, read the surrounding file and ask: is this **abnormal for this file's conventions and this codepath's trust level?** A try/catch at a process boundary is protection; the same try/catch deep in a validated internal path is theater. See [references/slop-patterns.md](references/slop-patterns.md) for the full catalog with per-pattern "when it's NOT slop" columns.
|
|
31
|
+
|
|
32
|
+
### Step 3: Classify by Severity
|
|
33
|
+
|
|
34
|
+
- **High**: debug leftovers, silent-failure handlers, stray working files
|
|
35
|
+
- **Medium**: defensive theater on trusted paths, generic TODOs, unrequested backwards-compat shims, duplication of existing helpers
|
|
36
|
+
- **Low**: comment slop, dead weight (unused imports, `=== true`, redundant returns), style inconsistent with the file
|
|
37
|
+
|
|
38
|
+
### Step 4: Strip — Deletions Only, Production Code Only
|
|
39
|
+
|
|
40
|
+
Apply removals highest severity first. Every edit must be a behavior-preserving deletion (or a trivial inlining a deletion forces). If removing something requires *rewriting* logic around it, that's refactoring — leave it and flag it.
|
|
41
|
+
|
|
42
|
+
**The two test rules:**
|
|
43
|
+
1. A test failing after a production-code removal is the oracle saying the removal changed behavior. **Revert the removal. Never edit the test.**
|
|
44
|
+
2. Slop *inside test files* (redundant tests, trivial asserts, mock-testing) is flagged and routed to `test-suite-design` — never deleted here. A test's value can't be judged from the diff alone.
|
|
45
|
+
|
|
46
|
+
### Step 5: Re-Run the Tests
|
|
47
|
+
|
|
48
|
+
Run the project's test suite fresh and read the output (`verification-before-completion`). Green is the proof the removals were behavior-preserving; a failure means Step 4's rule 1 applies to the offending removal.
|
|
49
|
+
|
|
50
|
+
### Step 6: Report the Tightened Diff
|
|
51
|
+
|
|
52
|
+
Show what was removed, grouped by category with counts, plus a **flagged-not-removed** list: anything kept under the Iron Law's doubt clause, test-file slop routed to `test-suite-design`, suspected bugs routed to `code-reviewing`/`bug-investigating`.
|
|
53
|
+
|
|
54
|
+
## Prevention: Reuse Before Write
|
|
55
|
+
|
|
56
|
+
The biggest slop category — duplication — is created at generation time and only caught at review time. Before writing any new helper, **grep the codebase for an existing one** (name fragments, the operation's key terms, the module where it would live). AI assistants generate what looks plausible instead of searching for what exists; searching first is the cheap counter.
|
|
57
|
+
|
|
58
|
+
## Boundaries — What This Skill Never Does
|
|
59
|
+
|
|
60
|
+
- **Never adds code** — no new abstractions, no "while I'm here" improvements.
|
|
61
|
+
- **Found a bug?** Flag it and route to `code-reviewing`/`bug-investigating`. Fixing bugs mid-cleanup makes both the cleanup and the fix unreviewable.
|
|
62
|
+
- **Structural cleanup** → `refactoring`. Most slop cleanup is a micro-refactor, and the two chain naturally: strip slop first, then refactor what remains — but extraction, moving, and re-abstraction are the refactoring skill's discipline (test-protected, one transformation at a time).
|
|
63
|
+
- **Whole-repo slop** → `technical-debt-review` with its slop debt categories.
|
|
64
|
+
|
|
65
|
+
## Rationalizations to Reject
|
|
66
|
+
|
|
67
|
+
| Excuse | Reality |
|
|
68
|
+
|--------|---------|
|
|
69
|
+
| "This check might catch something someday" | If nothing upstream can produce that state, it's theater — and it hides the real bugs by normalizing noise. |
|
|
70
|
+
| "The comments help junior developers" | Restating comments rot and mislead; code clarity helps juniors. Keep why-comments, cut what-comments. |
|
|
71
|
+
| "I'll just fix this bug while I'm here" | Cleanup and fixes in one pass make both unreviewable. Flag it, route it, finish the cleanup. |
|
|
72
|
+
| "Strip it all — defensive code is slop" | A boundary check is not slop. Over-removal breaks behavior, the one thing this pass must never do. |
|
|
73
|
+
| "This test is obviously redundant, I'll just delete it" | "Obviously" is a guess; proof requires the behavior map. Route to `test-suite-design`. |
|
|
74
|
+
|
|
75
|
+
## Red Flags — Stop and Revert
|
|
76
|
+
|
|
77
|
+
- You modified a conditional's logic instead of deleting something.
|
|
78
|
+
- A test failed and you're editing the test.
|
|
79
|
+
- You deleted a test.
|
|
80
|
+
- You removed validation at a public, API, or user-input boundary.
|
|
81
|
+
- You added anything.
|
|
82
|
+
|
|
83
|
+
## Cross-Skill References
|
|
84
|
+
|
|
85
|
+
- `refactoring` — structural improvement after the slop is gone; this skill deletes, that one reshapes
|
|
86
|
+
- `code-reviewing` — the review this pass prepares the diff for; bugs found here route there
|
|
87
|
+
- `test-suite-design` — pruning test-file slop with behavior-map proof
|
|
88
|
+
- `technical-debt-review` — repo-scoped slop audit (type/config/doc-drift debt)
|
|
89
|
+
- `git-workflow` — the pre-PR self-review this pass feeds into
|
|
90
|
+
- `verification-before-completion` — the fresh-test-run gate behind Step 5
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "code-slop-cleanup",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "Clean the AI slop out of this branch diff before I open the PR. The diff adds a discount calculator to our Node service:\n\n```diff\n+++ b/src/pricing/discount.js\n+// This function calculates the discount for an order\n+function calculateDiscount(order) {\n+ // Check that order is not null or undefined or empty\n+ if (order !== null && order !== undefined && order !== '') {\n+ console.log('entering calculateDiscount', order);\n+ // ============ MAIN LOGIC ============\n+ const rate = order.total > 100 ? 0.1 : 0;\n+ console.log('rate computed', rate);\n+ return order.total * rate;\n+ }\n+ return undefined;\n+}\n+// Legacy export kept for backwards compatibility just in case\n+module.exports = { calculateDiscount, calculateDiscount_legacy: calculateDiscount };\n+++ b/src/pricing/discount.test.js\n+test('calculateDiscount exists', () => {\n+ expect(typeof calculateDiscount).toBe('function');\n+});\n+test('applies 10% over 100', () => {\n+ expect(calculateDiscount({ total: 200 })).toBe(20);\n+});\n+++ b/PLAN.md\n+# Implementation plan\n+- [x] add discount fn\n```\n\nNote: calculateDiscount is only called from checkout.js, which already validates the order object. There is no other consumer of the module.",
|
|
7
|
+
"expected_output": "Identifies each slop category present (restating/narration comments and section divider, debug console.logs, triple null check on an internally-validated path, redundant `return undefined`, unrequested `_legacy` re-export, stray PLAN.md), classifies findings by severity, states that removals must preserve behavior and that tests must be re-run after stripping, and flags the trivial `typeof` test as test slop routed to test-suite-design rather than deleting it.",
|
|
8
|
+
"assertions": [
|
|
9
|
+
"Identifies the restating/obvious comments (and section divider) as comment slop",
|
|
10
|
+
"Identifies the console.log statements as debug leftovers",
|
|
11
|
+
"Identifies the triple null/undefined/empty check as defensive theater given the caller already validates the order",
|
|
12
|
+
"Identifies the unrequested `calculateDiscount_legacy` re-export as a backwards-compat shim to remove",
|
|
13
|
+
"Identifies PLAN.md as a stray working artifact that should not ship",
|
|
14
|
+
"Classifies findings by severity (debug leftovers/stray files ranked above comment slop)",
|
|
15
|
+
"States that removals must be behavior-preserving and recommends re-running the tests after stripping",
|
|
16
|
+
"Flags the trivial `typeof` test as test slop but routes it to test-suite-design instead of deleting it during cleanup"
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"id": 2,
|
|
21
|
+
"prompt": "Deslop this diff — my agent went overboard with defensive code:\n\n```diff\n+++ b/src/api/webhooks.js\n+// ============ WEBHOOK HANDLER ============\n+async function handleWebhook(req, res) {\n+ if (!req.body || typeof req.body.event !== 'string') {\n+ return res.status(400).json({ error: 'invalid payload' });\n+ }\n+ let enriched;\n+ try {\n+ enriched = await crmClient.enrich(req.body.event);\n+ } catch (err) {\n+ logger.warn({ err }, 'CRM enrichment failed, continuing without');\n+ enriched = null;\n+ }\n+ await store.save(req.body.event, enriched);\n+ res.status(204).end();\n+}\n```\n\nStrip all the defensive stuff so it reads clean.",
|
|
22
|
+
"expected_output": "Removes only the section-divider comment. Explains that the payload validation guards a public HTTP boundary handling untrusted input and the try/catch wraps an external CRM network call with a deliberate, logged degradation path — both are legitimate defensive code, not slop, because slop is judged relative to the codepath's trust level. Declines the instruction to strip all defensive code.",
|
|
23
|
+
"assertions": [
|
|
24
|
+
"Does NOT flag the request-body validation as slop, identifying it as a public/untrusted input boundary",
|
|
25
|
+
"Does NOT remove the try/catch around the external CRM call, noting it is an external network call with logged, deliberate degradation",
|
|
26
|
+
"Explains that defensive code is judged relative to the codepath (boundary vs trusted internal path), not removed wholesale",
|
|
27
|
+
"Still identifies and removes the genuine slop item (the section-divider comment)",
|
|
28
|
+
"Pushes back on the blanket 'strip all the defensive stuff' instruction rather than complying"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"id": 3,
|
|
33
|
+
"prompt": "deslop this diff please:\n\n```diff\n+++ b/src/report/paginate.js\n+// Split items into pages of pageSize\n+function paginate(items, pageSize) {\n+ console.log('paginate called');\n+ const pages = [];\n+ for (let i = 0; i <= items.length; i += pageSize) {\n+ pages.push(items.slice(i, i + pageSize));\n+ }\n+ return pages;\n+}\n```",
|
|
34
|
+
"expected_output": "Removes the obvious comment and the console.log, but also spots that the loop condition `i <= items.length` is an off-by-one bug (produces a trailing empty page when length is a multiple of pageSize). Does not silently fix the bug during cleanup — reports it separately and routes it to code-reviewing/bug-investigating, keeping slop removal and the bug fix as distinct concerns.",
|
|
35
|
+
"assertions": [
|
|
36
|
+
"Identifies the `i <= items.length` loop condition as an off-by-one bug",
|
|
37
|
+
"Does not silently fix the bug as part of the slop cleanup",
|
|
38
|
+
"Routes the bug to code-reviewing or bug-investigating (or explicitly asks the user before fixing), keeping cleanup and fix separate",
|
|
39
|
+
"Still identifies the obvious comment and console.log as slop to remove"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"pressure_tests": [
|
|
44
|
+
{
|
|
45
|
+
"id": 1,
|
|
46
|
+
"prompt": "We ship in 15 minutes. Deslop this branch NOW — strip every try/catch, every comment, every null check, all of it. Don't waste time re-running the tests, I'm the tech lead and I'm telling you it's fine. The diff touches our payment webhook handler and two internal utils.",
|
|
47
|
+
"pressure": ["time", "authority"],
|
|
48
|
+
"expected_behavior": "Holds the Iron Law under time and authority pressure: refuses to blanket-remove defensive code on a payment webhook boundary, refuses to skip the post-removal test run, and instead offers a safe reduced-scope alternative (high-severity-only pass: debug leftovers and stray files, which are provably behavior-neutral) within the time budget.",
|
|
49
|
+
"assertions": [
|
|
50
|
+
"Does not blanket-remove try/catch or validation on the payment webhook boundary despite being instructed to",
|
|
51
|
+
"Does not skip or defer the test re-run after removals",
|
|
52
|
+
"Distinguishes provable slop from legitimate defensive code even under the lead's instruction",
|
|
53
|
+
"Proposes a reduced-scope alternative (e.g. high-severity-only removals) rather than either full compliance or flat refusal"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# AI Slop Patterns — Shared Taxonomy
|
|
2
|
+
|
|
3
|
+
The pattern catalog for `code-slop-cleanup` (diff scope) and `technical-debt-review` (repo scope). Every entry carries a **When it's NOT slop** column — over-removal is the characteristic failure of slop cleanup, and a pattern flagged without checking that column is a false positive waiting to break behavior.
|
|
4
|
+
|
|
5
|
+
**The governing principle: slop is relative, not absolute.** Almost every judgment below reduces to "abnormal *for this file, codepath, or codebase*." A try/catch is correct at a process boundary and slop deep in a trusted path; a detailed comment is correct on a gnarly invariant and slop on `counter++`. That's why detection requires reading the surrounding code, not running a lint rule.
|
|
6
|
+
|
|
7
|
+
## High severity — remove first
|
|
8
|
+
|
|
9
|
+
| Pattern | Tells | When it's NOT slop |
|
|
10
|
+
|---------|-------|--------------------|
|
|
11
|
+
| **Debug leftovers** | `console.log`/`print` debugging, function entry/exit logging, dump-everything statements | Structured logging through the project's logger at intentional log points |
|
|
12
|
+
| **Silent-failure handlers** | Empty catch blocks; `catch (e) { console.log(e) }` and continue; fallback values that mask real errors (`?? defaultValue` hiding a failed fetch) | Deliberate, documented degradation (feature flag off, optional enhancement) where the fallback is a product decision |
|
|
13
|
+
| **Stray working files** | `PLAN.md`, `NOTES.md`, `SCRATCH.md`, `SUMMARY.md`, one-off test scripts, session artifacts committed to the tree | Files the project's conventions actually track (an ADR, a checked-in design doc in `docs/`) |
|
|
14
|
+
|
|
15
|
+
## Medium severity
|
|
16
|
+
|
|
17
|
+
| Pattern | Tells | When it's NOT slop |
|
|
18
|
+
|---------|-------|--------------------|
|
|
19
|
+
| **Defensive theater** | try/catch on trusted internal paths; triple null checks (`!== null && !== undefined && !== ''`); re-validation of input already validated upstream; guards for states nothing can produce | Process boundaries, external API calls, user input, deserialization — anywhere the input is genuinely untrusted or the failure genuinely reachable |
|
|
20
|
+
| **Generic TODOs** | `// TODO: handle errors`, `// TODO: improve this` — no context, no ticket, no owner | TODO with a ticket reference or a concrete, actionable description |
|
|
21
|
+
| **Unrequested backwards-compat shims** | `_legacy` wrappers, kept old code paths "just in case", re-exports nobody consumes, dual old/new implementations | A migration the plan actually calls for, with a removal date or ticket |
|
|
22
|
+
| **Duplication of existing helpers** | A new utility that re-implements something already in the codebase or stdlib; parallel functions differing by a constant | Genuinely different concepts that happen to look similar (false DRY is worse than repetition) |
|
|
23
|
+
|
|
24
|
+
## Low severity — cosmetic residue
|
|
25
|
+
|
|
26
|
+
| Pattern | Tells | When it's NOT slop |
|
|
27
|
+
|---------|-------|--------------------|
|
|
28
|
+
| **Comment slop** | Comments restating the code (`// increment counter`), section dividers, agent narration ("Here we now handle…"), docstrings repeating the signature, journal comments | Why-comments on non-obvious decisions; consequence warnings; docstrings on public API the project mandates |
|
|
29
|
+
| **Dead weight** | Unused imports/params/variables, `return undefined`, `=== true`, `Promise.all` around a single promise, unreachable branches | Parameters required by an interface/callback signature; re-exports that are the module's public API |
|
|
30
|
+
| **Style inconsistency** | Naming, formatting, or idiom that doesn't match the surrounding file (e.g. `fetchData` in a file that uses `getX` everywhere) | The file itself is inconsistent and the new code follows the project-level convention |
|
|
31
|
+
|
|
32
|
+
## Routed patterns — flag here, fix elsewhere
|
|
33
|
+
|
|
34
|
+
These are slop, but this catalog's consumers don't fix them in place:
|
|
35
|
+
|
|
36
|
+
| Pattern | Tells | Route to |
|
|
37
|
+
|---------|-------|----------|
|
|
38
|
+
| **Test-file slop** | Redundant/duplicate tests, trivial asserts (`expect(true)`), asserting on the mock, implementation-mirroring tests | `test-suite-design` (Pruning Test Slop) — deleting a test is never behavior-neutral for the safety net; it needs behavior-map judgment. **Never delete a test during diff cleanup.** |
|
|
39
|
+
| **Type slop** | `any`/`unknown` to silence the checker, casts papering over mismatches, single-implementer interfaces "for testing", overly broad types | `technical-debt-review` (type debt) — usually cross-file; fixing it changes signatures |
|
|
40
|
+
| **Config/scaffolding slop** | Config keys and feature flags nothing reads, orphan `.env` entries, checked-in generated files, half-finished TODO scaffolds | `technical-debt-review` (config/scaffolding debt) — proving "unread" needs repo-wide tracing |
|
|
41
|
+
| **Documentation drift** | README/docs describing endpoints, flags, or behavior that no longer exists | `technical-debt-review` (documentation drift) — needs docs-vs-code reconciliation, not deletion |
|
|
42
|
+
| **Structural slop** | Three different patterns for the same concern, business logic in controllers, circular imports | `refactoring` / `architecture-design` — structural change, not removal |
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: dependency-management
|
|
3
|
-
description: "Evaluate, audit, and upgrade project dependencies — assess libraries before adoption, audit CVEs, plan major upgrades, resolve conflicts.
|
|
3
|
+
description: "Evaluate, audit, and upgrade project dependencies — assess libraries before adoption, audit CVEs, plan major upgrades, resolve conflicts."
|
|
4
|
+
when_to_use: "Triggers: should I use this library, npm audit, upgrade dependencies, dependency vulnerability, outdated packages, evaluate this package, is this library maintained, dependency conflict, lock file, breaking changes in upgrade, slopsquatting, package hallucination, does this package exist, verify package name, AI suggested this library."
|
|
4
5
|
allowed-tools: Read, Grep, Glob, Write, Edit, WebFetch, WebSearch
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -24,7 +25,16 @@ Before evaluating any library, check if the need can be met without one:
|
|
|
24
25
|
|
|
25
26
|
A dependency is justified when it provides substantial, maintained functionality that would be costly and error-prone to build yourself (e.g., cryptography, date handling with timezones, database drivers, authentication).
|
|
26
27
|
|
|
27
|
-
### Step 2:
|
|
28
|
+
### Step 2: Verify the Package Exists (anti-slopsquatting)
|
|
29
|
+
|
|
30
|
+
Before evaluating anything else, confirm the package is real and is the one you think it is. AI assistants hallucinate plausible package names at a measurable rate (~20% of AI package recommendations reference packages that don't exist), and attackers register those exact names to deliver malware — **slopsquatting**. A hallucinated name passes every traditional typo filter because it collides with nothing.
|
|
31
|
+
|
|
32
|
+
- **Confirm the exact name exists in the registry** (`npm view <pkg>`, the PyPI project page) and that the registry entry's repository link points to the project you expect.
|
|
33
|
+
- **Check adoption history over time** — steady downloads across months, not a package registered last week. A brand-new package with a burst of installs matching an AI-suggested name is the attack signature.
|
|
34
|
+
- **Check typo-distance from a popular package.** Hallucinations often shadow a real name (e.g. `unused-imports` vs the real `eslint-plugin-unused-imports`). If a more popular near-neighbor exists, you probably want the neighbor.
|
|
35
|
+
- **Treat any AI-suggested package name as unverified input.** Verify it the same way you'd verify a URL from an untrusted source — before it reaches `npm install`.
|
|
36
|
+
|
|
37
|
+
### Step 3: Evaluate the Library
|
|
28
38
|
|
|
29
39
|
For any library under consideration, assess these dimensions:
|
|
30
40
|
|
|
@@ -56,7 +66,7 @@ For any library under consideration, assess these dimensions:
|
|
|
56
66
|
|
|
57
67
|
See [references/evaluation-checklist.md](references/evaluation-checklist.md) for the structured assessment template.
|
|
58
68
|
|
|
59
|
-
### Step
|
|
69
|
+
### Step 4: Present the Recommendation
|
|
60
70
|
|
|
61
71
|
For the user, summarize:
|
|
62
72
|
- **Recommendation**: Use / Don't use / Consider alternative
|
|
@@ -100,6 +100,7 @@ The PR description should let a reviewer understand the change without reading e
|
|
|
100
100
|
Before requesting review:
|
|
101
101
|
- [ ] Read through the entire diff one more time
|
|
102
102
|
- [ ] Are there any debugging leftovers?
|
|
103
|
+
- [ ] Any stray working artifacts (PLAN.md, NOTES.md, scratch files, one-off test scripts) that shouldn't ship?
|
|
103
104
|
- [ ] Are there any changes that don't belong in this PR?
|
|
104
105
|
- [ ] Is the PR a reasonable size? (Under 400 lines changed is ideal. Over 800 is a red flag.)
|
|
105
106
|
|
|
@@ -140,4 +141,5 @@ See [references/conventions.md](references/conventions.md) for branch naming con
|
|
|
140
141
|
|
|
141
142
|
- `release-management` — cutting the release these commits accumulate into: semver, changelog, tagging, publishing
|
|
142
143
|
- `code-reviewing` — reviewing the PR the description introduces
|
|
144
|
+
- `code-slop-cleanup` — tighten the diff (AI artifacts, debug leftovers, stray files) before the self-review
|
|
143
145
|
- `verification-before-completion` — run the proving commands before pushing or opening the PR
|
|
@@ -107,4 +107,4 @@ For code-level documentation (JSDoc, Python docstrings, Go doc comments):
|
|
|
107
107
|
|
|
108
108
|
- **KISS**: Write the minimum documentation that makes the project usable. Don't over-document internals.
|
|
109
109
|
- **DRY**: Don't duplicate information across docs. Link between documents instead.
|
|
110
|
-
- **YAGNI**: Don't write architecture docs for a 200-line script. Match documentation depth to project complexity.
|
|
110
|
+
- **YAGNI**: Don't write architecture docs for a 200-line script. Match documentation depth to project complexity. And don't create docs nobody asked for — a doc that merely restates the code is doc-slop: it goes stale immediately and buries the docs that answer real questions. Every document must answer a question someone actually has.
|
|
@@ -87,3 +87,4 @@ After completing the planned sequence:
|
|
|
87
87
|
|
|
88
88
|
- `technical-debt-review` — use to identify which areas are worth refactoring at a strategic level before starting
|
|
89
89
|
- `dependency-impact-analysis` — use before refactoring a shared component or public interface to understand blast radius
|
|
90
|
+
- `code-slop-cleanup` — most slop cleanup *is* a micro-refactor: use that skill for the pre-PR diff-scoped pass (removal-only, judged against file conventions); use this one when the cleanup turns structural (extract, move, re-abstract). They chain naturally: strip slop first, then refactor what remains
|
|
@@ -125,6 +125,7 @@ installed skill by name, regardless of role.
|
|
|
125
125
|
- **security-audit** — OWASP Top 10, auth/authz, injection, secrets, dependency CVEs
|
|
126
126
|
- **performance-optimization** — N+1, algorithmic complexity, caching, bundle size
|
|
127
127
|
- **refactoring** — systematic, test-protected code improvement
|
|
128
|
+
- **code-slop-cleanup** — strip AI slop from the branch diff before PR: comment slop, debug leftovers, defensive theater, stray working files, compat shims. Most slop cleanup is a micro-refactor: invoke this for the diff-scoped removal pass, `refactoring` when cleanup turns structural — chain both when a request spans them
|
|
128
129
|
- **technical-debt-review** — codebase health, hotspots, remediation roadmap
|
|
129
130
|
- **project-review** — whole-project execution health: scope alignment, roadmap adherence, implementation maturity, evidence-it-works
|
|
130
131
|
- **code-archaeology** — understand unfamiliar/legacy code first: history mining, tracing, characterization tests
|
|
@@ -180,8 +181,8 @@ When work spans phases, chain skills rather than improvising:
|
|
|
180
181
|
`brainstorming` (if the idea is still fuzzy) → `feature-planning` →
|
|
181
182
|
`architecture-design` (if structural) → `data-modeling` (if schema) →
|
|
182
183
|
`threat-modeling` (if new trust boundaries) → `plan-execution` (work the
|
|
183
|
-
approved plan; wraps `tdd-workflow` per task) → `code-
|
|
184
|
-
`deployment-checklist`
|
|
184
|
+
approved plan; wraps `tdd-workflow` per task) → `code-slop-cleanup` (strip AI
|
|
185
|
+
artifacts from the diff) → `code-reviewing` → `deployment-checklist`
|
|
185
186
|
|
|
186
187
|
**Bug / incident**
|
|
187
188
|
`incident-response` (if prod is down) → `bug-investigating` → `tdd-workflow`
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd-workflow
|
|
3
|
-
description: "Guide test-driven development with red-green-refactor.
|
|
3
|
+
description: "Guide test-driven development with red-green-refactor. For NEW code via test-first — use test-suite-design for adding tests to existing code."
|
|
4
|
+
when_to_use: "Triggers: use tdd, test first, write the tests, red green refactor, test-driven, what should I test, write tests before code, failing test, implement using TDD."
|
|
4
5
|
allowed-tools: Read, Grep, Glob, Write, Edit, Bash
|
|
5
6
|
---
|
|
6
7
|
|
|
@@ -138,6 +139,7 @@ These are the excuses that lead to skipping the test. None of them hold up.
|
|
|
138
139
|
- A new test passes the first time you run it (you never saw RED).
|
|
139
140
|
- You can't explain why the test failed in the RED phase.
|
|
140
141
|
- You're glancing at not-yet-deleted draft code while writing the "test-first" version.
|
|
142
|
+
- You're editing the *test* to make it pass — the test was the spec; change the code, or escalate if the spec itself is wrong.
|
|
141
143
|
|
|
142
144
|
## Cross-Skill References
|
|
143
145
|
|
|
@@ -25,6 +25,7 @@ Don't try to review everything. Focus on where pain is concentrated.
|
|
|
25
25
|
- Files changed in almost every PR — high churn indicates poor separation of concerns or missing abstractions
|
|
26
26
|
- Files that always require changes together — tight coupling that should be decoupled
|
|
27
27
|
- Files with frequent bug fixes — instability indicates unclear ownership or poor test coverage
|
|
28
|
+
- AI-assisted bulk commits — large multi-file commits landing at once and revised within days; churn-shortly-after-landing is the strongest slop signal
|
|
28
29
|
|
|
29
30
|
**Structural signals:**
|
|
30
31
|
- Circular dependencies between modules
|
|
@@ -48,9 +49,12 @@ For each hotspot, classify the debt:
|
|
|
48
49
|
| **Complexity debt** | Functions/classes doing too much | Extract, decompose, simplify |
|
|
49
50
|
| **Duplication debt** | Same logic in multiple places | Extract shared abstraction |
|
|
50
51
|
| **Test debt** | Missing or low-quality tests | Add tests before refactoring anything else |
|
|
51
|
-
| **Documentation debt** | Undocumented non-obvious behavior | Add comments, docstrings, decision records |
|
|
52
|
+
| **Documentation debt** | Undocumented non-obvious behavior (docs *missing*) | Add comments, docstrings, decision records |
|
|
53
|
+
| **Documentation drift** | Docs describing behavior, endpoints, or flags that no longer exist | Fix or delete the stale doc |
|
|
52
54
|
| **Architecture debt** | Wrong abstraction at system level | Restructure, introduce proper boundaries |
|
|
53
55
|
| **Dependency debt** | Outdated, vulnerable, or abandoned libraries | Upgrade or replace |
|
|
56
|
+
| **Type debt** | `any`/casts silencing the checker, single-implementer interfaces "for testing", overly broad types | Restore real types; inline the interface |
|
|
57
|
+
| **Config/scaffolding debt** | Unread config keys/flags, orphan `.env` entries, checked-in generated files, TODO scaffolds | Delete what nothing reads; regenerate instead of committing |
|
|
54
58
|
| **Observability debt** | No logging, metrics, or traceability | Add instrumentation |
|
|
55
59
|
|
|
56
60
|
**Severity:**
|
|
@@ -59,6 +63,19 @@ For each hotspot, classify the debt:
|
|
|
59
63
|
- **Medium**: Painful but workable. Schedule when capacity allows.
|
|
60
64
|
- **Low**: Noticeable but not impeding. Do it opportunistically when touching related code.
|
|
61
65
|
|
|
66
|
+
For the AI-slop lens on these categories (per-pattern tells and when-it's-NOT-slop guidance), read the sibling skill's `code-slop-cleanup/references/slop-patterns.md` if installed.
|
|
67
|
+
|
|
68
|
+
## Audit Integrity — do not generate slop while hunting it
|
|
69
|
+
|
|
70
|
+
A wrong finding costs the audit more credibility than a missed one, and this skill runs in a forked context: the written report is the only artifact that survives, so an unevidenced finding is unfalsifiable downstream. Rules for every finding:
|
|
71
|
+
|
|
72
|
+
- **Evidence or it didn't happen.** Cite `path:line-range` and quote the offending code minimally. No location, no finding.
|
|
73
|
+
- **Argue it, don't label it.** State *why the specific instance is unjustified here* — what it costs and why the pattern lacks a reason that survives scrutiny. "I'd do it differently" is preference, not debt.
|
|
74
|
+
- **Attempt to disprove before flagging.** Trace callers before declaring code dead (dynamic references, string-based lookups, DI, reflection, external consumers); check history before calling a config key unread. If a legitimate reason emerges, downgrade or drop.
|
|
75
|
+
- **Confidence, not assertion.** Unverifiable usage claims get Confidence: Low with a note on what would confirm it — never asserted as fact.
|
|
76
|
+
- **Record what you didn't flag.** An "Explicitly not flagged" section (items considered, reason they survived scrutiny) proves the audit was discerning and stops the team re-litigating.
|
|
77
|
+
- **Log the method.** Tools/passes run with their commands, and anything not covered — unreadable files, missing test env — as named blind spots. If a tool wasn't available, say so; don't fabricate its results.
|
|
78
|
+
|
|
62
79
|
## Step 3: Estimate Effort and Risk
|
|
63
80
|
|
|
64
81
|
For each hotspot, estimate:
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"Categorizes debt by type (complexity, test, architecture, etc.) and severity",
|
|
12
12
|
"Produces a prioritized roadmap with effort estimates",
|
|
13
13
|
"Distinguishes between quick wins, quarterly investments, and strategic changes",
|
|
14
|
-
"Does not recommend a full rewrite without strong justification"
|
|
14
|
+
"Does not recommend a full rewrite without strong justification",
|
|
15
|
+
"States that findings must cite concrete evidence (file/line locations), with unverifiable claims marked low-confidence rather than asserted"
|
|
15
16
|
]
|
|
16
17
|
},
|
|
17
18
|
{
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"Recommends focusing on churn (frequently-changed files) rather than trying to address all debt",
|
|
23
24
|
"Emphasizes that test debt must be addressed before structural debt",
|
|
24
25
|
"Provides a concrete prioritization heuristic (not just 'prioritize by impact')",
|
|
25
|
-
"Acknowledges that low-impact debt can be accepted / deferred",
|
|
26
|
+
"Acknowledges that low-impact debt can be accepted / deferred (accepted or explicitly-not-flagged items are recorded, not silently dropped)",
|
|
26
27
|
"Does not recommend addressing everything at once"
|
|
27
28
|
]
|
|
28
29
|
},
|
|
@@ -29,23 +29,25 @@
|
|
|
29
29
|
|
|
30
30
|
## Debt Inventory
|
|
31
31
|
|
|
32
|
+
Every inventoried item cites evidence (`path:line-range`) and carries a confidence level — Low confidence means "what would confirm this" is stated in the description, not that the claim is asserted anyway.
|
|
33
|
+
|
|
32
34
|
### Critical — Address Immediately
|
|
33
35
|
|
|
34
|
-
| Item | Type |
|
|
35
|
-
|
|
36
|
-
| | | | | |
|
|
36
|
+
| Item | Type | Evidence (path:line) | Description | Confidence | Risk of fix | Effort |
|
|
37
|
+
|------|------|---------------------|-------------|------------|-------------|--------|
|
|
38
|
+
| | | | | | | |
|
|
37
39
|
|
|
38
40
|
### High — Schedule This Quarter
|
|
39
41
|
|
|
40
|
-
| Item | Type |
|
|
41
|
-
|
|
42
|
-
| | | | | | |
|
|
42
|
+
| Item | Type | Evidence (path:line) | Description | Confidence | Risk of fix | Effort | Prerequisite |
|
|
43
|
+
|------|------|---------------------|-------------|------------|-------------|--------|-------------|
|
|
44
|
+
| | | | | | | | |
|
|
43
45
|
|
|
44
46
|
### Medium — Address Opportunistically
|
|
45
47
|
|
|
46
|
-
| Item | Type |
|
|
47
|
-
|
|
48
|
-
| | | | |
|
|
48
|
+
| Item | Type | Evidence (path:line) | Description | Confidence |
|
|
49
|
+
|------|------|---------------------|-------------|------------|
|
|
50
|
+
| | | | | |
|
|
49
51
|
|
|
50
52
|
### Accepted Debt — Won't Address
|
|
51
53
|
|
|
@@ -53,6 +55,14 @@
|
|
|
53
55
|
|------|---------------------|
|
|
54
56
|
| | |
|
|
55
57
|
|
|
58
|
+
### Explicitly Not Flagged
|
|
59
|
+
|
|
60
|
+
Items considered and deliberately not flagged — proves the audit was discerning and prevents re-litigating.
|
|
61
|
+
|
|
62
|
+
| Item considered | Why it survived scrutiny |
|
|
63
|
+
|-----------------|--------------------------|
|
|
64
|
+
| | |
|
|
65
|
+
|
|
56
66
|
---
|
|
57
67
|
|
|
58
68
|
## Remediation Roadmap
|
|
@@ -80,6 +90,20 @@
|
|
|
80
90
|
|
|
81
91
|
---
|
|
82
92
|
|
|
93
|
+
## Method Log
|
|
94
|
+
|
|
95
|
+
- **Passes run**: [map / static sweep / file-by-file / cross-file / history]
|
|
96
|
+
- **Tools and commands**: [e.g. `npx depcheck`, linter, coverage — with observed output; "not available" if a tool couldn't run — never fabricated]
|
|
97
|
+
- **Not covered → blind spots**: [unreadable files, skipped dirs, missing test env]
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Open Questions
|
|
102
|
+
|
|
103
|
+
[Judgment calls that need user input — e.g. which subsystem matters most, unknown team pain points. Never guessed silently.]
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
83
107
|
## Next Review Date
|
|
84
108
|
|
|
85
109
|
[Date — typically 1 quarter from now]
|
|
@@ -127,6 +127,17 @@ After writing the suite, assess quality (not just line coverage percentage):
|
|
|
127
127
|
|
|
128
128
|
Coverage percentage is a floor, not a ceiling. 80% meaningful coverage beats 100% shallow coverage.
|
|
129
129
|
|
|
130
|
+
## Pruning Test Slop
|
|
131
|
+
|
|
132
|
+
Suites accumulate tests that cost maintenance without buying protection — common in AI-assisted codebases, where generated tests pad coverage. Pruning is test-strategy work and belongs here, not in a diff-cleanup pass: deleting a test is never behavior-neutral for the safety net, so it needs behavior-map judgment. A test is a removal candidate when it:
|
|
133
|
+
|
|
134
|
+
- **Asserts nothing meaningful** — `expect(true).toBe(true)` filler, or assertions that cannot fail
|
|
135
|
+
- **Duplicates another test's coverage of the same behavior** — same arrange/act/assert in substance, differing only cosmetically
|
|
136
|
+
- **Asserts on the mock rather than the code** — verifying that the mock returned what it was configured to return tests the mock, not the unit
|
|
137
|
+
- **Mirrors the implementation line-for-line** — breaks on every refactor, catches no behavior change
|
|
138
|
+
|
|
139
|
+
The discipline: map the behaviors first (Step 3), then remove one test at a time, verifying after each removal that every behavior in the map is still covered by a remaining test. That coverage check *is* the proof the test was redundant — without it, "obviously redundant" is a guess. When reviewing a diff rather than a suite, the trivial-assert and mock-testing patterns also appear as test-integrity items in `code-reviewing`'s checklist.
|
|
140
|
+
|
|
130
141
|
## Principles Applied
|
|
131
142
|
|
|
132
143
|
- **DRY in tests**: Share setup through fixtures/factories, but keep each test readable on its own. A little repetition in tests is better than obscure shared state.
|