Agent Skillselie222/inbox-zero › code-simplifier

code-simplifier

GitHub

用于在当前会话或分支差异中简化、优化代码,提升清晰度与一致性,同时严格保持原有功能行为不变。适用于PR前清理或轻度重构。

.claude/skills/code-simplifier/SKILL.md elie222/inbox-zero

Trigger Scenarios

请求简化最近修改的代码 请求在提交前清理代码以提高可读性 请求对当前变更进行轻度重构

Install

npx skills add elie222/inbox-zero --skill code-simplifier -g -y
More Options

Non-standard path

npx skills add https://github.com/elie222/inbox-zero/tree/main/.claude/skills/code-simplifier -g -y

Use without installing

npx skills use elie222/inbox-zero@code-simplifier

指定 Agent (Claude Code)

npx skills add elie222/inbox-zero --skill code-simplifier -a claude-code -g -y

安装 repo 全部 skill

npx skills add elie222/inbox-zero --all -g -y

预览 repo 内 skill

npx skills add elie222/inbox-zero --list

SKILL.md

Frontmatter
{
    "name": "code-simplifier",
    "description": "Simplify and refine recently modified code for clarity, consistency, and maintainability while preserving exact behavior. Use when asked to simplify, polish, refactor lightly, or clean up current-session changes before review or PR."
}

Code Simplifier

Refine recently modified code without changing what it does. Prioritize readable, explicit code over overly compact solutions.

Reference @AGENTS.md and any more specific local instructions for project conventions.

Scope

Focus on code touched in the current session or current branch diff unless the user explicitly asks for a broader pass.

Do not introduce broad refactors, formatting churn, dependency changes, or unrelated edits.

Rules

  1. Preserve functionality exactly.

    • Keep features, outputs, side effects, data contracts, permissions, and error behavior intact.
    • Change how code is expressed, not what it does.
  2. Apply project standards.

    • Use TypeScript with strict null checks.
    • Keep imports at the top of files.
    • Import directly from original sources; do not add barrel files or re-export patterns.
    • Prefer existing local patterns, frameworks, and helper APIs.
    • Infer types from Zod schemas with z.infer<typeof schema> instead of duplicating types.
    • Keep helper functions at the bottom of files.
    • Add comments only for why, not what.
    • Follow repository React, API route, server action, logging, and testing conventions when touching those areas.
  3. Enhance clarity.

    • Reduce unnecessary complexity and nesting.
    • Remove redundant code and weak abstractions.
    • Improve names when intent becomes clearer.
    • Consolidate related logic only when it improves maintainability.
    • Avoid nested ternaries; prefer straightforward control flow, a small helper, a switch, or a lookup table.
  4. Maintain balance.

    • Do not prioritize fewer lines over readability.
    • Do not create clever dense one-liners.
    • Do not combine too many concerns into one function or component.
    • Do not remove helpful abstractions that make the code easier to understand or extend.

Workflow

  1. Inspect the current diff and identify recently modified sections.
  2. Look for low-risk simplifications that improve clarity or consistency.
  3. Apply only changes that preserve behavior.
  4. Run focused validation when practical for the files touched.
  5. Report significant changes and validation performed.

Version History

  • 633a2ab Current 2026-08-20 17:14

Same Skill Collection

.claude/skills/agent-browser/SKILL.md
.claude/skills/changelog/SKILL.md
.claude/skills/cloud-dev-environment/SKILL.md
.claude/skills/create-pr/SKILL.md
.claude/skills/explain-changes/SKILL.md
.claude/skills/fullstack-workflow/SKILL.md
.claude/skills/llm-test/SKILL.md
.claude/skills/llm/SKILL.md
.claude/skills/project-structure/SKILL.md
.claude/skills/qa-label/SKILL.md
.claude/skills/qa-new-flow/SKILL.md
.claude/skills/review-ai-prompt-changes/SKILL.md
.claude/skills/review/SKILL.md
.claude/skills/test-feature/SKILL.md
.claude/skills/testing/SKILL.md
.claude/skills/ui-components/SKILL.md
.claude/skills/update-packages/SKILL.md
clawhub/inbox-zero-api/SKILL.md
.claude/skills/logging/SKILL.md
.claude/skills/prisma/SKILL.md
.claude/skills/qa-run/SKILL.md
.claude/skills/e2e/SKILL.md
.claude/skills/write-tests/SKILL.md
.claude/skills/wait/SKILL.md

Metadata

Files
0
Version
780453c
Hash
8add10da
Indexed
2026-08-20 17:14

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 08:17
浙ICP备14020137号-1 $お客様$