cleanup-unnecessary-variables
Skill2 starsChanged todayApache-2.0View on GitHub
Safe removal of unnecessary variables during code review and refactoring. Use when simplifying code, inlining temporary or single-use variables, or removing redundant aliases, while preserving runtime behaviour, evaluation order, and variables kept for readability or debugging.
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill when reviewing or editing cleanup/refactor changes that remove or inline variables:
- Distinctive: line 13
Do not remove a value that is reused, mutated, or intentionally named for readability.
- Very specific: line 17
Remove no-op aliases such as const x = y when direct usage is clearer.
- Very specific: line 18
Treat aliases of instance fields or parameters (const params = this._params, const value = props.value) as no-op aliases unless they …
- Very specific: line 22
Do not introduce any.
- Very specific: line 23
Do not use the non-null assertion operator (!).
- Distinctive: line 24
Do not add unnecessary comments or abstractions.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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
Cleanup Unnecessary Variables
Use this skill when reviewing or editing cleanup/refactor changes that remove or inline variables:
- The candidate must be local and non-exported.
- Preserve evaluation order and runtime behavior.
- Do not remove a value that is reused, mutated, or intentionally named for readability.
- Skip values with side-effectful initializers unless inlining keeps the same single execution.
- Skip public constants, config or env bindings, and values used as debug breakpoints or log anchors.
- Inline single-use temporary variables directly at the use site when safe.
- Remove no-op aliases such as
const x = ywhen direct usage is clearer. - Treat aliases of instance fields or parameters (
const params = this._params,const value = props.value) as no-op aliases unless they preserve a required snapshot, narrowing across async boundaries, evaluation order, or readability for repeated complex access. - Inline object literals that are constructed only to be passed immediately to one function or event payload, when doing so preserves clarity and behavior.
- Drop dead assignments and declarations that are never read.
- Flatten deep nesting via guard clauses and early returns when it reduces indentation without obscuring control flow.
- Do not introduce
any. - Do not use the non-null assertion operator (
!). - Do not add unnecessary comments or abstractions.
In this repository56 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agentic-workflowsSkill
- asking-questionsSkill
- broSkill
- browser-accessSkill
- change-review-handoffSkill
- changeset-scopeSkill
- check-skill-updatesSkill
- chillSkill
- ci-loopSkill
- code-reviewSkill
- decision-modelsSkill
- diagnoseSkill
- effect-principlesSkill
- evidence-firstSkill
- gh-stackSkill
- git-contextSkill
- github-development-rulesetsSkill
- github-repository-setupSkill
- grillingSkill
- handoffSkill
- herdr-workflowsSkill
- home-assistant-frontendSkill
- home-assistant-lit-renderingSkill
- human-step-guideSkill
- import-external-skillSkill
- inbox-reportingSkill
- issue-loopSkill
- lit-renderingSkill
- maintain-docsSkill
- npm-jsr-first-publishSkill
- opencode-effectSkill
- pitchfork-dev-serversSkill
- pkexec-rootSkill
- planSkill
- release-oxlint-rulesSkill
- remote-change-diffSkill
- remove-single-use-functionsSkill
- researchSkill
- retroSkill
- review-stagesSkill
- review-steeringSkill
- safe-process-signalsSkill
- session-coordinationSkill
- shared-workflowsSkill
- show-meSkill
- skill-prefixesSkill
- staged-implementationSkill
- task-focusSkill
- task-runnersSkill
- testingSkill
- to-questionnaireSkill
- types-enforce-tsSkill
- wranglerSkill
- writing-dot-skillsSkill
- writing-styleSkill
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.

