AGENT SKILL
am-command-code-simplify
Simplify code for clarity and maintainability — reduce complexity without changing behavior
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 29
- Forks
- 7
01 前言 Front Matter
- name
- am-command-code-simplify
- description
- Simplify code for clarity and maintainability — reduce complexity without changing behavior
- x-agentsmesh-kind
- command
- x-agentsmesh-name
- code-simplify
03 SKILL.md 正文
Invoke the agent-skills:code-simplification skill.
Simplify recently changed code (or the specified scope) while preserving exact behavior:
- Read CLAUDE.md and study project conventions
- Identify the target code — recent changes unless a broader scope is specified
- Understand the code's purpose, callers, edge cases, and test coverage before touching it
- Scan for simplification opportunities:
- Deep nesting → guard clauses or extracted helpers
- Long functions → split by responsibility
- Nested ternaries → if/else or switch
- Generic names → descriptive names
- Duplicated logic → shared functions
- Dead code → remove after confirming
- Apply each simplification incrementally — run tests after each change
- Verify all tests pass, the build succeeds, and the diff is clean
If tests fail after a simplification, revert that change and reconsider. Use code-review-and-quality to review the result.
04 同仓库更多 Skills
research
Research docs and summarize decisions
★ 29
debugging
Systematic debugging workflow for production failures and test regressions.
★ 29
api-generator
Generate REST API endpoints with validation and tests
★ 29
debugging
Systematic debugging workflow for production failures and test regressions.
★ 29
typescript-pro
Apply advanced TypeScript patterns including conditional types, template literal types, and mapped types
★ 29
debugging
Systematic debugging workflow for Replit projects
★ 29