Skip to main content
ReviewOfficialCertifiedReviewed Dec 1, 2026

Architecture Uplift

v2.0.51 install

Install this skill

No account required. Pick your tool, then copy.

Run in your terminal. It detects your AI tool.

npx @skills-hub-ai/cli install architecture-uplift

What this does: Assess a codebase's architecture with hard evidence — module map, dependency direction, layering breaks, coupling and cohesion hotspots weighted by git churn — then rank 3-5 improvement moves by risk-adjusted value and actually execute the lowest-risk move end to end with tests green. Use when the user asks to improve a codebase's architecture, find coupling hotspots, untangle layering, or 'what should we refactor first'.

Or get the file:
Browse all CLI commands →
Manual setup by platform

Claude Code

~/.claude/skills/architecture-uplift/SKILL.md

Setup guide →

Signing

SignedSLSA L2
Signed by
skills-hub.ai distributor
Method
Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
Key
skills-hub-ed25519-2026-11
Signed
0Save

Instructions

You are an autonomous software architect who ships refactors, not slide decks. Work through every phase end to end in one run, choose sensible defaults where the codebase leaves room for judgment, and record each decision in the final architecture doc.

TARGET: $ARGUMENTS
If arguments name a directory, package, or concern (e.g. "the api layer"), scope assessment there but still map its inbound/outbound dependencies. If empty, assess the whole repository.

=== PRE-FLIGHT ===

  1. Confirm you are in a git repository (git rev-parse --git-dir). No git: proceed, but churn scoring is unavailable — state this and weight by size/fan-in only.
  2. Detect the stack: language(s) by file census (git ls-files | sed 's/.*\.//' | sort | uniq -c | sort -rn), package layout (single package, workspaces/monorepo, multi-module), and build/test commands from package.json, Makefile, pyproject.toml, go.mod, Cargo.toml, or CI config.
  3. Run the test suite once and record the baseline: command, pass/fail counts, duration. If tests fail at baseline: record the failing set — the uplift move must not grow it. If NO test suite exists: Phase 4 is restricted to moves verifiable by typecheck/build alone (file moves, import re-exports), and this restriction goes in the report.
  4. Confirm the working tree is clean enough: uncommitted changes present means all uplift edits go on isolated commits touching only uplift files.

=== PHASE 1: MODULE MAP AND DEPENDENCY DIRECTION ===

  1. Identify the module units the codebase actually uses (top-level dirs, workspace packages, Go packages, Python packages).
  2. Build the dependency edge list between modules by scanning imports (grep import/require/use/from statements; use madge/dependency-cruiser/go list -deps-style tools only if already installed — do not install tools).
  3. Infer the intended layering from structure and naming (e.g. ui -> application -> domain -> infrastructure, or routes -> services -> db). State the inferred layering explicitly; it is a hypothesis, labeled as such.
  4. Flag boundary breaks, each with the importing file:line as evidence:
    • Edges pointing against the inferred layering direction.
    • Cycles between modules (list every edge in the cycle).
    • "shared"/"utils"/"common" modules that import FROM feature modules (dependency magnets).
    • Deep imports that sidestep a module's public entry point (index/mod/package facade).
    • Modules imported by everything AND importing everything (god modules).

VALIDATION: a module list, an edge list, and a boundary breaks list (possibly empty) all exist with file-level evidence for each boundary break (importing file:line).
FALLBACK: import scanning is unreliable (dynamic imports, DI containers, reflection): report edges you could verify and mark the map "partial — static analysis only".

=== PHASE 2: HOTSPOT SCORING ===

  1. Per module and per file over ~1000 lines, compute:
    • Fan-in / fan-out (from the Phase 1 edge list; file-level for big files).
    • Size: wc -l.
    • Churn: git log --since='12 months ago' --name-only --pretty=format: | sort | uniq -c | sort -rn (fall back to full history if the repo is younger).
  2. Hotspot score = normalized churn x normalized (fan-in + fan-out) x size factor. High-churn + high-coupling files are where architecture problems cost real money; a tangled file nobody touches intentionally scores low.
  3. Produce the top 10 hotspots with all three raw numbers shown, not just the composite.

VALIDATION: top-10 table exists with raw churn, fan-in/out, and LOC columns.
FALLBACK: no git history (fresh clone with shallow depth): run git fetch --unshallow if cheap; otherwise score on coupling x size and label the table "churn unavailable".

=== PHASE 3: UPLIFT MOVES (RANKED) ===

  1. Propose 3-5 concrete moves. Each MUST specify all six fields:
    • The change: files created, moved, and edited, by path.
    • The boundary break or hotspot it addresses, referencing Phase 1/2 evidence.
    • Expected value: which future changes get cheaper, concretely.
    • Blast radius: exact count of importing files that must change, counted from the edge list — never guessed.
    • Risk level: Low = mechanical and fully verifiable by tests/typecheck; Medium = behavior-adjacent; High = touches runtime semantics.
    • Rollback note: usually git revert of the move's commits; call out anything that would not revert cleanly.
  2. Rank by risk-adjusted value: value / blast radius, with High-risk moves never ranked above Medium regardless of value.
  3. Typical move shapes to consider:
    • Break one cycle by extracting an interface/types-only module both sides can depend on.
    • Give a module a public entry point and rewrite all deep imports through it.
    • Split a god-file along its churn seams (the functions that change together stay together).
    • Invert a wrong-direction edge with a small port/adapter.
    • Quarantine "utils" by relocating feature-owned helpers into their features.

VALIDATION: every move has all six fields; blast radius is a counted number with the counting command shown.
FALLBACK: fewer than 3 defensible moves exist (architecture is genuinely fine): say so plainly, list the 1-2 real ones or zero, and skip Phase 4 only if zero.

=== PHASE 4: EXECUTE THE LOWEST-RISK MOVE ===

  1. Take the lowest-risk move from the ranking (not the highest-value one; executing the smallest-blast-radius change first keeps the refactor recoverable).
  2. Execute in small steps; after each step run typecheck/build; commit each coherent step with message refactor(arch): <step> [uplift: <move name>]. Respect the ~400 LOC per commit ceiling.
  3. Mechanical rewrites of importers (path updates) may be scripted with sed/codemod, but verify by compiler, not by eyeball.
  4. Run the full test suite. Baseline-passing tests must all pass; the pre-existing failure set must not grow.
  5. Re-derive the affected slice of the dependency map and confirm the targeted boundary break/cycle is actually gone.

VALIDATION: tests green vs baseline, boundary break demonstrably removed, commits self-contained.
FALLBACK: the move turns out riskier mid-flight (hidden dynamic import, test explosion): stop, git revert the move's commits cleanly, mark it "attempted — reverted, here is what we learned", and execute the next-lowest-risk move if one qualifies; otherwise report with the revert documented.

=== PHASE 5: ARCHITECTURE DOC ===

Write docs/architecture/uplift-<YYYY-MM-DD>.md (create dirs) containing, in order:

  1. Stack summary and how the module map was derived.
  2. Inferred layering with its confidence level and the evidence behind it.
  3. BEFORE mermaid graph TD of modules, boundary break edges styled red.
  4. Hotspot top-10 table (churn, fan-in/out, LOC, composite).
  5. The ranked move list with all six fields per move.
  6. The executed move's narrative: steps, commit hashes, test evidence before/after.
  7. AFTER mermaid diagram showing the removed boundary break.
  8. Remaining moves as a prioritized backlog with blast radii.
    Keep mermaid node counts <= 20 by grouping small modules into labeled clusters.

VALIDATION: file exists, both diagrams parse (balanced brackets, valid arrow syntax), backlog present.
FALLBACK: module count too high for a readable diagram: diagram the affected subsystem only and state the elision.

=== OUTPUT ===

  1. The doc at docs/architecture/uplift-.md.
  2. Executed commits on the current branch (listed by hash + message).
  3. A terminal summary:
    • Boundary breaks found and hotspot #1.
    • Move executed, with test delta (before/after pass counts).
    • The top remaining move with its counted blast radius.

=== SELF-REVIEW ===

Before finishing, assess your own work on three dimensions, each 1-5: Complete (map + scoring + ranked moves + one executed move + doc all delivered), Robust (test baseline honored, revert path proven or unneeded), Clean (commits scoped, no unrelated edits). If any dimension falls below 4, repair it within this run when feasible; otherwise record it as a known limitation in the doc's header.

=== LEARNINGS CAPTURE ===

Append to ~/.claude/skills/architecture-uplift/LEARNINGS.md: date + repo, which detection worked (imports/churn), which move shape was executed, friction encountered, suggested patch to this skill, verdict [Smooth/Minor friction/Major friction].

=== STRICT RULES ===

  1. Never present the inferred layering as fact; it is labeled a hypothesis with the evidence that produced it.
  2. Blast radius is always a counted number from the edge list, never an adjective.
  3. Never execute a Medium- or High-risk move when a Low-risk move exists; never execute any move without a recorded test (or typecheck) baseline.
  4. Never leave a half-executed move in the tree — complete it or revert it fully.
  5. Every boundary break and hotspot claim cites file:line or a reproducible command.
  6. Do not install analysis tooling; work with what the repo has.
  7. Churn weighting is mandatory when git history exists; a coupling-only ranking must be labeled as degraded.
This skill doesn’t include stateful context yet, instructions only. Learn about stateful skills.

Security

Loading security scan...

Reviews (0)

Browse all →
design-animateAdd purposeful motion with modern CSS (scroll-driven animations, view transitions, @starting-style) or Flutter implicit animations, with reduced-motion support. Triggers: add animation, animate, add motion, transitions, scroll animation.86 installsdesign-auditRead-only design quality audit (WCAG 2.2 accessibility, performance, theming, responsive, anti-patterns) with scored, prioritized fixes. Triggers: 'audit design', 'check accessibility', 'a11y audit', 'design review', 'UI quality check'.64 installsdiagramGenerate Mermaid architecture diagrams from the codebase: C4 context/container, sequence diagrams for key flows, ER from schemas, module dependency graphs. Triggers: 'architecture diagram', 'ERD', 'sequence diagram', 'dependency graph', 'C4 diagram'.63 installssecureRead-only full-stack security posture assessment with a 0-100 risk score: dependency CVEs, dangerous code patterns, auth gaps, config and secrets, PII handling; routes to deeper skills. Triggers: 'security posture', 'how secure is this', 'security scan', 'risk score'.62 installsdesign-polishFinal quality pass before shipping: fixes alignment, spacing, type hierarchy, color consistency, interactive states and motion timing to match the existing design language. Triggers: 'polish the UI', 'make it pixel perfect', 'final design pass'.60 installscode-smellScan a codebase for Fowler's code smells (god classes, long methods, feature envy, data clumps, primitive obsession, shotgun surgery, message chains) and rank refactorings by impact. Triggers: 'code feels messy', 'before a refactor', 'find maintainability problems'.53 installs

More from Skills Hub

View source →
security-reviewEvidence-based security audit of a codebase: auth and authz gaps, IDOR, JWT/OAuth flaws, injection, data exposure, secrets and session issues, with exploit scenarios and fixes. Triggers: security review, audit auth, find vulnerabilities.207 installsunit-testFind untested code, write unit tests covering edge cases, error paths and boundaries in the project's own style, run them and fix failures. Triggers: add unit tests, increase coverage, test edge cases, test error handling.178 installshumanizerRewrite AI-drafted content so it reads human: cut filler and hedging, vary sentence length, curb em dashes, add specifics and voice. Triggers: humanize this, remove AI tells, sounds like ChatGPT, make it sound human.145 installsweb-gameScaffold a production-ready browser game (Phaser, PixiJS or Three.js) with Vite, TypeScript, input, audio, saves, responsive canvas and itch.io/PWA deploy. Triggers: web game, browser game, html5 game, phaser game, pixi game, three.js game.145 installsdesign-to-codeTurn a design into production frontend code in four phases: design-system tokens and components, responsive layout, dark mode, then a UX audit that fixes what it finds. Triggers: implement this design, Figma to code, design to code, build the UI from this.134 installsflutterBuild a complete Flutter app from a video, screenshots, description or /mvp output, matching the observed UI and flows, with tests. Triggers: flutter app, build a mobile app, build from video/screenshots, clone this app, make an app like, recreate this UI.131 installs

More Review skills

Browse category →
code-reviewSenior-level code review of a diff, PR, or files: finds real bugs, security and performance risks, proves each with a concrete failure scenario, and ranks fixes by severity.1,213 installsrefactorBehavior-preserving refactoring: removes duplication, deep nesting, and unclear names in small test-verified steps, without touching public APIs or mixing in fixes.205 installssecurity-auditSecurity audit that traces untrusted input from every entry point: injection, auth and IDOR gaps, leaked secrets, data exposure, misconfiguration, and vulnerable dependencies; fixes critical and high issues.70 installsdatabase-reviewReview schema, query patterns and data access code for correctness and performance: normalization, indexes, constraints, types, N+1s, pooling, transactions. Triggers: review database schema, missing indexes, N+1 queries, audit data types.33 installsarch-reviewArchitect-level story review with component reuse, domain consistency, data privacy, service architecture, and infrastructure checks. Design review before coding or implementation validation after. Use when a story or design needs an architect sign-off before coding, or the user asks to 'review this story', 'check the architecture of this change', or 'validate the implementation against the design'.27 installsdb-schemaDatabase schema review or design grounded in the app's real queries: constraints, indexes, N+1 and pagination issues, data modeling, and safe migrations for Postgres, MySQL, SQLite, and MongoDB.26 installs

Frequently asked questions about architecture-uplift

What does the architecture-uplift skill do?

Assess a codebase's architecture with hard evidence — module map, dependency direction, layering breaks, coupling and cohesion hotspots weighted by git churn — then rank 3-5 improvement moves by risk-adjusted value and actually execute the lowest-risk move end to end with tests green. Use when the user asks to improve a codebase's architecture, find coupling hotspots, untangle layering, or 'what should we refactor first'. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.

How do I install the architecture-uplift skill?

Run `npx @skills-hub-ai/cli install architecture-uplift` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/architecture-uplift/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.

Which AI tools does architecture-uplift work with?

architecture-uplift runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.

Is the architecture-uplift skill free?

Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.

How do I use architecture-uplift after installing it?

In Claude Code, type `/architecture-uplift` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.

Can I share the architecture-uplift skill with my team?

Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.