| Where value X declared / read / written | refs X <dir> --decls / --reads / --writes |
| Who consumes type T (field/param/return/generics) | uses T <dir> |
Full change-impact for type T (incl. .field access) | blast T <dir> |
| List all top-level type decls across a scope (cross-file) | symbols <scope> [--kind ClassDecl/…] |
| Which files import a module (cross-file) | importers <module> <scope> |
| Declaration site(s) of ONE named type + ambiguity check | declares <type> <scope> (matches simple name or qualified path; >1 row = ambiguous, 0 = not declared) |
| Run analysis checks + report violations (grouped-by-file) | lint <scope> [--rule <id>]… [--fix] [--all] [--flat] [--fail-on <sev>] [--format text|json|checkstyle] (analysis/check layer; lint --list-rules prints every check as id+description — THE authoritative list. Inline suppression: trailing // noqa[: rules] or CHECKSTYLE:OFF/ON region. --fix has a HUGE blast radius — scope to a file and/or --rule; looping --fix to a fixpoint without a typecheck between passes compounds cascade deletions. Full semantics: BEFORE relying on lint verdicts or configuring apqlint.json → Read references/lint.md) |
| Every occurrence of name X (incl. case-patterns) | mentions X <dir> |
| Who does function F call (direct/transitive) | callees 'Type.method' <scope> [--depth N] [--kinds call,ref,new,virtual,contains] (approximate call graph: name + declared-type resolution, Null<T> unwrapped, virtual edges to overrides, Ref edges for lambdas/method-values/.bind with the receiving call as via; out-of-scope targets [external]; unresolved sites counted to stderr; builds graph over the whole scope — ~25s on TM-sized 800 files) |
| Who calls function F (direct/transitive) | callers 'Type.method' <scope> [--depth N] (same graph, in-edges) |
| Is B reachable from A + through which chain | reach --from 'A.m' --to 'B.n' <scope> [--to …] [--max-paths N] (--to repeatable, Type.* patterns; BFS shortest path per pair; default kinds call,ref,new,virtual) |
| Along which lines does a god-type split (decomposition recon) | clusters <TypeName> <scope> [--hubs N] — connected components over aggregated intra-type call edges after top-fan-in hubs go to a utils bucket (--hubs 0 = off, default auto — conservative: cap 10% of members; crank --hubs manually to dissolve a persistent blob); lambdas/local fns condense into their member; per-component -> hubs/<- hubs traffic = the future module interface; <- hubs ≠ 0 flags a dispatcher wrongly bucketed as a utility. ⚠️ SCOPE = the type's own package dir, NOT whole src/ — the graph builds over every file in scope; whole-project scope is ~25× slower (minutes of CPU, kills a subagent's stream watchdog) and only adds unresolved-call noise |
| Main-thread stall candidates (blocking call on main / lock held across blocking call) | lint <scope> --rule thread-safety — config-driven via apqlint.json (sinks required, spawns/marshals/lockPairs optional; inert without config — projects using this rule keep apqlint.json in the repo root) |
ONLY switch case-patterns case Foo: / case Foo(_): | cases Foo <dir> |
Decls carrying @:meta | meta @:meta <dir> |
| Match expression / statement shape with metavars | search 'pattern with $x' <dir> |
| Find string-literal / annotation key | lit '<text>' <dir> |
| Find text in comments / TODO / doc-comment | lit '<text>' <dir> --include-comments or --kind Comment |
| Subtree at line:col / by selector | ast file.hx --at L:C / --select Kind:name |
Filter --select by arity | --min-children N / --max-children N |
| Cap rendered child count per level | --depth N --children-limit M |
| Sweep snapshot read + Δ vs prior | sweep [--prev <path>] |
| Save sweep baseline | sweep --save <path> |
| Pre/post-slice diff (auto-rotated prev) | sweep --diff |
| Parse utest stdout into counts | test-summary [<file> | -] |
| Inline-source AST/writer probe (no /tmp) | probe '<code>' [ast-options] / probe - (stdin) |
| Parse + format-write (trivia / plain) | ast file.hx --writer-output / --writer-output-plain |
| Side-by-side trivia + plain writer | writer-probe file.hx / probe '<code>' --writer-probe |
| Byte-equality check on writer output | writer-equals <input> <expected.txt> (--plain opt) |
| Writer-bug AST diff (input ↔ output) | ast file.hx --writer-output --diff |
| Structural AST diff between files | diff a.hx b.hx (--flat, --limit N) |
| Sed-strip + parse-check | strip file.hx --replace <p> --with <r> / --delete <p> |
| Typo guard for strip patterns | strip … --dry-run |
| Skip-parse drill — corpus sweep + histogram | recon [<dir>] (default $ANYPARSE_HXFORMAT_FORK/test/testcases) |
| Single-file PARSE OK/FAIL probe | recon --probe <file> |
| Post-PARSE-OK byte-compare (after parser-additive slice) | recon --probe <file> --writer-equals |
| Cluster drill (paths in ONE bucket) | recon --cluster '<key>' (--source for windowed src) |
| Upper-bound predict: would strip unblock? | recon --predict-strip --replace <p> --with <r> (combine with --cluster) |
| Gate-relaxation predict (insert expected token) | recon --predict-relax |
| NO TARGET bucket drill | recon --predict-relax --no-target-cluster '<expected-msg>' |
| Find every fixture matching a regex | recon --candidates '<regex>' |
| Apply strip across a cluster | strip --from-cluster '<key>' --replace <p> --with <r> |
| Multi-pattern isolation diagnostic | strip <file> --replace … --replace … --per-pattern |
Which predicate gates a ctor's ; elision | gates [<dir>] |
| Gate-mechanism candidate lists | gates --mechanism mandatory-ref-lead-trail (and other mechanisms) |
Which .hx files plugin can't parse | self-status [<dir>] (--strict exits non-zero on any skip-parse) |
| Sanity-check direct-child count at root | ast file.hx --count / probe '<code>' --count |
| View RAW verbatim file lines (no parse; any/skip-parse file; Edit-anchorable) | source <file> [--range L:L2] |
| Read ONE node's raw source BY NAME / position (clean text, dedented, no S-expr) | source <file> --select 'FnMember:<name>' (or ClassDecl:<Name> etc.; must match one) / source <file> --at <l>:<c> |
Decls carrying @:tag(arg) (exact arg, NOT substring) | meta '@:tag(arg)' <dir> |