Narrowpy — Development skill for Claude Code
Deep modules, narrow interfaces: a structural linter and agent gate for Python.
How to install Narrowpy
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open Prime-agentai/narrowpy and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Narrowpy does
Deep modules, narrow interfaces: a structural linter and agent gate for Python. Finds module cycles (including the ones agents hide in function-local imports), field leaks, tangles and shallow modules; blocks Claude Code from stopping when it made the structure worse. Ratchet, SARIF, MCP. Zero deps.
Alternatives in Development
- Claude API — Build apps with the Claude API or Anthropic SDK 94.1k ★
- Fix Imports — Fix Broken Imports 2.8k ★
- Superpowers To Watchtower — Use when a superpowers plan (writing-plans / brainstorming output saved locally) is ready and you want durable 130 ★
README
narrowpy
Your coding agent fixed the circular import by moving it into a function. narrowpy notices.
A structural linter for Python, built on one idea (deep modules, narrow interfaces), and a gate that
won't let Claude Code stop while its changes made the structure worse.
This is from a real Claude Code session ([full transcript notes](docs/live-claude-code.md)). The agent was asked to add `Order.checkout()`, which needs `shop/emails.py`, and `emails.py` already imports `orders.py`. It said *"a top-level import would be circular. I'll import inside the method"*, then tried to stop:
narrowpy: your changes since 33e88c95c126 made the structure worse (1 new, 0 worse). Fix these before you stop:
error[module-cycle] [new]: 2 modules in `shop` import each other in a circle: `shop.emails`, `shop.orders`
--> shop/emails.py:3
= cheapest tie to cut: `shop.emails` → `shop.orders` (1 import: shop/emails.py:3)
= at import time there is no circle: only the hidden imports close it
= 1 of 2 imports in this circle are hidden (function-local or TYPE_CHECKING): shop/orders.py:28
shop.emails ──imports──▶ shop.orders (1×, first shop/emails.py:3)
shop.orders ──imports──▶ shop.emails (1×, first shop/orders.py:28) [function-local]
Related Skills
Death Crystal
Architectural deepening lens — surface shallow Modules and propose interface alternatives using Pocock vocabul
Arch Check
Run built-in architecture-conformance policies — cycles, cross-package imports, layer violations
Jobs Priority Watch
Priority-function watch. Narrow, fast ATS-direct scan of the profile's priority companies for the function the
Ettle
Your agent and your teammates' agents, comparing notes before the meeting would have happened. ettle reconcile
Bg Blur
A cinematic shallow depth of field, blur the background only
Hide
Hide this session from agent discovery (still DM-able if id is known)
Related Agents
Complexity Reviewer
Reviews a diff for complexity pushed onto callers, information leakage, change amplification, cognitive load,
Board Architect Roots
Spec Board specialist — structural-pattern-purity at LD-lock time. Mirror of code-architect-roots (post-implem
Kit Agent Linter
Read-only lint of kg-devkit's agent definitions (and their Codex output) for project-specific leaks, least-pri