Before you refactor an interface or estimate a sprint in unfamiliar code, this answers the questions static analysis tools don't: who actually depends on this module, what's the real blast radius if I change it, which files are the high-coupling chokepoints. It parses your repo into ast_nodes.json, then lets you query with five modes: file skeleton, reverse dependencies (who imports X), impact radius (upstream + downstream counts), hub analysis (most-depended-on modules), and directory-level summary. The who-imports and impact queries are the money shots when you're about to rename something or touch a core abstraction. Requires Python 3.10+ and produces hard numbers, not guesses. Works standalone or shares the .nexus-map structure with nexus-mapper if you need the full knowledge base later.

skills.sh installs
298
GitHub stars
167
last updated
Aug 21, 2026

Install

$ npx -y skills add haaaiawd/nexus-skills --skill nexus-query --agent claude-code

Installs into .claude/skills of the current project.

Files

nexus-query — 代码结构精准查询

何时调用

场景调用
「这个文件有哪些类/方法,依赖什么」是
「改这个接口/模块,哪些文件受影响」是
「这个改动的影响半径是多大」是
「项目里谁是真正的核心依赖节点」是
「整个项目大概分哪几块」是
用户希望生成完整的 .nexus-map/ 知识库否 → 改用 nexus-mapper
运行环境无 shell 执行能力否
宿主机无本地 Python 3.10+否

前提:确保 ast_nodes.json 可用

进入查询前 → 检查是否有 ast_nodes.json
├── 有(.nexus-map/raw/ast_nodes.json 或用户指定路径)→ 直接查询
└── 没有 → 运行 extract_ast.py 生成 → 再查询

生成 AST 时,支持与 nexus-mapper 一致的扫描过滤:

  • --exclude-dirs django_static,.go_root 按目录名或仓库相对路径忽略杂物目录
  • --use-gitignore 启用 <repo_path>/.gitignore 规则(默认开启),忽略其中声明的文件和目录
  • --no-gitignore 不应用 .gitignore 规则;此时仍会保留内置排除项和 --exclude-dirs
# 默认路径(和 nexus-mapper 的 .nexus-map/ 兼容,可互通)
AST_JSON="$repo_path/.nexus-map/raw/ast_nodes.json"
GIT_JSON="$repo_path/.nexus-map/raw/git_stats.json"    # 可选

# 若 ast_nodes.json 不存在,先创建目录再生成(约数秒)
mkdir -p "$repo_path/.nexus-map/raw"
python $SKILL_DIR/scripts/extract_ast.py $repo_path > $AST_JSON

# 若仓库包含大批静态资源、生成物或杂物目录,可显式追加排除项
python $SKILL_DIR/scripts/extract_ast.py $repo_path \
  --exclude-dirs django_static,.go_root,third_party/assets \
  > $AST_JSON

Sponsors

Details

Repository
github.com/haaaiawd/nexus-skills
Categories
Code Review & Quality, Productivity & Planning, Python, CLI & Terminal
First seen
Jun 3, 2026

More from haaaiawd/nexus-skills

All 2
1woocommerce avatarwoocommerce-dev-cyclewoocommerce/woocommerceRun tests, linting, and quality checks for WooCommerce development. Use when running tests, fixing code style, or following the development workflow.298skills.sh installs
2juststeveking avatarlaravel-apijuststeveking/laravel-api-skillBuild production-grade Laravel REST APIs using opinionated architecture patterns with Laravel best practices. Use when building, scaffoling, or reviewing Larave292skills.sh installs
3xirothedev avatarnestjs-best-practicesxirothedev/agent-skillsNestJS best practices and patterns for building scalable, maintainable backend applications. This skill should be used when writing, reviewing, or refactoring N291skills.sh installs
4davila7 avatarcommit-workdavila7/claude-code-templatesCreate high-quality git commits: review/stage intended changes, split into logical commits, and write clear commit messages (including Conventional Commits). Us290skills.sh installs
5evoscientist avatarnano-bananaevoscientist/evoskillsGenerate professional presentation slides and high-quality illustrations using Gemini image generation API (Nano Banana 2), with interactive browser-based revie288skills.sh installs
6patricio0312rev avatarprompt-template-builderpatricio0312rev/skillsCreates reusable prompt templates with strict output contracts, style rules, few-shot examples, and do/don't guidelines. Provides system/user prompt files, vari287skills.sh installs