/bmad-skills:typescript-clean-codefrom bmad-skills
Reviews TypeScript/JavaScript code for 12 classic code smells, TypeScript type hygiene issues, and lint/tsconfig enforcement. Guides refactoring, TDD strategy, and task estimation.
Ships in bmad-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Shotgun Surgery · Feature Envy · Data Clumps · Long Method · Divergent Change · Duplicated Code · Large Class · Long Parameter List · Primitive Obsession · Message Chains · Dead Code · Speculative Generality
You know each one and its refactoring. The value is the checklist, not the definitions — without the names a diff "looks fine"; with them you find the shape. Run all twelve against any change you review or write.
Each examines a different unit, so each sees what the others miss.
| Load | Unit | For |
|---|---|---|
references/smells/tooling.md | the repository | First, in every review. Which smells a linter decides, so those become one "wire this into CI" finding instead of twenty hand-written ones |
references/smells/rules.md | a line, a function | Per-line heuristics (C/E/F/G/N/T), plus the review posture and severity vocabulary that govern all four layers |
references/smells/fowler.md | a modification | The twelve above — detection question, TypeScript remedy, and when NOT to fix for each |
references/smells/typescript.md | a type | TS1-TS10: any leakage, assertion versus validation, exhaustiveness, strictness flags, branded types |
A diff can satisfy every rule in rules.md and still be badly shaped — that is what
fowler.md is for. Reviewing a change means all four.
Three rules that change output more than any catalog entry. Full text in
references/smells/rules.md → "Review posture".
issue,
suggestion, nitpick, question, praise — with (blocking) /
(non-blocking). An author who cannot tell which comments are optional treats
all of them as mandatory, or none of them.A review is done when all four layers have run, every surviving finding carries
a label and (for an issue) a fix, and the report states how many findings were cut
as unlikely to be acted on.
Three rules in these references are positions with live counter-arguments, marked contested where they appear. Present both sides and prefer the author's demonstrated reasoning over the number:
references/functions/rules.md Rule 1. Detect by "can I
name each section?"; the "2-5 lines" figure over-extracts when applied literally.references/comments/rules.md. Keep rationale, invariants, and
non-obvious why; delete restatement and stale comments.references/smells/rules.md. An exhaustive switch over a
discriminated union is idiomatic TypeScript, not a smell.Load the workflow file and follow it. Only code-review, pr-review, and
refactoring are folders with step files: load their workflow.md, then the steps in
order. Each step names the references it needs and updates stepsCompleted in the
output document's frontmatter, so a compacted context resumes from the last completed
step via step-01b-continue.md. The other workflows are single files.
| Workflow | For |
|---|---|
workflows/code-review/workflow.md | Reviewing code for quality |
workflows/pr-review/workflow.md | Reviewing pull requests |
workflows/refactoring/workflow.md | Safe refactoring with tests (step 3 sweeps all twelve; steps 5-8 loop) |
workflows/tdd.md | Test-driven development cycle |
workflows/new-feature.md | Building new functionality |
workflows/bug-fix.md | Fixing bugs properly |
workflows/test-strategy.md | Planning test coverage |
workflows/estimation.md | Estimating tasks (PERT) |
workflows/deadline-negotiation.md | Handling unrealistic deadlines |
references/<topic>/ holds rules.md (the rules), examples.md (curated
TypeScript bad/good pairs — prefer these over inventing your own), and
knowledge.md (concepts).
Code quality: naming · functions · classes · comments · error-handling · unit-tests · formatting · smells
Professional practice: professionalism · saying-no · commitment · coding-practices · tdd · practicing · acceptance-testing · testing-strategies · time-management · estimation · pressure · collaboration
Load the topic's rules.md before advising on it, and cite the rule you applied —
the design problem it names, not the metric that pointed at it. Where a reference
contradicts your general knowledge, the reference wins: it carries this skill's
TypeScript adaptations and thresholds.
references/index.md maps symptom → reference file.
LICENSE (opens in a new tab)references/acceptance-testing/examples.md (opens in a new tab)references/acceptance-testing/knowledge.md (opens in a new tab)references/acceptance-testing/rules.md (opens in a new tab)references/classes/examples.md (opens in a new tab)references/classes/knowledge.md (opens in a new tab)references/classes/rules.md (opens in a new tab)references/coding-practices/examples.md (opens in a new tab)references/coding-practices/knowledge.md (opens in a new tab)references/coding-practices/rules.md (opens in a new tab)references/collaboration/examples.md (opens in a new tab)references/collaboration/knowledge.md (opens in a new tab)references/collaboration/rules.md (opens in a new tab)references/comments/examples.md (opens in a new tab)references/comments/knowledge.md (opens in a new tab)references/comments/rules.md (opens in a new tab)references/commitment/examples.md (opens in a new tab)references/commitment/knowledge.md (opens in a new tab)references/commitment/rules.md (opens in a new tab)references/error-handling/examples.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub bmad-labs/skills --plugin bmad-skills23 skills in this plugin
/architecture-designUse when the user asks for a design package, designs folder, detailed design, solution design, or contracts of a system or service before it is built — C4, project structure, module design, ERD or data model, domain events, ingress or egress API (REST, gRPC, Kafka, Pub/Sub, SQL), sequence, class, state, or data pipeline diagrams — at a high, medium, or low level of detail; or asks to review, correct, or update an existing design package against its requirements./architecture-viz-studioUse when the user wants to visualize, present, "show", animate, or build an interactive web page for a software architecture, system design, technical concept, data model, pipeline, or product story — phrases like "intro page", "architecture visualization", "interactive diagram", "scrollytelling", "3D system map", "ERD page", "design walkthrough", "make our architecture look impressive", or "present this design to stakeholders". Also use before hand-rolling Three.js, GSAP or SVG architecture diagrams from scratch, or when the user wants visual feedback on such a page through an edit mode./bmad-leaderUse when a BMAD project has intent, PRD, architecture and optionally technical design, and the user wants one long-running session to drive implementation of stories or epics through bmad-build subagents ("lead the build", "run epic N", "drive the stories"); also when resuming a build ("resume the leader"), reporting progress, closing an epic, unblocking a subagent decision, or when the user explicitly asks for a retrospective of a leader run./book-converterConvert EPUB books (.epub) to high-quality formatted Markdown using pandoc and AI-assisted formatting. Use when the user provides an EPUB file path and wants it converted to professionally formatted Markdown (ebook to markdown, epub to md). This skill handles the complete workflow from EPUB extraction through AI-driven content formatting, including joining split paragraphs, correcting code blocks, standardizing headers, and creating a proper Table of Contents./close-loop-dev-setupUse when an agent cannot validate the product the way a human would — no browser or desktop harness, no screenshots, no vision check, or bmad-leader reports a UAT level as NOT RUN; also when the user says "set up screenshot testing", "let the agent see the UI", "drive the app with Playwright" or asks for a visual check, or to set up a cua-box or tart-box sandbox. Sets up a minimal drive-and-observe loop, by default in a per-project sandbox (Docker or Tart VM), and proves it can fail./create-intentUse when turning Jira stories, tickets, or raw requirement notes into business intent documents (intent, functional and non-functional requirements, open questions) before a PRD or design, when requirements are unclear, conflicting, or incomplete and need questions for a PO, or when the user says "create intent", "summarize the stories", "what does business want", or answers earlier intent questionsOther plugins' skills for the same job