1---2name: method-cohesion-checker3description: method-cohesion-checker4---5# method-cohesion-checker67## Purpose8Check whether methods are doing one coherent job, expose the right abstraction, and avoid mixed responsibility.910## Trigger this skill when11- Methods are long or mix orchestration with domain logic.12- A method appears to do several conceptual jobs.13- You need split candidates before refactoring.1415## Expected inputs16- method bodies or summaries17- class role18- call graph hints19- side effects20- API intent2122## Deliverables23- cohesion findings24- mixed-responsibility warnings25- split candidates26- abstraction notes27- recommended changes2829## Operating procedure301. Identify the object-oriented concern this skill is meant to assess.312. Separate facts from inferred design intent.323. Review the current structure against OOP fundamentals: responsibility, invariants, ownership, exposure, abstraction, and lifecycle where relevant.334. Surface concrete risks, tradeoffs, and improvement options.345. Prefer minimal structural change that materially improves clarity or safety.356. Hand off to the next most relevant skill if the issue is broader than this skill alone can resolve.3637## Quality gates38- Findings are tied to concrete code structure or stated design intent.39- Recommendations explain *why*, not just *what*.40- Tradeoffs are stated when multiple designs could work.41- Output avoids style nitpicks unless they affect abstraction or maintainability.4243## Handoff targets44- extract-method-refactor if present45- class-responsibility-checker46- naming-and-abstraction-reviewer4748## Output style49- Be explicit about uncertainty.50- Prefer short, evidence-based findings over long vague critique.51- Distinguish design defects from mere preference.52- End with recommended next actions.5354## Failure modes to avoid55- Do not invent framework constraints without evidence.56- Do not recommend sweeping refactors without naming the benefit.57- Do not confuse naming/style issues with true design problems unless they affect abstraction.58- Do not force inheritance, immutability, or statics as ideology.5960## Minimum output skeleton61```md62## Summary63## Findings64## Risks65## Recommendations66## Tradeoffs67## Recommended next skill68```
Run npx skillmds@latest add 45ck/method-cohesion-checker in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
method-cohesion-checker It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
45ck (@45ck) published this skill. Their other Agent Skills are listed on their SkillMD profile.