code-smells/dispensables
Detect and remove Dispensables — pointless and unneeded code elements.
Skill by gentleman-programming
Install
Works with Claude Code. Read the repository before you give any tool access to your data.
npx agentmarket install skill/johnnystefan-code-smells-dispensables
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: data
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/code-smells-dispensables
Tools it pre-approves 7
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Read,Edit,Write,Glob,Grep,Bash,Task
What's inside
- Skill name
code-smells/dispensables- Description
- Detect and remove Dispensables — pointless and unneeded code elements. Trigger: When identifying Comments as deodorant, Duplicate Code, Lazy Class, Data Class, Dead Code, or Speculative Generality.
- License
- Apache-2.0
- Allowed tools
- Read,, Edit,, Write,, Glob,, Grep,, Bash,, Task
- Metadata
- author: gentleman-programming · version: 1.0 · auto_invoke: Reviewing code for unnecessary elements and duplication
- Instructions
- 93 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Agent Skills spec issues
- name: only lowercase letters, digits and single hyphens allowed
- name: "code-smells/dispensables" does not match folder "dispensables"
Files (1)
- SKILL.md
SKILL.md (first lines)
# Skill: Detect and Refactor Dispensables
## Purpose
This skill enables the agent to identify and remove "Dispensables" — pointless and unneeded code elements whose absence makes the codebase cleaner, more efficient, and easier to understand.
## Domain Knowledge: The 6 Dispensables
1. **Comments:** A method is filled with explanatory comments. Comments often act as a "deodorant" for fishy code that should be improved instead.
2. **Duplicate Code:** Two code fragments look almost identical. Usually occurs through copy-paste programming or multiple developers working on the same feature.
3. **Lazy Class:** A class that doesn't do enough to earn the cost of its maintenance.
4. **Data Class:** A class containing only fields and basic accessors (getters/setters). These are mere containers that cannot independently operate on their data.
5. **Dead Code:** Variables, parameters, fields, methods, or classes that are no longer used.
6. **Speculative Generality:** Unused classes, methods, or parameters created "just in case" for future features that never arrived.
## Procedural Instructions
### 1. Detection Phase
- **Audit Comments:** Identify code fragments that cannot be understood without comments. If a comment explains _what_ the code does, it's a candidate for refactoring.
- **Scan for Duplication:** Look for similar logic in different methods of the same class or across different classes in the same hierarchy.
- **Evaluate Class Value:** Identify classes that have become ridiculously small after refactoring or were designed for features that don't exist.
- **Check Behavioral Encapsulation:** Identify classes that only hold data and lack methods for operating on that data.
- **Locate Dead Elements:** Use static analysis to find methods or variables that are never called or referenced.
### 2. Treatment Phase
- **For Comments:**
- Use **Extract Variable** for complex expressions.
- Use **Extract Method** and **Rename Method** to make the code self-explanatory.
- **For Duplicate Code:**
- Use **Extract Method** to centralize logic.
- Use **Pull Up Field/Method** if duplication is in subclasses.
- Use **Substitute Algorithm** if two methods do the same thing differently.
- **For Lazy Classes & Speculative Generality:**
- Use **Inline Class** or **Collapse Hierarchy** to merge or delete the redundant structure.
- Use **Inline Method** or **Remove Parameter** for unused elements.
- **For Data Classes:**
- Use **Encapsulate Field** to hide public fields.
- Use **Move Method** and **Extract Method** to migrate functionality from the client into the Data Class itself.
## TypeScript Examples
### Comments vs. Self-Explanatory Code
```typescript
// BAD: Comment explaining a complex expression
// Check to see if the employee is eligible for full benefits
if (employee.flags & HOURLY_FLAG && employee.age > 65) {
/* ... */
}
// GOOD: Refactored using Extract Variable
const isEligibleForFullBenefits =
employee.flags & HOURLY_FLAG && employee.age > 65;
if (isEligibleForFullBenefits) {
/* ... */
}
```
### Data Class to Rich Domain Object
```typescript
// BAD: A Data Class with no behavior
class Rectangle {
constructor(
public width: number,
public height: number,
) {}
}
const rect = new Rectangle(10, 20);
const area = rect.width * rect.height; // Client does the work
// GOOD: Behavior moved into the class
class Rectangle {
constructor(
private width: number,
private height: number,
) {}
getArea(): number {
return this.width * this.height;
}
}
```
## Payoff
- **Reduced Size:** The codebase becomes slimmer and easier to navigate.
- **Lower Maintenance:** Fewer classes and methods mean less mental bandwidth required.
- **Improved Clarity:** Code becomes intuitive, making comments unnecessary and logic obvious.From johnnystefan/test-saas-business, Apache-2.0.
More from johnnystefan/test-saas-business
- 0.403score
accessibility
web-quality-skills
Audit and improve web accessibility following WCAG 2.2 guidelines.
SkillDFreshness: DClaude Code +9 - 0.347score
pattern-state
gentleman-programming
Teaches and applies the State behavioral design pattern — allowing an object to alter its behavior when its internal state changes, appearing as if the object…
SkillDFreshness: DClaude Code - 0.347score
pattern-iterator
gentleman-programming
Teaches and applies the Iterator behavioral design pattern — providing sequential access to elements of a collection without exposing its internal…
SkillDFreshness: DClaude Code - 0.347score
pattern-mediator
gentleman-programming
Teaches and applies the Mediator behavioral design pattern — reducing direct dependencies between objects by forcing them to communicate only through a…
SkillDFreshness: DClaude Code - 0.347score
pattern-memento
gentleman-programming
Teaches and applies the Memento behavioral design pattern — capturing and externalizing an object's internal state without violating encapsulation, enabling…
SkillDFreshness: DClaude Code - 0.347score
pattern-observer
gentleman-programming
Teaches and applies the Observer behavioral design pattern — defining a subscription mechanism to notify multiple objects about events in the observed object.
SkillDFreshness: DClaude Code - 0.347score
pattern-chain-of-responsibility
gentleman-programming
Teaches and applies the Chain of Responsibility behavioral design pattern — passing requests along a chain of handlers where each handler decides to process…
SkillDFreshness: DClaude Code - 0.347score
pattern-command
gentleman-programming
Teaches and applies the Command behavioral design pattern — encapsulating requests as objects to support parameterization, queuing, logging, and undo/redo…
SkillDFreshness: DClaude Code - 0.341score
code-smells/change-preventers
gentleman-programming
Detect and refactor Change Preventers — flaws that hinder software evolution.
SkillDFreshness: DClaude Code - 0.341score
code-smells/couplers
gentleman-programming
Detect and refactor Couplers — excessive coupling or over-delegation between classes.
SkillDFreshness: DClaude Code - 0.341score
code-smells/oo-abusers
gentleman-programming
Detect and refactor OO Abusers — incorrect or incomplete application of OOP principles.
SkillDFreshness: DClaude Code - 0.341score
code-smells/bloaters
gentleman-programming
Detect and refactor Bloaters — code, methods, and classes that have grown too large.
SkillDFreshness: DClaude Code
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Apr 1, 2026 (7 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.0
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gentleman-programming
- 0.724score
gentleman-bubbletea
gentleman-programming
Bubbletea TUI patterns for Gentleman.Dots installer.
SkillAFreshness: A★ 7.6KClaude Code +9 - 0.723score
engram-backlog-triage
gentleman-programming
Backlog triage protocol for Engram: audit open issues and PRs, classify each item, infer maintainer ideology from comments, and produce an actionable…
SkillAFreshness: A★ 7.6KClaude Code +9 - 0.720score
engram-architecture-guardrails
gentleman-programming
Architecture guardrails for Engram across local store, cloud sync, dashboard, and plugins.
SkillAFreshness: A★ 7.6KClaude Code +9 - 0.720score
engram-branch-pr
gentleman-programming
PR creation workflow for Engram following the issue-first enforcement system.
SkillAFreshness: A★ 7.6KClaude Code +9 - 0.720score
engram-business-rules
gentleman-programming
Product and business-rule guardrails for Engram.
SkillAFreshness: A★ 7.6KClaude Code +9 - 0.720score
engram-commit-hygiene
gentleman-programming
Commit and branch naming standards for Engram contributors, enforced by GitHub rulesets.
SkillAFreshness: A★ 7.6KClaude Code +9
Cite this page
code-smells/dispensables skill. Agent Mart. https://agentmart.dev/skills/johnnystefan-code-smells-dispensables (last updated 2026-10-24)