fai-refactor-skill — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited fai-refactor-skill (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.
Apply safe refactoring with behavior preservation and test validation.
# Before
def process(data):
# validate
if not data: raise ValueError()
if len(data) > 1000: raise ValueError("too large")
# transform
result = [item.strip().lower() for item in data]
# save
db.save(result)
# After
def process(data):
validate(data)
result = transform(data)
save(result)# Before
base = order.quantity * order.price
discount = base * 0.1 if order.is_bulk else 0
total = base - discount
# After
def base_price(order): return order.quantity * order.price
def discount(order): return base_price(order) * 0.1 if order.is_bulk else 0
def total(order): return base_price(order) - discount(order)# Before
def search(query, limit, offset, sort_by, sort_dir, filters):
pass
# After
@dataclass
class SearchParams:
query: str
limit: int = 10
offset: int = 0
sort_by: str = "relevance"
sort_dir: str = "desc"
filters: dict = field(default_factory=dict)
def search(params: SearchParams):
pass| Rule | Why |
|---|---|
| Tests pass before AND after | Proves no behavior change |
| One refactoring per commit | Easy to bisect and revert |
| No feature changes mixed in | Separate refactor from feature PRs |
| Measure complexity before/after | Prove improvement |
| Issue | Cause | Fix |
|---|---|---|
| Tests break | Changed behavior | Undo, refactor without changing logic |
| Too many changes at once | Not incremental | One pattern per commit |
| Can't test private methods | Testing implementation | Test public behavior instead |
| Performance regression | Added indirection | Profile before and after |
| Practice | Rationale |
|---|---|
| Tests before refactoring | Safety net for behavior preservation |
| One refactoring per commit | Easy to revert specific changes |
| No feature changes mixed in | Separate refactor from feature PRs |
| Measure complexity before/after | Prove improvement objectively |
| Small PRs (< 200 lines changed) | Easier to review thoroughly |
| CI must pass after each step | Catch breakage immediately |
fai-refactor-complexity — Reduce cyclomatic complexityfai-refactor-plan — Multi-sprint refactoring plansfai-code-smell-detector — Automated smell detectionfai-review-and-refactor — Combined review + fix workflow~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.