Loading...
Loading...
TDD-based code simplification that preserves behavior through tests. Use Red-Green-Refactor cycles to simplify code one test-verified change at a time. **DISTINCT FROM**: General code review or AI rewriting—this skill requires existing tests and only proceeds when tests confirm behavior is preserved. **PROACTIVE**: Auto-invoke when test-covered code has complexity (functions >50 lines, high cyclomatic complexity, duplication) and user wants to simplify it safely. Trigger phrases: 'clean up code', 'make code simpler', 'reduce complexity', 'refactoring help'. **NOT FOR**: Adding features or fixing bugs—use /tdd skill instead.
npx skill4agent add mguinada/agent-skills refactoruv run pytestuv run pytestuv run pytestuv run ruff check src/uv run mypy src/# Run full CI pipeline until everything passes
bin/ci-localruffmypypytestdef generate_report(users, threshold):
result = []
for user in users:
score = user.login_count * 0.3 + user.posts * 0.7
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultdef calculate_engagement_score(user) -> float:
return user.login_count * 0.3 + user.posts * 0.7
def generate_report(users, threshold):
result = []
for user in users:
score = calculate_engagement_score(user)
if score >= threshold:
result.append({"name": user.name, "score": score})
return resultbin/ci-local