Install
$ agentstack add skill-yz5e-agent-skills-code-simplifier ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Code Simplifier
Simplify only the relevant changed code unless the user explicitly asks for a broader sweep. Preserve behavior, outputs, error semantics, side effects, and public interfaces.
Default to a single-agent simplification pass. Use spawn_agent only when the user explicitly asks for delegation, parallel subagents, or a multi-agent review and the touched scope is broad enough to benefit.
Workflow
- Identify the scope.
- Prefer the files or hunks changed in the current task.
- If the scope is unclear, inspect the named function, file, or recent diff.
- Avoid unrelated cleanup outside the touched area.
- Read the project's local conventions.
- Check
AGENTS.md, nearby code, formatter and lint rules, and type patterns. - Match the repository's style instead of forcing a generic one.
- Reuse existing helpers before introducing new abstractions or dependencies.
- Decide whether to delegate.
- Keep the immediate blocking work local. Form a short plan before spawning anything.
- Do not delegate small, tightly coupled, or urgent blocking work where your next step depends on the answer.
- If the user explicitly asks for parallelism and the work is broad enough, use
spawn_agentfor bounded subtasks that can run in parallel with your local work. - Prefer narrow prompts and explicit file or symbol scope over copying the full thread context. Use
fork_contextonly when the subagent truly needs the same conversation history. - Prefer
exploreragents for read-heavy simplification analysis. Reserveworkeragents for implementation only when the write scope can be split into disjoint files or modules.
- Review the code through three simplification lenses.
- Reuse: prefer existing helpers, utilities, and local patterns before adding new abstractions; remove duplication when the shared shape is stable.
- Quality: improve readability, naming, branching, cohesion, and type clarity; preserve logging, validation, and error semantics.
- Efficiency: remove unnecessary work in the touched code such as redundant passes, allocations, awaits, or lookups when the improvement is obvious and behavior stays identical.
- If the lenses conflict, prefer behavioral safety and readability over extra DRYing or micro-optimizations.
- Simplify with restraint.
- Flatten unnecessary nesting and branching.
- Remove duplication when the shared pattern is stable and improves readability.
- Replace dense one-liners and nested ternaries with explicit control flow.
- Prefer clear names, direct data flow, and small cohesive helpers.
- Keep comments only when they explain non-obvious intent.
- Preserve logging, validation, and error handling behavior.
- Verify before finishing.
- Re-read the edited paths for behavior drift, async changes, type regressions, and altered edge cases.
- Run the smallest relevant validation available when practical.
- If a "simplification" would change behavior or conflict with project conventions, stop and explain the tradeoff instead of forcing it.
Subagent Strategy
- Apply all three lenses inline by default.
- If the user explicitly asks for subagents and the task is broad enough to benefit, split the review into bounded subtasks instead of asking multiple agents to rewrite the same hunk.
- A strong default is up to three parallel
explorersubagents: one for reuse opportunities, one for quality/readability issues, and one for obvious efficiency cleanup in the touched scope. - Keep the main agent focused on the core simplification: reviewing conventions, checking behavior-sensitive code paths, and preparing the final edit plan while the subagents run.
- Ask each subagent for concrete findings with file or symbol references and a short rationale. Prefer recommendations over patches unless the write scopes are clearly disjoint.
- Call
wait_agentsparingly. Only wait when their result is needed for the next step, and do meaningful non-overlapping local work while they run. - Reuse an existing delegated thread with
send_inputwhen a follow-up stays on the same narrow problem; otherwise spawn a new bounded task. - Use
workersubagents only when the user explicitly wants parallel implementation and each worker can own a disjoint write set. Give each worker clear file ownership and tell it not to revert edits made by others. - If you override the delegated model for a hard simplification review, prefer the current strongest available model for ambiguous or high-risk reasoning; as of 2026-04, prefer
gpt-5.5when available and fall back togpt-5.4when it is not. - Use
gpt-5.4-minionly for fast read-heavy scans where latency or cost matters more than depth. - Let simple passes inherit the current model unless there is a clear reason to override.
- Only merge recommendations that preserve behavior and improve the touched code without widening scope.
- Treat efficiency as a restraint check, not a license for speculative performance work.
Guardrails
- Do not change public APIs, storage formats, or user-visible text unless explicitly requested.
- Do not widen a refactor just because more cleanup is possible.
- Do not optimize for fewer lines at the expense of clarity.
- Do not merge separate concerns into one helper or expression just to be concise.
- Keep existing import, module, and file-organization conventions.
- Do not spawn subagents just because the environment supports them. Use them only for clear, parallelizable subtasks.
- Do not duplicate work between the main agent and subagents.
- Do not ask multiple subagents to produce overlapping edits for the same code unless the user explicitly wants competing proposals.
- Do not keep polling or waiting on subagents by reflex. If you are not blocked, keep working locally.
Good Triggers
Simplify this codeClean up this implementationMake this clearer without changing behaviorPolish the refactorReduce the complexity in this functionReview this refactor for reuse, quality, and efficiencyReview this refactor in parallel with subagentsUse subagents to scan this diff for reuse, quality, and efficiency
Expected Output
- Make the code changes directly when the request is actionable.
- Call out any uncertainty that could affect behavior before editing.
- Summarize only the meaningful simplifications and any validation that was run.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: yz5e
- Source: yz5e/agent-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.