suggest-tidyings

corca-ai's avatarfrom corca-ai

Analyze recent commits to suggest safe tidying opportunities—guard clauses, dead code removal, explaining variables. Use when user says "suggest tidyings", "tidy", "find refactoring", "cleanup code", or wants to improve readability without changing behavior. Accepts optional branch argument.

⭐1stars🔀1forks📁View on GitHub🕐Updated Jan 10, 2026⬇️1downloads

When & Why to Use This Skill

The suggest-tidyings skill is an automated code quality assistant designed to enhance codebase maintainability by identifying safe, non-functional refactoring opportunities. By analyzing recent git commits, it detects patterns such as redundant code, complex nested logic suitable for guard clauses, and opportunities for explaining variables. This tool ensures that code remains clean and readable without the risk of altering program behavior, making it an essential utility for developers committed to high-quality software engineering standards.

Use Cases

  • Pre-Pull Request Optimization: Developers can run this skill to identify and apply minor 'tidying' improvements before submitting code for human review, reducing the noise in PR discussions.
  • Technical Debt Reduction: Use the tool to scan recent branches for dead code and obsolete logic that may have been left behind during rapid feature development.
  • Code Readability Enhancement: Automatically transform complex conditional blocks into clean guard clauses and replace cryptic expressions with explaining variables to make the codebase more accessible to new team members.
  • Continuous Integration Workflows: Integrate the skill into development cycles to provide automated feedback on code style and structural 'tidiness' based on a predefined tidying guide.
namesuggest-tidyings
descriptionAnalyze recent commits to suggest safe tidying opportunities—guard clauses, dead code removal, explaining variables. Use when user says "suggest tidyings", "tidy", "find refactoring", "cleanup code", or wants to improve readability without changing behavior. Accepts optional branch argument.

Suggest Tidyings

Analyze recent commits to find small, safe code improvements.

Key Principle: Each suggestion must be a perfectly safe, independent, small change. No logic changes, easy to review.

Workflow

1. Get Target Commits

Run the script to get recent non-tidying commits:

{SKILL_DIR}/scripts/tidy-target-commits.sh 5 [branch]
  • If branch argument provided (e.g., /suggest-tidyings develop), pass it to the script
  • If no argument, defaults to HEAD

2. Parallel Analysis with Sub-agents

For each commit hash, launch a parallel sub-agent using Task tool:

Task tool with subagent_type: general-purpose

Each sub-agent should:

  1. Read {SKILL_DIR}/references/tidying-guide.md for techniques, constraints, and output format
  2. Analyze commit diff: git show {commit_hash}
  3. Check if changes still exist: git diff {commit_hash}..HEAD -- {file} (skip modified regions)
  4. Return suggestions or "No tidying opportunities"

3. Aggregate Results

Collect all sub-agent results and present:

# Tidying Analysis Results

## Commit: {hash} - {message}
- suggestion 1
- suggestion 2

## Commit: {hash} - {message}
- No tidying opportunities

References