/officialunofficial-skills:improve-codebase-architecturefrom Official Unofficial Skills
Scans a codebase for architectural friction, identifies shallow modules and deepening opportunities, and presents candidates as a visual HTML report with before/after diagrams.
Ships in Official Unofficial Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Surface architectural friction and pitch deepening opportunities — refactors that turn shallow modules into deep ones. The goal is testability and AI-navigability.
This command draws on the project's domain model and rests on a shared design vocabulary:
/codebase-design skill for the architecture vocabulary (module, interface, depth, seam, adapter, leverage, locality) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use those exact terms in every suggestion — don't slide into "component," "service," "API," or "boundary."CONTEXT.md names the good seams; the ADRs in docs/adr/ record decisions this command must not re-open.Read the project's domain glossary (CONTEXT.md) and any ADRs covering the area you're touching first.
Then use the Agent tool with subagent_type=Explore to walk the codebase. Skip rigid heuristics — explore organically and mark wherever you feel friction:
Apply the deletion test to anything you suspect is shallow: would deleting it concentrate complexity, or merely shuffle it elsewhere? A "yes, concentrates" is the signal you're after.
Write a self-contained HTML file into the OS temp directory so nothing lands in the repo. Resolve the temp dir from $TMPDIR, falling back to /tmp (or %TEMP% on Windows), and write to <tmpdir>/architecture-review-<timestamp>.html so each run gets its own file. Open it for the user — xdg-open <path> on Linux, open <path> on macOS, start <path> on Windows — and tell them the absolute path.
The report pulls Tailwind from a CDN for layout and styling, and Mermaid from a CDN for diagrams wherever a graph, flow, or sequence carries the structure reliably. Blend Mermaid with hand-built CSS/SVG visuals — Mermaid when the relationships are graph-shaped (call graphs, dependencies, sequences), hand-crafted divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Every candidate earns a before/after visualisation. Be visual.
For each candidate, render a card carrying:
Strong, Worth exploring, Speculative, shown as a badgeClose the report with a Top recommendation section: the candidate you'd take on first and why.
Use CONTEXT.md vocabulary for the domain, and the /codebase-design vocabulary for the architecture. If CONTEXT.md defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
ADR conflicts: if a candidate cuts against an existing ADR, raise it only when the friction is real enough to justify reopening the ADR. Mark it plainly on the card (say, a warning callout: "contradicts ADR-0007 — but worth reopening because…"). Don't catalogue every theoretical refactor an ADR rules out.
See HTML-REPORT.md for the full HTML scaffold, diagram patterns, and styling guidance.
Do NOT propose interfaces yet. Once the file is written, ask the user: "Which of these would you like to explore?"
Once the user picks a candidate, run the /grilling skill to walk the design tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, which tests survive.
Side effects happen inline as decisions firm up — run the /domain-modeling skill to keep the domain model current as you go:
CONTEXT.md doesn't hold? Add the term to CONTEXT.md. Create the file lazily if it's missing.CONTEXT.md on the spot./codebase-design skill and use its design-it-twice parallel sub-agent pattern.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
85 skills in this plugin
/alignmentMeasures a running page for edges, gaps, centres and radii that miss by a pixel or two, judges visual weight, and returns a numbered report with proof./animateBuilds a web animation from scratch and writes the code. Decides in order whether it should animate at all, its purpose, the tool, the properties, the easing and duration or spring, how it interrupts and exits, and reduced motion. Use when asked to animate something, add motion, build a transition, or make a component feel alive. For React Native or Expo use animate-expo. To critique existing motion use review-animations. To audit a whole codebase use improve-animations./animate-expoBuilds animations in React Native and Expo with Reanimated, Gesture Handler, Expo Router and expo-haptics. Decides in order whether to animate, which tool, which properties, spring or timing, and how to stay on the UI thread. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on a device. For web animation use `animate`./animation-performanceDiagnoses and fixes web animations that drop frames. Covers the layout, paint and composite pipeline, cheaper property swaps, CSS and WAAPI against requestAnimationFrame, the accelerated path in Motion, React re-renders per frame, inherited CSS variables, blur cost, and when will-change helps. Use when an animation is janky, choppy or stutters, when choosing which property to animate, or when reaching for will-change or GPU layers. For easing, duration or whether to animate at all, use animate./animation-vocabularyNames a web animation or motion effect from a loose description, for example "the bouncy thing when a popover opens" is Pop in and "the iOS scroll that resists and snaps back" is Rubber-banding. Use when the user asks "what is it called when..." or describes a motion effect and wants the right word to give a designer or an agent. It names effects. It does not design or build them./apple-designApplies Apple's approach to fluid, physical interfaces on the web. Use when building or reviewing gesture-driven UI, spring animation, drag, swipe or sheet interactions, momentum, interruptible transitions, rubber-banding, translucent materials and depth, type tracking and leading, reduced motion, or when a design needs Apple's design principles as a frame.npx claudepluginhub officialunofficial/skills --plugin officialunofficial-skills