← Back to list

tidy
by SDiamante13
Configuration on Mac and Claude related files
⭐ 5🍴 0📅 Jan 24, 2026
SKILL.md
name: tidy description: TDD Production Code Refactoring Process. Triggers on 'tidy up'.
TDD Production Code Refactoring Process
STARTER_CHARACTER = 🟣
NEVER make changes to Test code in this process.
This process is for refactoring production code with test coverage.
Initial Setup
-
Locate Test File Proactively
- If user provides a file path, search for its test file using common patterns:
filename.test.ext,filename.spec.ext__tests__/filename.exttests/filename.ext- Mirror path with
/test/instead of/src/
- Use Glob and Grep to search multiple patterns in parallel
- If multiple test files found, show options and ask which one
- If no test file found, inform user and ask them to provide the test file path
- Only ask user if ambiguous or not found - otherwise proceed automatically
- If user provides a file path, search for its test file using common patterns:
-
Verify Tests Pass
- Run the test suite to establish baseline
- If tests fail initially, stop and report to user
-
Scan for Refactoring Opportunities
- Read the production code file thoroughly
- Identify ALL refactoring opportunities by priority:
- Dead code (commented code, unused variables)
- Poor names (unclear variables/methods)
- Long methods (> 25 lines)
- Duplication (repeated code blocks)
- Complex conditionals (nested ifs, no guard clauses)
- Unnecessary locals (single-use variables)
- Unused imports
- Present numbered list of all findings to user
- Ask user which ones to proceed with (e.g., "all", "1-5", "2,4,7")
- Wait for user confirmation before starting refactoring
Refactoring Loop
For each approved refactor:
- Perform the refactoring (one at a time, in priority order)
- Run tests to ensure they still pass
- If tests pass: commit with message format
"- r <refactoring>"(quotes must include the - r) - If tests fail: revert changes and try a different refactoring
- Provide brief status update after each refactor
Stop conditions:
- If a refactor fails three times
- If no further refactoring opportunities found
- Pause and check with user
Code Style Guidelines
- Prefer self-explanatory, readable code over comments
- Use functional helper methods for clarity
- Remove comments and dead code
- Extract paragraphs into methods
- Use better variable names
- Remove unused imports
- Remove unhelpful local variables
- Methods should be small and focused (ideally < 25 lines)
Common Refactorings (in priority order)
- Remove dead code - commented code, unused variables
- Better names - rename unclear variables/methods
- Extract methods - break up long methods
- Remove duplication - DRY principle
- Simplify conditionals - reduce nesting, use guard clauses
- Remove unnecessary locals - inline single-use variables
- Clean imports - remove unused imports
Score
Total Score
40/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon