dev-refactor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dev-refactor (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
// Before
function processOrder(order) {
// 20 lines of validation
// 30 lines of calculation
// 10 lines of sending
}
// After
function processOrder(order) {
validateOrder(order);
const total = calculateTotal(order);
sendConfirmation(order, total);
}// Before
if (user.age >= 18 && user.country === 'FR' && !user.banned) { }
// After
const isAdult = user.age >= 18;
const isFrench = user.country === 'FR';
const isActive = !user.banned;
if (isAdult && isFrench && isActive) { }// Before
function getPrice(type) {
switch(type) {
case 'basic': return 10;
case 'premium': return 20;
}
}
// After
interface Plan { getPrice(): number }
class BasicPlan implements Plan { getPrice() { return 10; } }
class PremiumPlan implements Plan { getPrice() { return 20; } }| Smell | Refactoring |
|---|---|
| Long method | Extract Method |
| Large class | Extract Class |
| Duplicate code | Extract + Reuse |
| Long parameter list | Parameter Object |
| Feature envy | Move Method |
| Primitive obsession | Value Object |
| Metric | Alert threshold | How to measure |
|---|---|---|
| Cyclomatic complexity | > 10 per function | Number of branches (if/else/switch) |
| Nesting depth | > 3 levels | Nesting of if/for/while |
| Function length | > 50 lines | Number of lines |
| Number of parameters | > 4 | Function parameters |
| Afferent/efferent coupling | Unstable ratio | Incoming/outgoing dependencies |
| File size | > 300 lines | Lines of code |
#### Early Return (eliminate nesting)
// BEFORE: deep nesting (high entropy)
function process(user) {
if (user) {
if (user.isActive) {
if (user.hasPermission) {
return doWork(user);
}
}
}
return null;
}
// AFTER: early returns (low entropy)
function process(user) {
if (!user) return null;
if (!user.isActive) return null;
if (!user.hasPermission) return null;
return doWork(user);
}#### Break down complex conditions
// BEFORE
if (user.age >= 18 && user.country === 'FR' && !user.banned && user.email.includes('@')) { }
// AFTER
const isEligible = user.age >= 18
&& user.country === 'FR'
&& !user.banned
&& isValidEmail(user.email);
if (isEligible) { }#### Eliminate dead code
# Find unused exports
# Find functions never called
# Remove unused imports
# Remove obsolete comments
# Remove orphan files#### Consolidate duplications
Rule of 3: refactor on the 3rd duplication, not before.
- 1st occurrence: write the code
- 2nd occurrence: note the duplication (comment)
- 3rd occurrence: extract into a function/module~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.