From dev
Scan a codebase and produce a structured project overview report. Extracts packages, classes, methods, standalone functions, imports, line counts, inheritance, and code smells. Works with Python, JavaScript, and TypeScript projects. Use when the user asks to "scan this project", "give me an overview", "what's in this codebase", "map the code structure", "analyze this repo", or any request to understand a project's structure before refactoring, onboarding, or code review.
How this skill is triggered — by the user, by Claude, or both
Slash command
/dev:code-scannerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Produces a structured markdown report of a codebase's architecture — packages, classes, methods, functions, imports, and code smells.
Produces a structured markdown report of a codebase's architecture — packages, classes, methods, functions, imports, and code smells.
/dev:code-scanner
/dev:code-scanner scan ./src
/dev:code-scanner scan this project with imports
Use Glob to check for project markers:
**/*.py + __init__.py files → Python projectpackage.json or **/*.ts / **/*.tsx / **/*.js / **/*.jsx → Node.js/TypeScript projectRead package.json, pyproject.toml, or setup.py if present for project metadata.
Use Glob to find all source files. Exclude:
node_modules/, venv/, .venv/, env/, __pycache__/, dist/, build/, .git/Count total files by extension.
Read each source file and extract:
For Python files:
__init__.py presence)async prefix)For JS/TS files:
import and CommonJS require)function keyword)For both:
Scan the collected data for:
main, run, process, initialize, start, parse_arguments)../ levels)Read config files for path aliases:
vite.config.ts — look for resolve.alias entriestsconfig.json — look for compilerOptions.pathsvitest.config.ts — same as viteThen identify imports that use relative paths (../../) which could use aliases instead. Suggest:
Write the report to a markdown file in the project root (default: project_structure_report.md).
Use this exact structure:
# Project Structure Report
- **Scan performed:** {timestamp}
- **Target location:** `{path}`
- **Project type:** {Python | Node.js/TypeScript | Mixed}
---
## Config Files
{If JS/TS: include contents of vite.config.ts, vitest.config.ts if they exist}
---
## Guidelines
{Include the appropriate guidelines section below based on project type}
---
## Packages
- {package path}
- {package path}
---
## Potential Code Duplication
{Only if duplicates found}
- `{function_name}` found in {N} files: {file1}, {file2}
---
## Classes, Files and Functions by Folder
### {folder_path}
#### **{filename}** _{line_count} lines{" (large file)" if >200}_
**{ClassName}** ({BaseClass1, BaseClass2}) - {method_count} methods {" (large class)" if >=10}
- `{method_name} ({line_count} lines)`
- `async {method_name} ({line_count} lines)`
**Standalone Functions**
- `{function_name} ({line_count} lines)`
**Imports** {if enabled}
- `import x from 'y'`
- `from module import name`
---
## Project Summary
- **Total Files**: {N}
- **Total Classes**: {N}
- **Total Methods**: {N}
- **Total Standalone Functions**: {N}
- **Total Lines of Code**: {N}
- **Packages**: {N}
- **Files > 200 Lines**: {N}
- **Classes with >= 10 Methods**: {N}
- **Common Functions Duplicated Across Files**: {N}
- **Average Lines per File**: {N}
- **Average Methods per Class**: {N}
This report documents the structure of a Python project — packages, classes, files, and functions. It supports refactoring, code review, architecture review, and onboarding.
What a reviewer should consider:
- Whether files could be combined or split
- Classes with too many methods (SRP violation)
- Files or folders that could become modules or sub-packages
- Duplicate or similar function names across files
- Helper functions that should be moved to utilities
- Functions that should be grouped into cohesive classes
- Opportunities to replace inheritance with composition
This report documents the structure of a Node.js/TypeScript project — modules, classes, files, functions, and imports. It supports refactoring, code review, architecture review, onboarding, and import optimization.
What a reviewer should consider:
- Whether the project follows Node.js best practices
- Classes with too many methods (SRP violation)
- Files that could be split into smaller, focused modules
- Duplicate or similar function names across files
- Separation between routes, controllers, models, and services
- Import patterns — use path aliases instead of deep relative paths
- Consolidate multiple imports from the same source
- Tightly coupled modules visible in the import graph
If import alias analysis is requested, write a second file suggested_import_changes.md:
# Suggested Import Changes
## Path Aliases Available
- `@alias` -> `path`
## Suggested Import Changes by File
### {relative_file_path}
#### Individual Import Changes
Line {N}:
```typescript
// Original:
import { X } from '../../components/common'
// Suggested:
import { X } from '@common'
// Original separate imports:
import { Header } from '@common'
import { Footer } from '@common'
// Consolidated import:
import { Header, Footer } from '@common'
{If commonly traversed paths don't have aliases yet}
---
## Performance Notes
- For large projects (100+ files), use the Agent tool with subagents to scan folders in parallel
- Read files in batches — don't try to read every file sequentially
- Skip binary files, images, and generated code
- For the summary stats, count as you go rather than re-scanning
npx claudepluginhub mercurial-weasel/bh-ops-claude-plugins --plugin devProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.