nexus-query

nexus-query is a skill for Claude Code, Codex from Haaaiawd/ANWS. It costs 119 tokens per session (1,483 once invoked), scanned A, original, MIT.

A code-structure query tool that maps files, classes, methods, imports, dependencies, and likely change impacts. It uses a generated abstract syntax tree (a structured representation of code) as its input.

In plain words
What is it for?
Use it to inspect a file’s structure, find what depends on an interface or module, estimate a change’s impact radius, identify central dependency points, and divide a project into broad areas.
Why use it?
It helps answer dependency questions before a refactor, so you can see which files may be affected instead of guessing. It also highlights highly connected parts of an older codebase.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to inspect a file’s structure, find what depends on an interface or module, estimate a change’s impact radius, identify central dependency points, and divide a project into broad areas.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/haaaiawd/anws/nexus-query
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Haaaiawd/ANWS --skill nexus-query
Clone the repo
git clone --depth 1 https://github.com/Haaaiawd/ANWS

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nexus-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/haaaiawd/anws/nexus-query/github.svg)](https://agentmods.dev/skills/haaaiawd/anws/nexus-query)
Your own site
<a href="https://agentmods.dev/skills/haaaiawd/anws/nexus-query"><img src="https://agentmods.dev/badge/skills/haaaiawd/anws/nexus-query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nexus-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/haaaiawd/anws/nexus-query"><img src="https://agentmods.dev/badge/skills/haaaiawd/anws/nexus-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 119 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,483 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00119 $0.01483
Opus 5 $0.00060 $0.00741
Sonnet 5 $0.00024 $0.00297
Haiku 4.5 $0.00012 $0.00148

Measured 9d ago against content hash 9ab35d70df65, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

nexus-query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/extract_ast.py, scripts/git_detective.py, scripts/query_graph.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/anws/templates/.agents/skills/nexus-query/SKILL.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 生成 → 再查询
# 默认路径(和 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

# 若需要 git 风险数据(可选,仅在存在 .git 时)
python $SKILL_DIR/scripts/git_detective.py $repo_path --days 90 > $GIT_JSON

$SKILL_DIR 为本 Skill 的安装路径(通常是 .agents/skills/nexus-query,投影到目标 IDE 时以该目标的 skills 目录为准)。

依赖安装(首次使用)

pip install -r $SKILL_DIR/scripts/requirements.txt

五个查询模式

# 文件骨架:类、方法、行号、import 清单
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --file <path>
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --file <path> --git-stats $GIT_JSON

# 反向依赖:谁 import 了这个模块(区分源码文件和测试文件)
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --who-imports <module_or_path>

# 影响半径:上游依赖 + 下游被依赖(X upstream, Y downstream)
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --impact <path>
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --impact <path> --git-stats $GIT_JSON

# 全仓库核心节点:按扇入(被引用最多)和扇出(引用最多)排序
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --hub-analysis [--top N]

# 按顶层目录聚合结构摘要
python $SKILL_DIR/scripts/query_graph.py $AST_JSON --summary

各模式核心价值

模式 一句话价值 典型触发时机
--file 不读源码也能掌握文件骨架,精确到行号 接手大型模块前;Bug 调查缩小读取区间
--who-imports 改接口前的"炸弹清单"——列出所有调用方 删函数/改签名/重命名类之前,必须跑
--impact 0 upstream, 24 downstream 一眼看清改动范围 Sprint 估时;评估修改是局部手术还是全局手术
--hub-analysis 找出真正的高耦合核心,不靠目录名猜 架构评审;技术债优先级排序
--summary 5 秒建立全局分层认知,比 README 更客观 初次接触项目;识别循环依赖风险区域

Read the full file on GitHub · 115 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 115 lines · 119 tokens per session scan A 9ab35d70df65

Subscribe to this mod's changes

nexus-query is a skill published in the GitHub repository Haaaiawd/ANWS (142 stars, last pushed 3mo ago), licensed MIT. It adds 119 tokens to every session and 1,483 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

reviewer

Get a second-opinion review from Google's Antigravity CLI (agy staffer, fast Gemini) - of code (a diff, PR, working tree) or of a decision, plan, or design. Use when the user says /agy:reviewer, "have agy review this", "second opinion on my diff/PR/plan", or after finishing work and wanting an independent verifier…

keli-wen/agy-staff · 94 tokens

owasp-reviewer-prompt

A paranoid OWASP-Top-10-aware system prompt for AI code review that traces data flow, treats every input as malicious, maps each finding to an OWASP category, and outputs a structured Summary / Findings / Severity / Score block reviewers can act on.

aozyildirim/Agena · 59 tokens

tribunal

Runs a doer -> verifier-panel -> consensus loop to verify a deliverable before it ships. An orchestrator freezes acceptance criteria before implementation, dispatches a doer, then convenes a context-walled panel of independent verifiers - including an adversary with an explicit must-oppose mandate - for…

a-tokyo/agent-skills · 207 tokens

agy-reviewer

Get a second-opinion review from Google's Antigravity CLI (agy staffer, fast Gemini) - of code (a diff, PR, working tree) or of a decision, plan, or design. Use when the user says /skill:agy-reviewer, "have agy review this", "second opinion on my diff/PR/plan", or after finishing work and wanting an independent…

keli-wen/agy-staff · 96 tokens

tldr-review

Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /tldr-review. Auto-triggers when reviewing pull requests.

0p9b/TLDR · 70 tokens

speckit.analyze

Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.

compnew2006/Spec-Kit-Antigravity-Skills · 32 tokens