regression-guard
Skill36 starsChanged 2 months agoApache-2.0View on GitHub
Systematic scan → classify → batch fix → add automation to prevent regression
- Reads credentials
3 other projects use a version of this.
Adopted by
Most recently taken up by
- pym96/skillstheir own version, first seen Oct 20, 2026
- future-mine/claude-skilltheir own version, first seen Oct 8, 2026
- thepictishbeast/claude-toolstheir own version, first seen May 17, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- pym96/skills★ 2same name
- future-mine/claude-skill★ 1same name
- thepictishbeast/claude-tools★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository52 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- arch-specSkill
- code-qualitySkill
- code-reviewSkill
- commitSkill
- coord-delegateSkill
- coord-handoffSkill
- coord-orchestrateSkill
- coord-requestSkill
- coord-reviewSkill
- coord-runSkill
- coord-syncSkill
- dispatchSkill
- edda-releaseSkill
- fleet-epic-splitSkill
- fleet-managerSkill
- fleet-orchestrateSkill
- fleet-pr-loopSkill
- fleet-reviewSkill
- fleet-triadSkill
- fleet-workerSkill
- ground-checkSkill
- health-checkSkill
- intel-scanSkill
- issue-actionSkill
- issue-compactSkill
- issue-createSkill
- issue-intakeSkill
- issue-pipelineSkill
- issue-planSkill
- issue-scanSkill
- parallel-waveSkill
- path-forwardSkill
- plan-decomposeSkill
- plan-validateSkill
- pr-checkSkill
- project-planSkill
- Project PrinciplesSkill
- pr-review-loopSkill
- pr-reviewSkill
- pull-requestSkill
- skill-aliasSkill
- skill-craftSkill
- skill-testSkill
- spec-review-modesSkill
- tech-debtSkill
- testingSkill
- tracking-issueSkill
- verifiable-goal-loopSkill
- fleet-orchestrateSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 89
After fixing a class of problems, add automated prevention.
- Very specific: line 106
Create or extend eslint.config.mjs:
- Distinctive: line 165
Integration: Add to pre-commit (lefthook) or CI
- Distinctive: line 177
Add to CLAUDE.md or project docs:
- Distinctive: line 191
Run a full audit across all categories.
- Distinctive: line 195
Run scan for each category: type-safety, error-handling, security, testing, dead-code
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Regression Guard — Scan, Fix, Prevent
When you fix a bug or quality issue, don't just fix it — add automated prevention so it can never happen again. This skill follows a systematic approach: scan the entire codebase for a class of problems, classify findings, batch fix, then add tooling to prevent regression.
Inspired by: vm0 e7h4n's pattern — "修了就防回歸"
Your args are: $ARGUMENTS
Parse the args:
scan <category>— Scan codebase for a specific problem categoryguard <description>— After fixing something, add regression preventionaudit— Full audit across all categories
Categories: type-safety, error-handling, security, testing, dead-code, performance, dependencies
Operation 1: Scan
Systematically scan the codebase for a class of problems, classify by severity, produce an actionable report.
Step 1: Choose Scanning Tools
| Category | Tools |
| type-safety | bun run lint, grep "as any|@ts-ignore" |
| error-handling | grep "try.*catch", grep "console.error" |
| security | grep "eval|exec|innerHTML", grep "password|secret|token" in non-.env |
| testing | grep "\.skip|\.only", grep "setTimeout" in *.test.ts |
| dead-code | bun run knip, grep "// TODO|// FIXME|// HACK" |
| performance | grep "JSON.parse.*JSON.stringify" (deep clone), grep "\.forEach" in hot paths |
| dependencies | npm audit, bun run knip |
Step 2: Run Scans
Execute ALL relevant scans and collect raw output:
# Example for type-safety
bun run lint 2>&1 | grep "error\|warning" > /tmp/scan-results.txt
grep -rn "as any\|@ts-ignore\|@ts-nocheck" src/ --include="*.ts" >> /tmp/scan-results.txt
wc -l /tmp/scan-results.txtStep 3: Classify Findings
Group findings into:
## Scan Results: <category>
### P0 — Fix Now (breaks correctness or security)
| File:Line | Issue | Pattern |
|-----------|-------|---------|
| src/X.ts:42 | ... | ... |
### P1 — Fix Soon (code smell, maintainability risk)
| File:Line | Issue | Pattern |
|-----------|-------|---------|
### P2 — Nice to Have (style, minor improvement)
| File:Line | Issue | Pattern |
|-----------|-------|---------|
### Recurring Patterns
<identify the 2-3 patterns that appear most often — these are the targets for automation>Step 4: Create Issues
For each P0/P1 group, create a batch-fix issue:
gh issue create --title "fix(<scope>): <pattern description>" --body "..."Group by pattern, not by file. One issue per pattern, not per finding.
Operation 2: Guard
After fixing a class of problems, add automated prevention.
Step 1: Identify the Guard Type
| Problem Type | Guard Mechanism |
as any / unsafe types | ESLint rule: @typescript-eslint/no-explicit-any (already have) |
| Specific anti-pattern | Custom ESLint rule (new plugin) |
| Missing validation | Test case that fails without validation |
| Architecture violation | Import restriction (ESLint no-restricted-imports) |
| Security issue | Grep-based CI check |
| Dead code | Knip in pre-commit |
Step 2: Implement the Guard
Option A: Custom ESLint Rule (for code patterns)
Create or extend eslint.config.mjs:
// Example: prevent db.prepare().all() without type assertion
{
rules: {
'no-restricted-syntax': ['error', {
selector: 'CallExpression[callee.property.name="all"]:not([parent.type="TSAsExpression"])',
message: 'db.prepare().all() must have a type assertion: .all() as SomeType[]'
}]
}
}Option B: Import Restriction (for architecture violations)
// Example: prevent sidecar/ from importing engine-specific code
{
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: ['cc', 'cc/*', '@cocos/*'],
message: 'Engine imports not allowed outside adapters/'
}]
}]
}
}Option C: Test Guard (for logic invariants)
// Example: ensure Safety Invariants can't be overridden
describe('SI override resistance', () => {
it('permissive constitution cannot override SI-1', () => {
// Create maximally permissive constitution
// Verify SI-1 still blocks
});
});Option D: CI Script (for complex checks)
#!/bin/bash
# scripts/check-no-floating-promises.sh
VIOLATIONS=$(grep -rn "^\s*\w\+Async()" src/ --include="*.ts" | grep -v "await\|void\|\.then\|\.catch")
if [ -n "$VIOLATIONS" ]; then
echo "Floating promises found:"
echo "$VIOLATIONS"
exit 1
fiStep 3: Verify the Guard Works
- Positive test: Introduce the bad pattern → guard catches it
- Negative test: Clean code → guard passes
- Integration: Add to pre-commit (lefthook) or CI
# Test that the guard catches the bad pattern
echo "const x: any = 1;" > /tmp/test-guard.ts
bun run lint /tmp/test-guard.ts 2>&1 | grep "error"
# Should show the lint error
rm /tmp/test-guard.tsStep 4: Document the Guard
Add to CLAUDE.md or project docs:
### Guard: <pattern name>
- **What**: <what it prevents>
- **Why**: <the incident that led to this guard>
- **How**: <ESLint rule / test / CI script>
- **Verification**: `<command to verify guard works>`Operation 3: Audit
Run a full audit across all categories.
Workflow
- Run scan for each category: type-safety, error-handling, security, testing, dead-code
- Aggregate findings into a single report
- Identify top 3 recurring patterns
- For each pattern, recommend a guard mechanism
Output
## Full Audit Report
**Date**: YYYY-MM-DD
**Total findings**: N
### By Category
| Category | P0 | P1 | P2 | Top Pattern |
|----------|----|----|----|--------- ---|
| type-safety | 2 | 15 | 30 | unsafe DB query returns |
| error-handling | 0 | 5 | 10 | defensive try/catch |
| security | 1 | 2 | 0 | hardcoded URL |
| testing | 0 | 3 | 8 | setTimeout in tests |
| dead-code | 0 | 2 | 5 | unused exports |
### Top 3 Patterns to Guard
1. **<pattern>** — N occurrences, guard: <mechanism>
2. **<pattern>** — N occurrences, guard: <mechanism>
3. **<pattern>** — N occurrences, guard: <mechanism>
### Recommended Actions
1. [ ] Fix P0 issues immediately
2. [ ] Create batch-fix issues for P1 patterns
3. [ ] Add guards for top 3 patternsKey Principles
- Fix by pattern, not by instance — if you find 10 occurrences of the same problem, fix all 10 in one PR and add a guard
- Every fix needs a guard — the fix is only half done without regression prevention
- Automation > documentation — a lint rule is better than a CLAUDE.md note; a CI check is better than a code comment
- Incremental hardening — don't try to fix everything at once. Pick the top pattern, fix it, guard it, move to the next
- The guard IS the documentation — the lint rule message or test name explains why the pattern is forbidden
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

