--- name: code-simplifier description: "Code Simplifier workflow skill. Use this skill when the user needs Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to \"simplify code\", \"clean up code\", \"refactor for clarity\", \"improve readability\", or review recently modified code for elegance. Focuses on project-specific best practices and the operator should preserve the upstream workflow, copied support files, and provenance before merging or handing off." version: "0.0.1" category: development tags: ["code-simplifier", "simplifies", "and", "refines", "for", "clarity", "consistency", "maintainability"] complexity: intermediate risk: safe tools: ["codex-cli", "claude-code", "cursor", "gemini-cli", "opencode"] source: community author: "sickn33" date_added: "2026-04-14" date_updated: "2026-04-25" --- # Code Simplifier ## Overview This public intake copy packages `plugins/antigravity-awesome-skills-claude/skills/code-simplifier` from `https://github.com/sickn33/antigravity-awesome-skills` into the native Omni Skills editorial shape without hiding its origin. Use it when the operator needs the upstream workflow, support files, and repository context to stay intact while the public validator and private enhancer continue their normal downstream flow. This intake keeps the copied upstream files intact and uses the `external_source` block in `metadata.json` plus `ORIGIN.md` as the provenance anchor for review. # Code Simplifier You are an expert code simplification specialist focused on enhancing code clarity, consistency, and maintainability while preserving exact functionality. Your expertise lies in applying project-specific best practices to simplify and improve code without altering its behavior. You prioritize readable, explicit code over overly compact solutions. Imported source sections that did not map cleanly to the public headings are still preserved below or in the support files. Notable imported sections: Limitations. ## When to Use This Skill Use this section as the trigger filter. It should make the activation boundary explicit before the operator loads files, runs commands, or opens a pull request. - You need to simplify or clean up code without changing behavior. - The task involves readability improvements, reducing unnecessary complexity, or aligning recent edits with project standards. - You want refinement focused on clarity and maintainability rather than feature work. - Use when the request clearly matches the imported source intent: Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Use when asked to "simplify code", "clean up code", "refactor for clarity", "improve readability", or review.... - Use when the operator should preserve upstream workflow detail instead of rewriting the process from scratch. - Use when provenance needs to stay visible in the answer, PR, or review packet. ## Operating Table | Situation | Start here | Why it matters | | --- | --- | --- | | First-time use | `metadata.json` | Confirms repository, branch, commit, and imported path through the `external_source` block before touching the copied workflow | | Provenance review | `ORIGIN.md` | Gives reviewers a plain-language audit trail for the imported source | | Workflow execution | `SKILL.md` | Starts with the smallest copied file that materially changes execution | | Supporting context | `SKILL.md` | Adds the next most relevant copied source file without loading the entire package | | Handoff decision | `## Related Skills` | Helps the operator switch to a stronger native skill when the task drifts | ## Workflow This workflow is intentionally editorial and operational at the same time. It keeps the imported source useful to the operator while still satisfying the public intake standards that feed the downstream enhancer flow. 1. Identify the recently modified code sections 2. Analyze for opportunities to improve elegance and consistency 3. Apply project-specific best practices and coding standards 4. Ensure all functionality remains unchanged 5. Verify the refined code is simpler and more maintainable 6. Document only significant changes that affect understanding 7. Confirm the user goal, the scope of the imported workflow, and whether this skill is still the right router for the task. ### Imported Workflow Notes #### Imported: Refinement Process 1. **Identify** the recently modified code sections 2. **Analyze** for opportunities to improve elegance and consistency 3. **Apply** project-specific best practices and coding standards 4. **Ensure** all functionality remains unchanged 5. **Verify** the refined code is simpler and more maintainable 6. **Document** only significant changes that affect understanding #### Imported: Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing. ## Examples ### Example 1: Ask for the upstream workflow directly ```text Use @code-simplifier to handle . Start from the copied upstream workflow, load only the files that change the outcome, and keep provenance visible in the answer. ``` **Explanation:** This is the safest starting point when the operator needs the imported workflow, but not the entire repository. ### Example 2: Ask for a provenance-grounded review ```text Review @code-simplifier against metadata.json and ORIGIN.md, then explain which copied upstream files you would load first and why. ``` **Explanation:** Use this before review or troubleshooting when you need a precise, auditable explanation of origin and file selection. ### Example 3: Narrow the copied support files before execution ```text Use @code-simplifier for . Load only the copied references, examples, or scripts that change the outcome, and name the files explicitly before proceeding. ``` **Explanation:** This keeps the skill aligned with progressive disclosure instead of loading the whole copied package by default. ### Example 4: Build a reviewer packet ```text Review @code-simplifier using the copied upstream files plus provenance, then summarize any gaps before merge. ``` **Explanation:** This is useful when the PR is waiting for human review and you want a repeatable audit packet. ### Imported Usage Notes #### Imported: Examples ### Before: Nested Ternaries ```typescript const status = isLoading ? 'loading' : hasError ? 'error' : isComplete ? 'complete' : 'idle'; ``` ### After: Clear Switch Statement ```typescript function getStatus(isLoading: boolean, hasError: boolean, isComplete: boolean): string { if (isLoading) return 'loading'; if (hasError) return 'error'; if (isComplete) return 'complete'; return 'idle'; } ``` ### Before: Overly Compact ```typescript const result = arr.filter(x => x > 0).map(x => x * 2).reduce((a, b) => a + b, 0); ``` ### After: Clear Steps ```typescript const positiveNumbers = arr.filter(x => x > 0); const doubled = positiveNumbers.map(x => x * 2); const sum = doubled.reduce((a, b) => a + b, 0); ``` ### Before: Redundant Abstraction ```typescript function isNotEmpty(arr: unknown[]): boolean { return arr.length > 0; } if (isNotEmpty(items)) { // ... } ``` ### After: Direct Check ```typescript if (items.length > 0) { // ... } ``` ## Best Practices Treat the generated public skill as a reviewable packaging layer around the upstream repository. The goal is to keep provenance explicit and load only the copied source material that materially improves execution. - Use ES modules with proper import sorting and extensions - Prefer function keyword over arrow functions - Use explicit return type annotations for top-level functions - Follow proper React component patterns with explicit Props types - Use proper error handling patterns (avoid try/catch when possible) - Maintain consistent naming conventions - Reducing unnecessary complexity and nesting ### Imported Operating Notes #### Imported: Refinement Principles ### 1. Preserve Functionality Never change what the code does - only how it does it. All original features, outputs, and behaviors must remain intact. ### 2. Apply Project Standards Follow the established coding standards from CLAUDE.md including: - Use ES modules with proper import sorting and extensions - Prefer `function` keyword over arrow functions - Use explicit return type annotations for top-level functions - Follow proper React component patterns with explicit Props types - Use proper error handling patterns (avoid try/catch when possible) - Maintain consistent naming conventions ### 3. Enhance Clarity Simplify code structure by: - Reducing unnecessary complexity and nesting - Eliminating redundant code and abstractions - Improving readability through clear variable and function names - Consolidating related logic - Removing unnecessary comments that describe obvious code - **Avoiding nested ternary operators** - prefer switch statements or if/else chains for multiple conditions - Choosing clarity over brevity - explicit code is often better than overly compact code ### 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 or components - Remove helpful abstractions that improve code organization - Prioritize "fewer lines" over readability (e.g., nested ternaries, dense one-liners) - Make the code harder to debug or extend ### 5. Focus Scope Only refine code that has been recently modified or touched in the current session, unless explicitly instructed to review a broader scope. ## Troubleshooting ### Problem: The operator skipped the imported context and answered too generically **Symptoms:** The result ignores the upstream workflow in `plugins/antigravity-awesome-skills-claude/skills/code-simplifier`, fails to mention provenance, or does not use any copied source files at all. **Solution:** Re-open `metadata.json`, `ORIGIN.md`, and the most relevant copied upstream files. Check the `external_source` block first, then restate the provenance before continuing. ### Problem: The imported workflow feels incomplete during review **Symptoms:** Reviewers can see the generated `SKILL.md`, but they cannot quickly tell which references, examples, or scripts matter for the current task. **Solution:** Point at the exact copied references, examples, scripts, or assets that justify the path you took. If the gap is still real, record it in the PR instead of hiding it. ### Problem: The task drifted into a different specialization **Symptoms:** The imported skill starts in the right place, but the work turns into debugging, architecture, design, security, or release orchestration that a native skill handles better. **Solution:** Use the related skills section to hand off deliberately. Keep the imported provenance visible so the next skill inherits the right context instead of starting blind. ## Related Skills - `@00-andruia-consultant` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@00-andruia-consultant-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@10-andruia-skill-smith` - Use when the work is better handled by that native specialization after this imported skill establishes context. - `@10-andruia-skill-smith-v2` - Use when the work is better handled by that native specialization after this imported skill establishes context. ## Additional Resources Use this support matrix and the linked files below as the operator packet for this imported skill. They should reflect real copied source material, not generic scaffolding. | Resource family | What it gives the reviewer | Example path | | --- | --- | --- | | `references` | copied reference notes, guides, or background material from upstream | `references/n/a` | | `examples` | worked examples or reusable prompts copied from upstream | `examples/n/a` | | `scripts` | upstream helper scripts that change execution or validation | `scripts/n/a` | | `agents` | routing or delegation notes that are genuinely part of the imported package | `agents/n/a` | | `assets` | supporting assets or schemas copied from the source package | `assets/n/a` |