/pyscn-mcp:architecture-reviewfrom pyscn-mcp
Analyze Python module architecture using pyscn: class coupling (CBO), cohesion (LCOM), dependency cycles, and module community detection. Helpful for understanding module structure and planning refactors.
Ships in pyscn-mcp. 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.
Run the pyscn CLI to understand module structure and coupling. No install needed: uvx pyscn@latest <command>.
| User Request | Command |
|---|---|
| "Check class coupling" | uvx pyscn@latest analyze --select cbo <path> |
| "Find circular dependencies" | uvx pyscn@latest analyze --select deps <path> |
| "Check class cohesion" | uvx pyscn@latest analyze --select lcom <path> |
| "Which files should I review together?" | uvx pyscn@latest analyze --select communities --json <path> |
| "Map the module architecture" | uvx pyscn@latest analyze --select communities --json <path> |
Useful flags: --min-cbo <n> (minimum CBO to report), --json (detailed report file). Report files are NOT written to stdout; they go to .pyscn/reports/ and the path is printed on completion.
Module community detection is opt-in: run with --select communities --json and read the report file.
The JSON report includes community_analysis.community_context_map, a compact, deterministic map telling you which modules to inspect together:
bundles[]: clusters of modules that change together. Each has modules, packages, risk_level, the cluster's bridge_modules, an optional suggested_review_scope (path prefix to focus a review on), and a one-line summary. Large bundles cap the module list with a ... +N more marker (module_count always holds the true total).bridge_modules[]: modules that couple two or more communities (module, the communities it connects, and a reason). Widen the review scope to include these when touching a bundle they connect.Use the map to scope reviews and refactors: load all modules in a bundle together, and pull in connected bridge modules before changing cluster boundaries.
Always tie findings back to concrete modules and suggest a specific structural change.
If the pyscn-mcp MCP server is connected, you can use its tools instead of the CLI: check_coupling for CBO metrics, or analyze_code with analyses: ["deps"], ["lcom"], or ["communities"] (communities require output_mode: "full"; the full response includes the same community_context_map). Results are returned inline with no report files.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
4 skills in this plugin
/cli-analysisRun the pyscn command-line tool for Python code quality analysis - CI/CD quality gates, HTML/JSON/CSV reports, full analysis runs, and project configuration. Use when user wants a CI check, a shareable report file, or to configure pyscn for a project./health-checkGet an overall Python code quality health score using pyscn. Use when user asks how healthy or good the code is, wants a quality overview, a grade, a summary of technical debt, or a before/after quality comparison./refactoringFind refactoring targets in Python code using pyscn - duplicate code (clones), overly complex functions, and dead code. Use when user asks about refactoring, code duplication, complexity hotspots, unreachable code, or cleaning up a codebase.npx claudepluginhub ludo-technologies/pyscn --plugin pyscn-mcpOther plugins' skills for the same job