[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FE9QKG7YR8CDSXZKZTSYV4":3,"skill-same:01M6FE9QKG7YR8CDSXZKZTSYV4":52},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":25,"linkOnly":26,"markdownContent":27,"markdownBody":27,"frontMatter":28,"refName":29,"commitSha":30,"skillDirectory":31,"forksCount":32,"repositoryHtmlUrl":33,"repositoryHomepageUrl":34,"ownerHtmlUrl":35,"ownerBlogUrl":6,"ownerDescription":36,"updatedAt":37,"install":38,"resources":51},"01M6FE9QKG7YR8CDSXZKZTSYV4","code-simplifier",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Fcode-simplifier\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[23,24],"code","code simplifier","2026-11-10 10:12:30",false,"# Community Code Simplification Best Practices\n\nComprehensive code simplification guide for AI agents and LLMs. Contains 47 rules across 8 categories, prioritized by impact from critical (context discovery, behavior preservation) to incremental (language idioms). Each rule includes detailed explanations, real-world examples comparing incorrect vs. correct implementations, and specific impact metrics.\n\n## Core Principles\n\n1. **Context First**: Understand project conventions before making any changes\n2. **Behavior Preservation**: Change how code is written, never what it does\n3. **Scope Discipline**: Focus on recently modified code, keep diffs small\n4. **Clarity Over Brevity**: Explicit, readable code beats clever one-liners\n\n## When to Apply\n\nReference these guidelines when:\n- Simplifying or cleaning up recently modified code\n- Reducing nesting, complexity, or duplication\n- Improving naming and readability\n- Applying language-specific idiomatic patterns\n- Reviewing code for maintainability issues\n\n## Rule Categories by Priority\n\n| Priority | Category | Impact | Prefix | Rules |\n|----------|----------|--------|--------|-------|\n| 1 | Context Discovery | CRITICAL | `ctx-` | 4 |\n| 2 | Behavior Preservation | CRITICAL | `behave-` | 6 |\n| 3 | Scope Management | HIGH | `scope-` | 5 |\n| 4 | Control Flow Simplification | HIGH | `flow-` | 9 |\n| 5 | Naming and Clarity | MEDIUM-HIGH | `name-` | 6 |\n| 6 | Duplication Reduction | MEDIUM | `dup-` | 5 |\n| 7 | Dead Code Elimination | MEDIUM | `dead-` | 5 |\n| 8 | Language Idioms | LOW-MEDIUM | `idiom-` | 7 |\n\n## Quick Reference\n\n### 1. Context Discovery (CRITICAL)\n\n- [`ctx-read-claude-md`](references\u002Fctx-read-claude-md.md) - Always read CLAUDE.md before simplifying\n- [`ctx-detect-lint-config`](references\u002Fctx-detect-lint-config.md) - Check for linting and formatting configs\n- [`ctx-follow-existing-patterns`](references\u002Fctx-follow-existing-patterns.md) - Match existing code style in file and project\n- [`ctx-project-over-generic`](references\u002Fctx-project-over-generic.md) - Project conventions override generic best practices\n\n### 2. Behavior Preservation (CRITICAL)\n\n- [`behave-preserve-outputs`](references\u002Fbehave-preserve-outputs.md) - Preserve all return values and outputs\n- [`behave-preserve-errors`](references\u002Fbehave-preserve-errors.md) - Preserve error messages, types, and handling\n- [`behave-preserve-api`](references\u002Fbehave-preserve-api.md) - Preserve public function signatures and types\n- [`behave-preserve-side-effects`](references\u002Fbehave-preserve-side-effects.md) - Preserve side effects (logging, I\u002FO, state changes)\n- [`behave-no-semantics-change`](references\u002Fbehave-no-semantics-change.md) - Forbid subtle semantic changes\n- [`behave-verify-before-commit`](references\u002Fbehave-verify-before-commit.md) - Verify behavior preservation before finalizing\n\n### 3. Scope Management (HIGH)\n\n- [`scope-recent-code-only`](references\u002Fscope-recent-code-only.md) - Focus on recently modified code only\n- [`scope-minimal-diff`](references\u002Fscope-minimal-diff.md) - Keep changes small and reviewable\n- [`scope-no-unrelated-refactors`](references\u002Fscope-no-unrelated-refactors.md) - No unrelated refactors\n- [`scope-no-global-rewrites`](references\u002Fscope-no-global-rewrites.md) - Avoid global rewrites and architectural changes\n- [`scope-respect-boundaries`](references\u002Fscope-respect-boundaries.md) - Respect module and component boundaries\n\n### 4. Control Flow Simplification (HIGH)\n\n- [`flow-early-return`](references\u002Fflow-early-return.md) - Use early returns to reduce nesting\n- [`flow-guard-clauses`](references\u002Fflow-guard-clauses.md) - Use guard clauses for preconditions\n- [`flow-no-nested-ternaries`](references\u002Fflow-no-nested-ternaries.md) - Never use nested ternary operators\n- [`flow-explicit-over-dense`](references\u002Fflow-explicit-over-dense.md) - Prefer explicit control flow over dense expressions\n- [`flow-flatten-nesting`](references\u002Fflow-flatten-nesting.md) - Flatten deep nesting to maximum 2-3 levels\n- [`flow-single-responsibility`](references\u002Fflow-single-responsibility.md) - Each code block should do one thing\n- [`flow-positive-conditions`](references\u002Fflow-positive-conditions.md) - Prefer positive conditions over double negatives\n- [`flow-optional-chaining`](references\u002Fflow-optional-chaining.md) - Use optional chaining and nullish coalescing\n- [`flow-boolean-simplification`](references\u002Fflow-boolean-simplification.md) - Simplify boolean expressions\n\n### 5. Naming and Clarity (MEDIUM-HIGH)\n\n- [`name-intention-revealing`](references\u002Fname-intention-revealing.md) - Use intention-revealing names\n- [`name-nouns-for-data`](references\u002Fname-nouns-for-data.md) - Use nouns for data, verbs for actions\n- [`name-avoid-abbreviations`](references\u002Fname-avoid-abbreviations.md) - Avoid cryptic abbreviations\n- [`name-consistent-vocabulary`](references\u002Fname-consistent-vocabulary.md) - Use consistent vocabulary throughout\n- [`name-avoid-generic`](references\u002Fname-avoid-generic.md) - Avoid generic names\n- [`name-string-interpolation`](references\u002Fname-string-interpolation.md) - Prefer string interpolation over concatenation\n\n### 6. Duplication Reduction (MEDIUM)\n\n- [`dup-rule-of-three`](references\u002Fdup-rule-of-three.md) - Apply the rule of three\n- [`dup-no-single-use-helpers`](references\u002Fdup-no-single-use-helpers.md) - Avoid single-use helper functions\n- [`dup-extract-for-clarity`](references\u002Fdup-extract-for-clarity.md) - Extract only when it improves clarity\n- [`dup-avoid-over-abstraction`](references\u002Fdup-avoid-over-abstraction.md) - Prefer duplication over premature abstraction\n- [`dup-data-driven`](references\u002Fdup-data-driven.md) - Use data-driven patterns over repetitive conditionals\n\n### 7. Dead Code Elimination (MEDIUM)\n\n- [`dead-remove-unused`](references\u002Fdead-remove-unused.md) - Delete unused code artifacts\n- [`dead-delete-not-comment`](references\u002Fdead-delete-not-comment.md) - Delete code, never comment it out\n- [`dead-remove-obvious-comments`](references\u002Fdead-remove-obvious-comments.md) - Remove comments that state the obvious\n- [`dead-keep-why-comments`](references\u002Fdead-keep-why-comments.md) - Keep comments that explain why, not what\n- [`dead-remove-todo-fixme`](references\u002Fdead-remove-todo-fixme.md) - Remove stale TODO\u002FFIXME comments\n\n### 8. Language Idioms (LOW-MEDIUM)\n\n- [`idiom-ts-strict-types`](references\u002Fidiom-ts-strict-types.md) - Use strict types over any (TypeScript)\n- [`idiom-ts-const-assertions`](references\u002Fidiom-ts-const-assertions.md) - Use const assertions and readonly (TypeScript)\n- [`idiom-rust-question-mark`](references\u002Fidiom-rust-question-mark.md) - Use ? for error propagation (Rust)\n- [`idiom-rust-iterator-chains`](references\u002Fidiom-rust-iterator-chains.md) - Use iterator chains when clearer (Rust)\n- [`idiom-python-comprehensions`](references\u002Fidiom-python-comprehensions.md) - Use comprehensions for simple transforms (Python)\n- [`idiom-go-error-handling`](references\u002Fidiom-go-error-handling.md) - Handle errors immediately (Go)\n- [`idiom-prefer-language-builtins`](references\u002Fidiom-prefer-language-builtins.md) - Prefer language and stdlib builtins\n\n## Workflow\n\n1. **Discover context**: Read CLAUDE.md, lint configs, examine existing patterns\n2. **Identify scope**: Focus on recently modified code unless asked to expand\n3. **Apply transformations**: Use rules in priority order (CRITICAL first)\n4. **Verify behavior**: Ensure outputs, errors, and side effects remain identical\n5. **Keep diffs minimal**: Small, focused changes that are easy to review\n\n## How to Use\n\nRead individual reference files for detailed explanations and code examples:\n\n- [Section definitions](references\u002F_sections.md) - Category structure and impact levels\n- [Rule template](assets\u002Ftemplates\u002F_template.md) - Template for adding new rules\n\n## Reference Files\n\n| File | Description |\n|------|-------------|\n| [references\u002F_sections.md](references\u002F_sections.md) | Category definitions and ordering |\n| [assets\u002Ftemplates\u002F_template.md](assets\u002Ftemplates\u002F_template.md) | Template for new rules |\n| [metadata.json](metadata.json) | Version and reference information |\n",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fpproenca\u002Fdot-skills\u002Fcode-simplifier",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill code-simplifier",{"tool":44,"command":45},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill code-simplifier",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill code-simplifier","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fpproenca\u002Fdot-skills\u002Fcode-simplifier\u002FSKILL.md",true,[],[53,67,77,86,92,99],{"skillNo":54,"name":55,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":63,"publishedAt":25},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[58],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[64,65,66],"model","model hierarchy","model hierarchy skill",{"skillNo":68,"name":69,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":73,"publishedAt":25},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[72],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},[74,75,76],"MCP","zoom","zoom mcp",{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":25},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[83,84,85,75],"sdk","zoom apps sdk","apps",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":25},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[88],{"skillNo":93,"name":94,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":98,"publishedAt":25},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[97],{"categoryNo":59,"categoryName":60,"taxonomyType":61,"taxonomyTypeDesc":62},[94],{"skillNo":100,"name":101,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":25},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[101]]