skills/scan-js-codebase/SKILL.md
Scans a Node.js project (JavaScript or TypeScript) to build a compact knowledge graph of file dependencies and exported symbols, storing it in the project's agent folder (.claude, .github, or .cursor) for use by GitHub Copilot, Claude Code, or any AI agent.
npx skillsauth add ngmthaq/my-copilot scan-js-codebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Builds and queries a compact knowledge graph for Node.js projects (JS or TS).
Scripts live inside this skill folder — never copy them to the project.
Run them directly with their full path. Output is stored in the project's
agent folder (.claude/, .github/, or .cursor/).
Use this skill whenever the user mentions: scanning a codebase, building a dependency graph, understanding file relationships, finding where a symbol is defined, impact analysis ("what breaks if I change X"), onboarding to a new project, or setting up context for GitHub Copilot or Claude Code or any AI agent. Trigger even if the user phrases it casually ("map out my project", "show me what imports what", "help my AI understand my code").
When this skill is loaded, its scripts are at:
SKILL_DIR/scripts/build-graph.js
SKILL_DIR/scripts/query-graph.js
SKILL_DIR is the directory containing this SKILL.md file. Claude must
resolve it at runtime from the actual path of this file and substitute it
into every command below before running or presenting them to the user.
# Prefer a local project install
npm install --save-dev madge
# Or global
npm install -g madge
Run build-graph.js from the project root
(so madge finds node_modules/.bin/madge and relative paths resolve correctly):
# TypeScript project → store in .github/
node SKILL_DIR/scripts/build-graph.js \
--src ./src \
--tsconfig tsconfig.json \
--out .github/knowledge-graph.json
# JavaScript project → store in .github/
node SKILL_DIR/scripts/build-graph.js \
--src ./src \
--out .github/knowledge-graph.json
# Custom output path
node SKILL_DIR/scripts/build-graph.js \
--src ./src \
--tsconfig tsconfig.app.json \
--out .claude/knowledge-graph.json
| Flag | Default | Description |
| -------------- | --------------- | ------------------------------------------- |
| --src | src | Source directory to scan |
| --tsconfig | (none) | Path to tsconfig — required for TS projects |
| --extensions | ts,tsx,js,jsx | File extensions to include |
| --out | (none) | Explicit output path |
The output directory is created automatically if it does not exist.
{
"meta": { "generatedAt": "...", "totalFiles": 142, "totalEdges": 389 },
"files": { "0": "src/main.tsx", "1": "src/App.tsx" },
"nodes": [{ "id": 1, "exports": ["App", "default"] }],
"edges": [{ "from": 1, "to": 5 }],
"importedBy": { "5": [1, 3, 9] },
}
Run query-graph.js from anywhere — point --graph at the file written in Step 2:
# Context for a specific file
node SKILL_DIR/scripts/query-graph.js \
--graph .github/knowledge-graph.json \
--file src/App.tsx
# 2 hops out
node SKILL_DIR/scripts/query-graph.js \
--graph .github/knowledge-graph.json \
--file src/App.tsx --depth 2
# Find which file defines a symbol
node SKILL_DIR/scripts/query-graph.js \
--graph .claude/knowledge-graph.json \
--symbol useAuth
# Print summary
node SKILL_DIR/scripts/query-graph.js \
--graph .claude/knowledge-graph.json
| Flag | Default | Description |
| ---------- | ---------------------- | -------------------------------- |
| --graph | knowledge-graph.json | Path to the knowledge graph file |
| --file | (none) | Query by file path |
| --symbol | (none) | Query by exported symbol name |
| --depth | 1 | Hops to include in subgraph |
Paste the query output directly into chat before your request:
Here is the dependency context for src/App.tsx:
[paste output of query-graph.js command above]
Refactor App.tsx to lazy-load the Dashboard component.
Add to .claude/settings.json so Claude Code fetches context automatically:
{
"tools": [
{
"name": "get_file_context",
"command": "node SKILL_DIR/scripts/query-graph.js --graph .claude/knowledge-graph.json --file {file}",
"description": "Returns imports, dependents, and exports for a source file"
}
]
}
Replace SKILL_DIR with the actual absolute path to the skill folder.
Run node SKILL_DIR/scripts/build-graph.js --src src --tsconfig tsconfig.json --out AGENT_FOLDER/knowledge-graph.json
whenever files change significantly.
Replace SKILL_DIR with the actual absolute path to the skill folder.
Replace AGENT_FOLDER with the actual agent folder in the project (.claude, .github, or .cursor).
documentation
Guidelines and protocols for Technical Leaders to manage and oversee technical projects effectively while adhering to the core mandate of being the central orchestration layer for all engineering work.
data-ai
Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server, Oracle). Provides execution plan analysis, pagination optimization, batch operations, and performance monitoring guidance.
development
SOLID — Enforces the SOLID principle of object-oriented design (Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion) for maintainable and scalable code.
development
Separation of Concerns (SoC) — Enforces the Separation of Concerns principle by ensuring each module, layer, and component addresses exactly one well-defined concern. Use when writing, reviewing, or refactoring code that mixes UI with business logic, business logic with data access, presentation with formatting, or cross-cutting concerns (auth, logging, validation) with core logic.