code-simplifier
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Analyzes recently modified code across three dimensions - code reuse, code quality, and efficiency - and provides actionable improvement suggestions. This skill should be used when the user asks to "simplify code", "refine code", "clean up code", "improve code quality", or requests a simplification review of recent changes.
What this skill does
# Code Simplifier Analyze recently modified code and suggest refinements that improve clarity, consistency, and maintainability - without changing what the code does. The review covers three complementary aspects: 1. **Code Reuse** - Eliminate duplication, consolidate shared logic, leverage existing utilities. 2. **Code Quality** - Improve naming, reduce complexity, enforce project standards from `AGENTS.md`. 3. **Efficiency** - Fix algorithmic issues, remove unnecessary work, optimize resource usage. ## Review Process ### Identify the Scope By default, focus on recently modified code. Use `git diff` or the file list from the current PR/MR to determine the changed files. When the user specifies a different scope, follow their instruction: - **Specific files**: "simplify `src/auth.py`" - review only the named files - **Directory**: "simplify the `utils/` folder" - review all files in that directory - **Full repo**: "simplify the whole project" - review the entire codebase - **PR/MR**: "simplify this PR" - review only files changed in the current PR/MR ### Sub-Agent Delegation (Preferred) When sub-agent capability is available, delegate each review aspect to a separate sub-agent for parallel, focused analysis: 1. **Code Reuse Review Agent** - Read `references/code-reuse-review.md` and analyze the changed files for duplication and consolidation opportunities. 2. **Code Quality Review Agent** - Read `references/code-quality-review.md` and analyze the changed files for clarity, naming, complexity, and standards compliance. 3. **Efficiency Review Agent** - Read `references/efficiency-review.md` and analyze the changed files for performance and resource usage issues. Each sub-agent should: - Read the corresponding reference document for detailed criteria and output format - Read `AGENTS.md` at the repository root for project-specific coding conventions - Analyze only the recently changed code (unless instructed otherwise) - Return findings in the format specified by its reference document After all sub-agents complete, synthesize their findings into a single consolidated report. ### Sequential Review (Fallback) When sub-agents are not available, perform all three reviews sequentially: 1. Read `references/code-reuse-review.md` - review for duplication and reuse 2. Read `references/code-quality-review.md` - review for clarity and standards 3. Read `references/efficiency-review.md` - review for performance and resources Apply the criteria and output format from each reference document. ## Guiding Philosophy - **Preserve Functionality**: Never change what the code does - only how it does it. All original features, outputs, and behaviors remain intact. - **Follow Project Standards**: Apply the coding conventions from `AGENTS.md` at the repository root (import ordering, naming, module structure, error handling, component patterns). - **Clarity Over Brevity**: Prefer explicit, readable code over compact one-liners. Avoid nested ternaries - use `if/else` or `switch` for multiple conditions. - **Maintain Balance**: Avoid over-simplification that reduces clarity, creates overly clever solutions, or combines too many concerns into a single function. - **Pragmatism**: Solve real problems, not imaginary ones. Do not optimize for theoretical edge cases or micro-benchmarks that do not matter at the project's scale. ## Consolidated Output Format Present the combined results from all three review aspects: ``` ## Code Simplification Review ### Scope [List of files reviewed and how scope was determined] ### Code Reuse [Findings from the reuse review, using **[REUSE]** tags] ### Code Quality [Findings from the quality review, using **[QUALITY]** tags] ### Efficiency [Findings from the efficiency review, using **[EFFICIENCY]** tags] ### Summary [Overall assessment: is the code in good shape, or does it need significant refinement?] [Prioritized list of the most impactful changes to make first] ``` When a review aspect has no findings, include it with an explicit "no issues found" statement rather than omitting the section. ## Reference Files - **`references/code-reuse-review.md`** - Detailed criteria for detecting duplication, consolidation opportunities, and over-abstraction - **`references/code-quality-review.md`** - Detailed criteria for naming, complexity, error handling, and project standards compliance - **`references/efficiency-review.md`** - Detailed criteria for algorithmic complexity, unnecessary work, resource usage, and I/O patterns
Related in Data & Analytics
clawarr-suite
IncludedComprehensive management for self-hosted media stacks (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Overseerr, Plex, Tautulli, SABnzbd, Recyclarr, Unpackerr, Notifiarr, Maintainerr, Kometa, FlareSolverr). Deep library exploration, analytics, dashboard generation, content management, request handling, subtitle management, indexer control, download monitoring, quality profile sync, library cleanup automation, notification routing, collection/overlay management, and media tracker integration (Trakt, Letterboxd, Simkl).
querying-soql
IncludedSOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
habit-flow
IncludedAI-powered atomic habit tracker with natural language logging, streak tracking, smart reminders, and coaching. Use for creating habits, logging completions naturally ("I meditated today"), viewing progress, and getting personalized coaching.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
visualizing-data
IncludedBuilds dashboards, reports, and data-driven interfaces requiring charts, graphs, or visual analytics. Provides systematic framework for selecting appropriate visualizations based on data characteristics and analytical purpose. Includes 24+ visualization types organized by purpose (trends, comparisons, distributions, relationships, flows, hierarchies, geospatial), accessibility patterns (WCAG 2.1 AA compliance), colorblind-safe palettes, and performance optimization strategies. Use when creating visualizations, choosing chart types, displaying data graphically, or designing data interfaces.