/kenji:enhance-arch-boundariesfrom kenji skills
Enforces architecture boundaries in CI using dependency-cruiser or eslint-boundaries: layer direction, feature isolation, forbidden imports. Stops import spaghetti from degrading repo structure.
Ships in kenji 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.
None: SKILL.md is the whole skill.
Degree of freedom: MIXED. Recovering the model
[HIGH freedom]; do-not-invent, shrink-only baseline, and deliberate-violation
probes [LOW freedom — run exactly].
Codify the repo's intended structure as rules that block merge. Import spaghetti is how agents degrade architecture: each import looks locally reasonable, no single diff is wrong, and after forty sessions the layering is gone. A rule in AGENTS.md is advisory. A dependency-cruiser rule in the aggregator gate is physics.
| Skill | Owns |
|---|---|
| enhance-arch-boundaries (this) | Mechanical boundary rules + shrink-only baseline |
audit-backend-architecture | Advises which pattern to adopt — does not enforce |
housekeep-gates | Wires this check into the aggregator |
docs-adr | Records why the model was chosen |
enhance-agent-guardrails | Broader guard install; this owns the import graph |
Observe:
app/dashboard/page.tsximports@/lib/supabase/admin(service-role). No boundary rule. Interpret: the intended split exists in folder names but is not physics. Classify: forbidden edge — client → server-only. Fix: dependency-cruiser / eslint-boundaries rule; grandfather other violations into a shrink-only baseline; probe a new forbidden import fails CI.
The rules must encode the architecture the repo means to have.
features/*, app/,
lib/, server/, components/, monorepo packages).audit-backend-architecture output if it exists — that is the
drift to stop.ui → application → domain → infrastructure, never reverse), feature
units that must stay isolated, special zones (server-only, secrets,
generated).State the model in ten lines before writing any rule. If the repo genuinely has no intended structure, stop and say so — enforcing a structure nobody chose creates fights, not quality. Propose a minimal layering first.
Tool by stack: dependency-cruiser (framework-agnostic JS/TS), eslint-plugin-boundaries (when living inside ESLint is preferable), Nx module-boundary tags, import-linter (Python).
Core rules, each mapped to the confirmed model:
features/x/index.ts), never deep paths. Shared code goes
through shared/, not sideways.plan-rls-audit / plan-secrets-audit), UI
importing the DB layer directly, production importing test utilities,
anything importing generated internals.workflow-housekeep).devDependencies from shipped code;
deprecated internals marked un-importable so migration ratchets.Do not weaken the rules to fit existing violations, and do not block the repo on fixing them all.
housekeep-gates.housekeep-gates)
and mirror it in local hooks (same command, two callers).docs-adr) so a future
session knows the layering was chosen, by whom, and why the rejected
alternative lost.docs-adraudit-backend-architecture; why → docs-adrhousekeep-gatesApplied directly (enhance-family). Pause for approval only on the model confirmation and before committing the baseline.
What SKILL.md sets; muted values are Claude Code's defaults
highnpx claudepluginhub kensaurus/skills --plugin kenji162 skills in this plugin
/audit-accessibilityWCAG 2.2 AA audit via playwright-cli: axe-core, keyboard, contrast, target size, focus, ARIA. Use when "audit accessibility", "check a11y", "WCAG audit", "check keyboard nav", or "test screen reader".
/audit-agent-speedMeasure and fix a slow coding-agent setup: status line, hooks, instruction bloat, effort, worktree pile-up, antivirus and indexer scans. Use when "Claude is slow" or "CPU is pinned". App speed → audit-performance.
/audit-analyticsRead-only audit of product-analytics events (PostHog, Amplitude, Mixpanel, GA4): taxonomy, funnels, consent-gated firing, dead or duplicate events. Use when "audit our analytics", "are we tracking the right events", or "funnel instrumentation".
/audit-auth-flowsRead-only audit of app-layer auth: route×gate matrix, session lifecycle, OAuth, provider traps (getSession vs getUser, middleware-only gates, CVE-2025-29927). Use when "audit our auth" or "check middleware protection". RLS → plan-rls-audit.
/audit-backend-architectureRead-only backend-architecture audit and pattern advisor, gated by stack. Use when "audit backend architecture", "which pattern should I use", "am I over-engineering", or "sync vs event-driven". Enforced boundaries → enhance-arch-boundaries.
/audit-bundle-sizeAnalyse and shrink a web app's JavaScript bundle. Use when "reduce bundle size", "code splitting", "slow initial load", or "why is the bundle so big". Runtime → audit-performance.
Other plugins' skills for the same job