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.
npx agentmods add skills/google/mantis/mantis-structural-indexnpx skills add google/mantis --skill mantis-structural-indexgit clone --depth 1 https://github.com/google/mantisWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00055 | $0.08881 |
| Opus 5 | $0.00028 | $0.04441 |
| Sonnet 5 | $0.00011 | $0.01776 |
| Haiku 4.5 | $0.00006 | $0.00888 |
Grade A, and why
mantis-structural-index 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 2d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 747 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Structural Code Index Builder
This is an optional first-class stage in the Pass Lifecycle Contract. It
runs immediately after the snapshot is pinned (Block D), before the first
code-reading analysis stage (summarize/architecture). It only needs CODE_ROOT
+ SNAPSHOT_ID and must not depend on architecture/KB.
System Goal
Structural Code Index Builder. Builds a content-addressed semantic-unit index
from source code using capability-based per-partition backend selection,
degrading gracefully to grep. Provides find_callers(symbol),
get_function_boundary(file, line), and call-site awareness to improve LLM
reasoning quality during discovery — supplementing (never replacing) grep-based
call-site discovery with structural data. The index is composed from independent
semantic compilation units, persisted as a manifest + SQLite catalog, and
exposed through a bounded query helper.
Command Definition
- Command:
/mantis-structural-index - Description: Build a content-addressed semantic-unit index from source
code under
CODE_ROOT. - Arguments (optional; supplied by the orchestrator, consumed by Block A):
--snapshot_root/--snapshot_id/--state_root. All absent → MODE-OFF/legacy mode (reads source from the current directory, writes index to./workspace/kb/structural_index/).
Input/Output Contract
- Reads:
workspace/.mantis_state.json(to readactive_snapshotfor provenance checking and snapshot-aware rebuild logic).workspace/kb/structural_index/manifest.json(to checksnapshot_idfor reuse-on-match idempotency — primary check).workspace/kb/structural_index.jsonl(backward-compat provenance check if manifest absent).workspace/kb/structural_index/units/(content-addressed cache for incremental unit reuse).workspace/kb/structural_index/native/and sidecarprovenance.jsonfiles (prebuilt index attachments and metadata manifests).- CODE_ROOT source files (via generated helper script — the script parses all
source files under
CODE_ROOT).
- Writes:
workspace/kb/structural_index/manifest.json(STATE-RELATIVE — atomic commit point, written LAST).workspace/kb/structural_index/catalog.sqlite(STATE-RELATIVE — query-optimized serving store).workspace/kb/structural_index/units/(STATE-RELATIVE — content-addressed immutable unit outputs).workspace/kb/structural_index/shards/(STATE-RELATIVE — partitioned serving data for large corpora).workspace/kb/structural_index/native/(STATE-RELATIVE — prebuilt index attachments: SCIP, Kythe, LSIF).workspace/kb/structural_index/tmp/(STATE-RELATIVE — temporary objects during build).workspace/kb/structural_index.jsonl(STATE-RELATIVE — compatibility pointer; full export below threshold).workspace/helpers/build_structural_index.py(STATE-RELATIVE — the builder helper script).workspace/helpers/query_structural_index.py(STATE-RELATIVE — the query helper script).
- Preconditions:
- Source files must exist under
CODE_ROOT. IfCODE_ROOTis not resolved (MODE-OFF and no readableactive_snapshot), build against the current directory withsnapshot_idset to"unknown". Do NOT skip — this is the standalone-efficiency case.
- Source files must exist under
- Inert until wired: This skill returns an empty index until a caller
invokes it (the harness,
mantis-plan, ormantis-researcher). It never fails — it simply returns an empty index if tools are unavailable or source cannot be parsed. - Idempotency Guarantee:
- Read-only on
CODE_ROOT. Writes only to STATE-RELATIVE paths. Re-running with the sameCODE_ROOTandSNAPSHOT_IDreuses the existing index (manifestsnapshot_idmatch) rather than rebuilding — except in MODE-OFF, where it always rebuilds. Individual semantic units are reused across snapshots when their content-addressed cache keys match (incremental rebuild).
- Read-only on
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.
- 2d ago First seen · 747 lines · 55 tokens per session scan A 5a65e5589084
mantis-structural-index is a skill published in the GitHub repository google/mantis (853 stars, last pushed 5d ago), licensed Apache-2.0. It adds 55 tokens to every session and 8,881 once invoked, about $0.0003 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.
Other skills, from other repositories
conductor-setup
Scaffolds the project and sets up the Conductor environment. Use this whenever a project needs to be initialized or if the Conductor configuration is missing.
conductor-new-track
Plans a new track (feature or bug fix), generates spec/plan documents, and updates the registry.
conductor-review
Reviews the completed track work against guidelines and the plan. Acts as a Principal Software Engineer to ensure quality and compliance.
conductor-implement
Executes the tasks defined in the specified track's plan. Use this to start or continue working on a feature, bug fix, or chore.
conductor-revert
Reverts previous work (tracks, phases, or tasks) by identifying associated commits and performing Git reverts.
conductor-status
Displays the current progress of the project by parsing the Tracks Registry and individual track plans.