squid-clean-docs
Strip redundancy from prose — docs, READMEs, code comments, docstrings — keeping behaviour identical.
Periodic architectural sweep — reads existing ADRs, maps modules/dependencies/layering, and reports up to 10 prioritised findings shaped as refactor proposals `/squid-refactor` can consume directly.
$ npx -y skills add iusztinpaul/squid --skill squid-architecture-review --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/squid-architecture-reviewContext preview
The summary Claude sees to decide when to auto-load this skill.
Periodic architectural sweep — reads existing ADRs, maps modules/dependencies/layering, and reports up to 10 prioritised findings shaped as refactor proposals `/squid-refactor` can consume directly.
name: squid-architecture-review description: >- Periodic architectural sweep — reads existing ADRs, maps modules/dependencies/layering, and reports up to 10 prioritised findings shaped as refactor proposals `/squid-refactor` can consume directly. disable-model-invocation: true argument-hint: "[scope-path or component name; default = whole repo]"
The team's day-to-day pipeline (`/squid-implement-task`, `/squid-implement-night`) operates at task grain. Long-horizon codebase health — drift, unintended coupling, dead modules, layering violations — accumulates between tasks and never gets addressed unless someone deliberately looks. This skill is that deliberate look.
The output is **not a single PR**. It's a prioritised backlog of refactor proposals, each shaped so `/squid-refactor` can pick one up and turn it into a Tasks Plan.
You are the **auditor** — you delegate exploration to sub-agents, you read the target repo's `docs/adr/` to avoid re-proposing settled questions, and you produce a written report. You do NOT write code, do NOT start refactors, and do NOT decide priority for the team — you propose, the human prioritises.
`$ARGUMENTS`:
Resolve `$ARGUMENTS`. If empty, ask the user one question via `AskUserQuestion`:
> Whole repo, one component, or a specific subtree?
Echo the resolved scope back as a one-line confirmation. Don't block.
Read the repo's `docs/adr/` end-to-end if it exists. Build a mental model of:
Never re-propose what an ADR already settled. If ADRs don't exist, the hand-off's ADR action (Step 7) says so.
Also read, if present:
Spawn 2–3 Explore agents in parallel:
Agent(
subagent_type="Explore",
prompt="""Architecture mapping pass on {scope}.
Produce four artefacts:
(1) Module / package list with one-line responsibility per module (file:line for the canonical entry point).
(2) Dependency graph — who imports whom. Flag any cycles. Flag any "junk drawer" modules imported by everyone.
(3) Layering — name the de-facto layers (e.g., handlers → services → repositories → models) and list any layer-skipping imports.
(4) Public surface — what's exported / consumed by other components or external callers. Mark anything intended-internal that's leaked.
Be exhaustive on the dependency graph; missing an edge produces a wrong recommendation. Report as four sections."""
)
Agent(
subagent_type="Explore",
prompt="""Hot-spot scan on {scope}.
Find:
(1) Files with > 500 lines.
(2) Files / modules touched by > 30% of commits in the last 6 months — `git log --since='6 months ago' --name-only | sort | uniq -c | sort -rn | head -20`.
(3) Tests with > 100 setup lines or > 5 fixtures — usually a smell that the system-under-test is too coupled.
(4) `# TODO` / `# FIXME` / `# HACK` markers — count and cluster.
(5) Any `# type: ignore` / `eslint-disable` / `nolint` clusters — places where the team is fighting their own static analysis.
Report as five sections with file:line."""
)When agents return, **read the top-3 most-implicated files yourself**. Don't rely on summaries on the load-bearing modules — you need firsthand familiarity to call findings credibly.
Walk these dimensions. For each, form 0 or more findings. Don't manufacture findings to pad the report — empty dimensions are fine and signal health; say so explicitly in the report ("Layer violations: none observed").
| Dimension | What to look for | |---|---| | **Cycles** | Import cycles between modules / packages. Always a smell. | | **Layer violations** | Lower layers (e.g., models) importing higher layers (e.g., HTTP handlers). | | **God modules** | One module that everything imports; usually means responsibilities accreted. | | **Junk drawers** | `utils/`, `common/`, `helpers/` modules with > 10 unrelated functions. | | **Hidden coupling** | Two modules that should be independent but share a hidden contract (a shape, a magic string, an env var). | | **Test smells** | High setup-to-assert ratio; brittle tests on private internals; flaky tests. Usually rooted in a structural problem in the SUT. | | **API leakage** | Internal types reaching public surface; public surface that should be private (e.g., a route that no caller uses). | | **Dead code** | Unused exports, unreachable branches, modules with zero importers. | | **Over-engineering** | Abstraction the code doesn't earn: a single-implementation interface / factory / wrapper that only forwards, a layer with one caller, config nobody sets, hand-rolled logic the stdlib ships, or a dependency duplicating a platform/framework feature. Tag each with the same `delete`/`stdlib`/`native`/`yagni`/`shrink`
Strip redundancy from prose — docs, READMEs, code comments, docstrings — keeping behaviour identical.
Shrink an agent harness (.agents/ skills + resources) to the minimum tokens that keep the exact same logic. Never touches…
Shrink the memory files sessions load — the root AGENTS.md plus every nested AGENTS.md / CLAUDE.md — to the minimum words that…
Interview the user relentlessly about a plan or design. Use when the user wants to stress-test a plan before building, or uses…
Run the full agent-team pipeline end-to-end for one feature whose Tasks Plan is already approved by /squid-plan, handing the…
Implement one task — or a whole list / an approved Tasks Plan — via the inner SWE↔Tester loop, committing each task on PASS. Use…