From jhostalek-skills
Use when auditing repo topology in a scope — code grouped by type where the repo groups by feature, god-modules, misplaced files, leaky or missing module boundaries, layer-direction violations, import cycles, over-nesting. Triggers on "audit structure", "repo structure review", "fix module boundaries", "check layering", "files in the wrong place".
How this skill is triggered — by the user, by Claude, or both
Slash command
/jhostalek-skills:audit-structureThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
!`cat "${CLAUDE_SKILL_DIR}/../audit-workflow.md"`
!cat "${CLAUDE_SKILL_DIR}/../audit-workflow.md"
Run as the structure dimension. Purpose: catch code in the wrong place — wrong module, wrong layer, wrong grouping — so that related changes stay co-located and module boundaries mean something.
Establish the convention first, and judge only against it — never an imported ideal. Priority order: (1) materialized policy — a written structure doc (*structure*.md, ARCHITECTURE.md, CONTRIBUTING.md) or enforcement config (import-linter, eslint boundaries, dependency-cruiser, ArchUnit); when one exists it is the authority, audit against its rules, don't reinvent a scheme. (2) Infer from what dominates: grouping axis (by-feature folders vs by-type models/+routes/+services/), the recurring file-role vocabulary, and layer direction from the import graph. Directory listings give shape; git log co-change is ground truth for what belongs together. Apply audit-patterns' >60% rule and its git-log recency heuristic — with the structural caveat that long-standing layout is more often load-bearing than long-standing code style.
<findings_scope> Collect these placement and boundary failures — not size, not style.
Drop: framework-mandated layouts (Next.js, Rails, Django) — conventions to respect; consistency in a by-type repo that is by-type throughout — only the outlier breaking the dominant grouping survives; size alone — thin/oversized file belongs to audit-complexity or audit-necessity, you own placement and boundaries; dynamically-resolved layouts (plugin dirs, registry walks, convention-scanned folders) that look misplaced but are wired by mechanism — confirm no loader depends on the path.
Apply in the direction the repo prefers: move to where co-change points, route through the existing public-surface convention, collapse a stray by-type split back into the feature folder, break a cycle by promoting the shared concept to a layer both may depend on. All import sites for a moved file must be updated in the same pass — partial moves leave the build broken. Where a structural linter or policy doc exists, extend its rules so the convention stays pinned.
<output_contract> Auto-fix: behavior-preserving move/route/collapse with all references updated in one commit. Sign-off required: tree-reshaping — re-grouping a directory, splitting or merging modules, changing the layer scheme — sketch the before/after tree as evidence before proceeding. </output_contract>
npx claudepluginhub jhostalek/dotclaude --plugin jhostalek-skillsGuides collaborative design exploration before implementation: explores context, asks clarifying questions, proposes approaches, and writes a design doc for user approval.
Creates structured, bite-sized implementation plans from specs or requirements before writing code. Useful for breaking down multi-step tasks into testable steps with file structure and task boundaries.
Resolves in-progress git merge or rebase conflicts by analyzing history, understanding intent, and preserving both changes where possible. Runs automated checks after resolution.