k-code-simplifier
Skill12 starsChanged 2 months agoApache-2.0View on GitHub
Simplifies and refines code for clarity, consistency, and maintainability while preserving functionality. Use when asked to simplify, clean up or flatten code (nested ternaries, deep nesting, duplication) without changing behavior.
In this repository80 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- about-konductorSkill
- adversarial-code-review-pass-integritySkill
- adversarial-code-review-pass-schemaSkill
- adversarial-code-review-pass-securitySkill
- adversarial-code-reviewSkill
- adversarial-design-reviewSkill
- agents-md-authoringSkill
- app-discoverySkill
- architecture-advisorSkill
- architecture-diagram-generationSkill
- argumentation-referenceSkill
- aws-service-validatorSkill
- backend-developmentSkill
- backend-reviewSkill
- claude-teams-behaviorSkill
- cmux-dispatchSkill
- code-reviewSkill
- constraintsSkill
- cost-estimationSkill
- cypress-test-implementationSkill
- decision-researchSkill
- decision-writingSkill
- delegation-protocolSkill
- deliberation-panelSkill
- design-doc-guidelinesSkill
- design-evaluationSkill
- design-impact-reviewSkill
- design-quality-checkSkill
- doc-accuracy-analyzerSkill
- docx-conversionSkill
- dom-inspectionSkill
- dynamodb-designSkill
- e2e-test-strategySkill
- external-researchSkill
- find-aws-skillsSkill
- frontend-developmentSkill
- frontend-reviewSkill
- git-mergeSkill
- git-workflowSkill
- historical-issues-registrySkill
- humanize-writingSkill
- iam-policy-designSkill
- infra-validationSkill
- k-aspect-reviewSkill
- kiro-design-generationSkill
- kiro-requirements-generationSkill
- kiro-task-generationSkill
- legacy-to-agentic-estimateSkill
- mux-dispatchSkill
- non-functional-requirementsSkill
- persistent-memorySkill
- plan-reviewSkill
- playwright-test-implementationSkill
- policy-validationSkill
- pre-planning-analysisSkill
- program-decision-docsSkill
- program-planningSkill
- progress-trackingSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 8 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this skill when:
- Distinctive: line 28
Never change what the code does, only how it does it.
- Distinctive: line 32
Avoid nested ternary operators.
- Distinctive: line 38
Avoid over-simplification that could reduce maintainability, create overly clever solutions, combine too many concerns, or remove helpful …
- Distinctive: line 42
Baseline: run the tests that cover the code and note the result.
- Distinctive: line 46
Report: only the significant changes: file, what changed, and why it is clearer.
- Distinctive: line 68
Fix: Test before and after. Preserve all outputs and behaviors.
- Distinctive: line 73
Fix: Keep abstractions that improve code organization and reuse.
≈ “Common” is an estimate: at least 1 in 5 of the 383,637 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Simplifier
Overview
Enhance code clarity, consistency, and maintainability while preserving exact functionality. Prioritize readable, explicit code over overly compact solutions.
Usage
Use this skill when:
- Reviewing recently modified code for simplification opportunities
- Refactoring code for improved readability
- Applying project coding standards consistently
- Reducing unnecessary complexity and nesting
- Consolidating redundant code or abstractions
Core Concepts
Preserve Functionality
Never change what the code does, only how it does it. All original features, outputs, and behaviors MUST remain intact.
Clarity Over Brevity
- Avoid nested ternary operators; prefer switch statements or if/else chains
- Explicit code is better than overly compact code
- Readable code beats clever one-liners
Balance
Avoid over-simplification that could reduce maintainability, create overly clever solutions, combine too many concerns, or remove helpful abstractions.
Refinement Process
- Baseline: run the tests that cover the code and note the result. If none cover it, or you cannot run them, say so before changing anything.
- Identify recently modified code sections, and the behavior the tests do not pin down: explicit
0orNonearguments, zero or negative values, boundary comparisons, exception types. - Apply clarity and consistency changes that follow the project's own conventions
- Re-run the same tests and confirm the result matches the baseline. Show both runs. Passing tests do not prove equivalence, so also check each rewritten condition against the original on the inputs from step 2.
- Report only the significant changes: file, what changed, and why it is clearer. Name the non-obvious behavior you kept and say whether the tests ran. If the user asked for a summary file, put this there, not only in your reply.
Quick Reference
| Improvement | Do | Don't |
| Conditionals | Use if/else or switch | Nested ternaries |
| Naming | Clear, descriptive names | Abbreviations |
| Nesting | Flatten when possible | Deep nesting (>3) |
| Comments | Explain why, not what | Obvious comments |
| Abstractions | Keep helpful ones | Remove all for "simplicity" |
Common Mistakes
Over-Simplification
Problem: Combining too much into dense one-liners for fewer lines. Fix: Prioritize readability over line count.
Changing Behavior
Problem: Accidentally altering functionality while refactoring. Fix: Test before and after. Preserve all outputs and behaviors.
Removing Useful Abstractions
Problem: Flattening everything removes helpful organization. Fix: Keep abstractions that improve code organization and reuse.
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.

