code-simplifier
Skill529 starsChanged 9 months agoMITView on GitHub
Analyzes recently modified code and creates pull requests with simplifications that improve clarity, consistency, and maintainability while preserving functionality
42 other projects use a version of this, 20 of them edited.
Adopted by
Most recently taken up by
- kopp0510/claude-ddtheir own version, first seen Oct 5, 2026
- aktsmm/Agent-Skillsedited, first seen Oct 4, 2026
- yeisonrestrepo/code-conductortheir own version, first seen Oct 3, 2026
- wty-yy/skillstheir own version, first seen Oct 2, 2026
- zvadaadam/az-skillsedited, first seen Sep 28, 2026
- kaiohenricunha/dotbabeltheir own version, first seen Sep 24, 2026
Used with
Projects with it also use comment-analyzer, performance and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
lin30Skillcomment-analyzer
微博评论抓取与深度分析,生成可视化HTML报告。Use when user asks to analyze weibo comments, analyze social media comments, or requests sentiment analysis from weibo posts
Also in 3 projects that use this
pluginagentmarketplaceSkillperformance
Optimize application performance through caching strategies, load balancing, database scaling, and monitoring. Build systems handling thousands of concurrent users.
Also in 3 projects that use this
AWSSkillsetup-matt-pocock-skills
Configure this repo for the engineering skills: set up its issue tracker, triage label vocabulary, and domain doc layout. Run once before first use of the other engineering skills.
Also in 3 projects that use this
OpenAISkillverification-before-completion
Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always
Also in 4 projects that use this
AWSSkillto-spec
Turn the current conversation into a spec and publish it to the project issue tracker: no interview, just synthesis of what you've already discussed.
Also in 3 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 9 projects that use this
- +2 more from aws
Other versions42 projects use a version of this.
Word for word · 1
- Azure/azqr★ 793100% same
Edited · 20
- getsentry/skills★ 1k16% same
- zvadaadam/az-skills★ 4912% same
- roman01la/skills-agents★ 4816% same
- fanqingxuan/awesome-skills★ 2914% same
- aktsmm/Agent-Skills★ 2612% same
- ivanrvpereira/.agents★ 1816% same
- icefrag/nbl★ 1721% same
- ferologics/pi-skills★ 1420% same
- WalletConnect/skills★ 1413% same
- jorgeasaurus/agent-skills★ 1316% same
10 more not listed
Wrote their own version · 21
- rtk-ai/rtk★ 82ksame name
- feiskyer/codex-settings★ 244same name
- FlorianBruniaux/ccboard★ 96same name
- 1024XEngineer/bytemind★ 43same name
- kumaran-is/claude-code-onboarding★ 36same name
- yz5e/agent-skills★ 17same name
- radimsem/mithril★ 16same name
- s-hiraoku/synapse-a2a★ 16same name
- yeisonrestrepo/code-conductor★ 15same name
- Tairitsua/Monica★ 13same name
11 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository3 other files it gives its agents.
- copilot-sdkSkill
- ghqr-reportSkill
- tui-developerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
33 rules. 0 are common, 32 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 39 edited versions we read keep these.
32
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Create pull requests with improvements
- Distinctive: line 20
Use this skill when:
- Distinctive: line 30
All original features, outputs, and behaviors must remain intact
- Distinctive: line 31
Run tests before and after to ensure no behavioral changes
- Distinctive: line 38
Remove unnecessary comments that describe obvious code
- Distinctive: line 39
IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains
- Distinctive: line 43
Use project-specific conventions and patterns
- Distinctive: line 44
Follow established naming conventions
- Distinctive: line 46
Use appropriate language features (modern syntax where beneficial)
- Distinctive: line 49
Avoid over-simplification that could:
- Distinctive: line 51
Create overly clever solutions that are hard to understand
- Distinctive: line 53
Remove helpful abstractions that improve code organization
- Distinctive: line 91
Use GitHub tools to:
- Distinctive: line 92
Search for pull requests merged in the last 24 hours
- Distinctive: line 119
If no files were changed in the last 24 hours (no local modifications, no commits, no merged PRs), exit gracefully:
- Distinctive: line 126
If files were changed (from any source: local edits, commits, or PRs), proceed to Phase 2.
- Distinctive: line 132
Before simplifying, review the project's coding standards:
- Distinctive: line 133
Check for style guides, coding conventions, or contribution guidelines
- Very specific: line 134
Look for language-specific conventions (STYLE.md, CONTRIBUTING.md, README.md)
- Distinctive: line 163
After making simplifications, run the project's test suite:
- Distinctive: line 184
Ensure code style is consistent:
- Distinctive: line 199
Verify the project still builds successfully:
- Distinctive: line 215
Only create a PR if:
- Distinctive: line 222
If no improvements were made or changes broke tests, exit gracefully:
- Distinctive: line 231
Use this structure for the PR:
- Distinctive: line 377
Focus on recent changes: Only refine code modified in the last 24 hours (local files, commits, or merged PRs)
- Distinctive: line 378
Include all change sources: Consider filesystem modifications, staged changes, commits, and merged PRs
- Distinctive: line 379
Don't over-refactor: Avoid touching unrelated code
- Distinctive: line 380
Preserve interfaces: Don't change public APIs
- Distinctive: line 386
No code was changed in the last 24 hours
- Distinctive: line 387
No simplifications are beneficial
- Distinctive: line 394
Before creating a PR, verify:
- Distinctive: line 412
If simplifications made: Create a PR with the changes and detailed description
“Common” is measured: kept by at least 6 in 10 of the 39 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Simplifier Skill
Expert guidance for analyzing and simplifying recently modified code to improve clarity, consistency, and maintainability while preserving exact functionality.
Overview
This skill enables agents to:
- Analyze code changes from the last 24 hours
- Apply targeted simplifications that improve code quality
- Create pull requests with improvements
- Validate changes through tests and linting
When to Use This Skill
Use this skill when:
- User asks to simplify or refactor recent code changes
- User wants to improve code quality without changing functionality
- User requests code review with automatic improvements
- Scheduled code quality checks are needed
Simplification Principles
1. Preserve Functionality
- NEVER change what the code does - only how it does it
- All original features, outputs, and behaviors must remain intact
- Run tests before and after to ensure no behavioral changes
2. Enhance Clarity
- Reduce unnecessary complexity and nesting
- Eliminate redundant code and abstractions
- Improve readability through clear variable and function names
- Consolidate related logic
- Remove unnecessary comments that describe obvious code
- IMPORTANT: Avoid nested ternary operators - prefer switch statements or if/else chains
- Choose clarity over brevity - explicit code is often better than compact code
3. Apply Project Standards
- Use project-specific conventions and patterns
- Follow established naming conventions
- Apply consistent formatting
- Use appropriate language features (modern syntax where beneficial)
4. Maintain Balance
Avoid over-simplification that could:
- Reduce code clarity or maintainability
- Create overly clever solutions that are hard to understand
- Combine too many concerns into single functions
- Remove helpful abstractions that improve code organization
- Prioritize "fewer lines" over readability
- Make the code harder to debug or extend
Workflow
Phase 1: Identify Recently Modified Code
1.1 Find Recent Changes
Identify files modified in the last 24 hours from all sources:
Option A: Local File Changes (filesystem-based)
# Find files modified in the last 24 hours (includes uncommitted changes)
find . -type f -mtime -1 -not -path './.git/*' -not -path './node_modules/*' -not -path './vendor/*'
# Or using git to find modified files (staged and unstaged)
git status --porcelain
# Find recently modified tracked files
git diff --name-only HEAD~10 # Adjust based on commit frequencyOption B: Git History (committed changes)
# Get yesterday's date in ISO format
YESTERDAY=$(date -d '1 day ago' '+%Y-%m-%d' 2>/dev/null || date -v-1d '+%Y-%m-%d')
# List recent commits
git log --since="24 hours ago" --pretty=format:"%H %s" --no-merges
# List files changed in recent commits
git log --since="24 hours ago" --name-only --pretty=format:"" | sort -uOption C: GitHub PRs and Commits (remote changes)
Use GitHub tools to:
- Search for pull requests merged in the last 24 hours
- Get details of merged PRs to understand what files were changed
- List commits from the last 24 hours to identify modified files
Combine all sources to get a comprehensive list of recently modified files.
1.2 Extract Changed Files
From all identified sources (local changes, commits, PRs):
- Collect files modified on the filesystem in the last 24 hours
- List changed files from recent commits
- List changed files from merged PRs
- Deduplicate the combined file list
- Focus on source code files (
.go,.js,.ts,.tsx,.jsx,.py,.rb,.java,.cs,.php,.cpp,.c,.rs, etc.) - Exclude test files, lock files, generated files, and vendored dependencies
# Example: Combine filesystem and git changes, filter source files
{
find . -type f -mtime -1 -not -path './.git/*' 2>/dev/null
git log --since="24 hours ago" --name-only --pretty=format:"" 2>/dev/null
git diff --name-only 2>/dev/null
} | sort -u | grep -E '\.(go|js|ts|tsx|jsx|py|rb|java|cs|php|cpp|c|rs)$'1.3 Determine Scope
If no files were changed in the last 24 hours (no local modifications, no commits, no merged PRs), exit gracefully:
✅ No code changes detected in the last 24 hours.
Code simplifier has nothing to process today.If files were changed (from any source: local edits, commits, or PRs), proceed to Phase 2.
Phase 2: Analyze and Simplify Code
2.1 Review Project Standards
Before simplifying, review the project's coding standards:
- Check for style guides, coding conventions, or contribution guidelines
- Look for language-specific conventions (
STYLE.md,CONTRIBUTING.md,README.md) - Identify established patterns in the codebase
2.2 Perform Code Analysis
For each changed file:
- Read the file contents
- Identify refactoring opportunities:
- Long functions that could be split
- Duplicate code patterns
- Complex conditionals that could be simplified
- Unclear variable names
- Missing or excessive comments
- Non-idiomatic patterns
- Design the simplification:
- What specific changes will improve clarity?
- How can complexity be reduced?
- What patterns should be applied?
- Will this maintain all functionality?
2.3 Apply Simplifications
Make surgical, focused changes that preserve all original behavior. Use targeted edits rather than full file rewrites.
Phase 3: Validate Changes
3.1 Run Tests
After making simplifications, run the project's test suite:
# Common test commands (adapt to the project)
make test # If Makefile exists
npm test # For Node.js projects
pytest # For Python projects
./gradlew test # For Gradle projects
mvn test # For Maven projects
cargo test # For Rust projects
go test ./... # For Go projectsIf tests fail:
- Review the failures carefully
- Revert changes that broke functionality
- Adjust simplifications to preserve behavior
- Re-run tests until they pass
3.2 Run Linters
Ensure code style is consistent:
# Common lint commands (adapt to the project)
make lint # If Makefile exists
npm run lint # For Node.js projects
pylint . || flake8 . # For Python projects
cargo clippy # For Rust projects
golangci-lint run # For Go projectsFix any linting issues introduced by the simplifications.
3.3 Check Build
Verify the project still builds successfully:
# Common build commands (adapt to the project)
make build # If Makefile exists
npm run build # For Node.js projects
./gradlew build # For Gradle projects
mvn package # For Maven projects
cargo build # For Rust projects
go build ./... # For Go projectsPhase 4: Create Pull Request
4.1 Determine If PR Is Needed
Only create a PR if:
- ✅ Actual code simplifications were made
- ✅ All tests pass (or no tests exist)
- ✅ Linting is clean (or no linter configured)
- ✅ Build succeeds (or no build step exists)
- ✅ Changes improve code quality without breaking functionality
If no improvements were made or changes broke tests, exit gracefully:
✅ Code analyzed from last 24 hours.
No simplifications needed - code already meets quality standards.4.2 Generate PR Description
Use this structure for the PR:
## Code Simplification - [Date]
This PR simplifies recently modified code to improve clarity, consistency, and maintainability while preserving all functionality.
### Files Simplified
- `path/to/file1.ext` - [Brief description of improvements]
- `path/to/file2.ext` - [Brief description of improvements]
### Improvements Made
1. **Reduced Complexity**
- [Specific example]
2. **Enhanced Clarity**
- [Specific example]
3. **Applied Project Standards**
- [Specific example]
### Changes Based On
Recent changes from:
- #[PR_NUMBER] - [PR title]
- Commit [SHORT_SHA] - [Commit message]
### Testing
- ✅ All tests pass (or indicate if no tests exist)
- ✅ Linting passes (or indicate if no linter configured)
- ✅ Build succeeds (or indicate if no build step)
- ✅ No functional changes - behavior is identical
### Review Focus
Please verify:
- Functionality is preserved
- Simplifications improve code quality
- Changes align with project conventions
- No unintended side effects
---
*Automated by Code Simplifier Agent*Common Simplification Patterns
Reduce Nesting
// Before
func process(data []Item) error {
if data != nil {
if len(data) > 0 {
for _, item := range data {
if item.Valid {
// process
}
}
}
}
return nil
}
// After
func process(data []Item) error {
if len(data) == 0 {
return nil
}
for _, item := range data {
if !item.Valid {
continue
}
// process
}
return nil
}Replace Nested Ternaries with Switch/If
// Before
const status = isError ? 'error' : isLoading ? 'loading' : isSuccess ? 'success' : 'idle';
// After
let status;
if (isError) {
status = 'error';
} else if (isLoading) {
status = 'loading';
} else if (isSuccess) {
status = 'success';
} else {
status = 'idle';
}Consolidate Related Logic
# Before
def validate_user(user):
if user.name is None:
return False
if len(user.name) == 0:
return False
if user.email is None:
return False
if '@' not in user.email:
return False
return True
# After
def validate_user(user):
if not user.name:
return False
if not user.email or '@' not in user.email:
return False
return TrueImprove Variable Names
// Before
func calc(d []int) int {
t := 0
for _, v := range d {
t += v
}
return t
}
// After
func calculateSum(values []int) int {
total := 0
for _, value := range values {
total += value
}
return total
}Scope Control Guidelines
- Focus on recent changes: Only refine code modified in the last 24 hours (local files, commits, or merged PRs)
- Include all change sources: Consider filesystem modifications, staged changes, commits, and merged PRs
- Don't over-refactor: Avoid touching unrelated code
- Preserve interfaces: Don't change public APIs
- Incremental improvements: Make targeted, surgical changes
Exit Conditions
Exit gracefully without creating a PR if:
- No code was changed in the last 24 hours
- No simplifications are beneficial
- Tests fail after changes
- Build fails after changes
- Changes are too risky or complex
Quality Checklist
Before creating a PR, verify:
- Functionality is preserved (all tests pass)
- Code is clearer and more readable
- No nested ternary operators introduced
- Variable names are descriptive
- Unnecessary complexity removed
- Project conventions followed
- Build succeeds
- Linting passes
- Changes are focused and surgical
Output Requirements
The agent MUST either:
- If no changes in last 24 hours: Output a brief status message
- If no simplifications beneficial: Output a brief status message
- If simplifications made: Create a PR with the changes and detailed description
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

