agentleFS
redhat-etredhat-et/ripwire/skills/ripwire-graph-query/SKILL.md

ripwire-graph-query

Skill2.4k starsChanged 3 months agoApache-2.0View on GitHub

A call-graph question the fixed verbs can't phrase — 'which high-complexity functions can reach X?', 'what has 10+ callers in src/?', 'untested symbols within one hop of main'. --graph-query: a small closed expression language — kind, complexity, fan-in, tested filters; a file or cluster; bounded hops; and/or/not.

Trending

More talk lately.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 12 mentionsOct 2026: 2 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the redhat-et/ripwire repository that our weekly crawl found: only 14 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about redhat-et/ripwire

The biggest 5 of 14 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 14

Talked about on GitHub, Bluesky and Hacker News (14 times).

On GitHub · 9

4 more on GitHub

On Hacker News · 2

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run the first to size the cluster, the second to size the risk — a small high-cx cluster with a huge callers() closure is a refactor that …

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Graph queries with ripwire

One-hop questions have cheaper verbs — ripwire-navigate (--callers, --callees, --uses, --path, --impact). Reach for --graph-query only when you need to COMBINE conditions. Repo-wide architecture health (not one query) → ripwire-layers.

Planning a refactor: find the cluster AND its blast radius

The refactor-planning question is always two conditions at once — "what's messy" AND "what would touching it affect" — which is exactly what a single fixed verb can't phrase:

# the refactor short-list: high-complexity functions in the target area
ripwire <dir> --graph-query='and(cx(all,15),file(all,"src/"))' --legend=compact

# now the blast radius: everyone who transitively calls into that cluster (≤3 hops)
ripwire <dir> --graph-query='callers(and(cx(all,15),file(all,"src/")),3)' --legend=compact

(Verified on this repo's shape, not its exact numbers — count= drifts every commit: the first query returns the high-cx symbols under src/, each <s t= n= p=> (kind/name/path); the second returns the transitive caller set, typically smaller than the cluster itself because many hits are leaf-ish or call each other. Read the header's own count=/shown= on your run, don't trust a number pasted here. Narrow file(...) to your actual target directory before trusting the numbers.)

Run the first to size the cluster, the second to size the risk — a small high-cx cluster with a huge callers() closure is a refactor that needs a compatibility shim or a staged rollout, not a rewrite in place; a small cluster with a small closure is safe to just rewrite.

ripwire <dir> --graph-query='EXPR' --legend=compact evaluates a small functional expression to a deterministic, ranked node set (capped at --top-k, default 200). It is a fixed, closed operator set — not Datalog: no user rules, no unbounded recursion.

The operators

KindFormMeaning
sourcename("X")symbols named X (unions same-name defs)
sourceallevery INDEXED symbol
filterkind(EXPR, K)keep kind K: fn method cls struct iface var sec
filtercx(EXPR, N)keep cyclomatic complexity ≥ N
filterfanin(EXPR, N)keep in-degree (caller count) ≥ N
filterfile(EXPR, "RE")keep symbols whose file path matches the ECMAScript regex RE
closurecallers(EXPR [, D=1])nodes that transitively (≤ D hops) CALL anything in EXPR
closurecallees(EXPR [, D=1])nodes transitively (≤ D hops) CALLED BY anything in EXPR
joinand(A, B) / or(A, B)intersection / union
joinnot(A, B)difference (A minus B)

Verified examples (single-quote the whole expression for the shell)

# the functions that transitively (≤2 hops) call buildGraph
ripwire <dir> --graph-query='and(callers(name("buildGraph"),2),kind(all,fn))' --legend=compact

# high-complexity symbols in src/  (the refactor short-list)
ripwire <dir> --graph-query='and(cx(all,15),file(all,"src/"))' --legend=compact

# heavily-depended-on symbols (10+ callers) — the de-facto API surface
ripwire <dir> --graph-query='fanin(all,10)' --legend=compact

# everything main can reach within 2 hops
ripwire <dir> --graph-query='callees(name("main"),2)' --legend=compact

# functions NOT reachable from main's callers  (difference)
ripwire <dir> --graph-query='not(kind(all,fn),callers(name("main")))' --legend=compact

# a two-symbol watchlist
ripwire <dir> --graph-query='or(name("buildGraph"),name("rankGraph"))' --legend=compact

Calibration

  • Results come back importance-ranked and capped at top-k — count= vs shown= in the header tells you if the cap bit; narrow the query or raise --top-k.
  • Closures walk the same name-based edges as --callers — dynamic dispatch / callbacks / macros can be missing, and amb edges were guessed. Verify in source when which-target matters.
  • A malformed expression (unknown operator, bad file() regex) reports the parse error and yields nothing — it never half-answers.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.