mantis-structural-index

mantis-structural-index is a skill for Claude Code, Codex from google/mantis. It costs 55 tokens per session (8,881 once invoked), scanned A, original, Apache-2.0.

A source-code index that maps meaningful code units and their relationships, such as which functions call another function. It stores this information so an agent can look up code structure while studying a pinned or live codebase.

In plain words
What is it for?
Use it before architecture summaries or other discovery work on a repository. It helps locate callers of a symbol, identify where a function starts and ends, and understand call sites.
Why use it?
It reduces the need to rediscover callers and function boundaries by searching through files repeatedly. This gives code research better structural context without replacing normal text search.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is --state_root if passed, else ./workspace/... relative to the current dir).

Good fit Use it before architecture summaries or other discovery work on a repository. It helps locate callers of a symbol, identify where a function starts and ends, and understand call sites.

Compare 6 skills from other repositories ↓
About the project

google/mantis is a modular set of security-review skills that coding agents use to find, reproduce, and patch software vulnerabilities. It is for adapting automated security testing to application, infrastructure, machine-learning, hardware, and firmware projects, with expert review required for results. The catalogue skills and instruction provide the workflow for using Mantis with coding agents.

google/mantis · 2,525 stars · on GitHub · cloud.google.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/google/mantis
agentmods
npx agentmods add skills/google/mantis/mantis-structural-index

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 mantis-structural-index

README.md
[![agentmods](https://agentmods.dev/badge/skills/google/mantis/mantis-structural-index/github.svg)](https://agentmods.dev/skills/google/mantis/mantis-structural-index)
Your own site
<a href="https://agentmods.dev/skills/google/mantis/mantis-structural-index"><img src="https://agentmods.dev/badge/skills/google/mantis/mantis-structural-index/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 mantis-structural-index

Your own site · 80×15
<a href="https://agentmods.dev/skills/google/mantis/mantis-structural-index"><img src="https://agentmods.dev/badge/skills/google/mantis/mantis-structural-index.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,881 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. Third-party audits
  • Socket pass 25 Jul 2026
  • Snyk pass 25 Jul 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00055 $0.08881
Opus 5.5 $0.00022 $0.03552
Sonnet 5.5 $0.00011 $0.01776
Haiku 4.5 $0.00006 $0.00888

Measured 1mo ago against content hash 5a65e5589084, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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 1mo 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.

skills/mantis-structural-index/SKILL.md · 747 lines

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 read active_snapshot for provenance checking and snapshot-aware rebuild logic).
    • workspace/kb/structural_index/manifest.json (to check snapshot_id for 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 sidecar provenance.json files (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. If CODE_ROOT is not resolved (MODE-OFF and no readable active_snapshot), build against the current directory with snapshot_id set to "unknown". Do NOT skip — this is the standalone-efficiency case.
  • Inert until wired: This skill returns an empty index until a caller invokes it (the harness, mantis-plan, or mantis-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 same CODE_ROOT and SNAPSHOT_ID reuses the existing index (manifest snapshot_id match) 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 the full file on GitHub · 747 lines

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. 1mo ago First seen · 747 lines · 55 tokens per session scan A 5a65e5589084

Subscribe to this mod's changes

mantis-structural-index is a skill published in the GitHub repository google/mantis (2,525 stars, last pushed today), licensed Apache-2.0. It adds 55 tokens to every session and 8,881 once invoked, about $0.0002 per session on Opus 5.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

ai-engineering-toolkit

Overview of six AI engineering workflows: prompt evaluation (8-dimension scoring), context budget planning, RAG pipeline design, agent security audit (65-point checklist), eval harness building, and product sense coaching.

sickn33/agentic-awesome-skills · 47 tokens

ai-agent-evaluation-benchmarking

Autonomous AI agent benchmark evaluation register: task completion rates, planning accuracy, tool invocation precision, and cost benchmarks.

sickn33/agentic-awesome-skills · 31 tokens

ai-agent-tool-routing

Use when designing or reviewing an AI agent tool registry or MCP router: document parameter schemas, caller authorization, execution limits, replay-safe retries and verification evidence.

sickn33/agentic-awesome-skills · 36 tokens

jobs

Manage agy staffer background jobs - collect results, check status, cancel, follow-up conversation, and setup. Use when an agy job needs collecting, when the user asks "is the agy job done", "show agy's result", "cancel the agy job", "continue the agy conversation", or "set up agy". This is the orchestrator's skill…

keli-wen/agy-staff · 99 tokens

agy-lead

Orchestrate an ongoing task with AGY while the current agent owns key decisions, review, and delivery. Use when the user invokes /agy-lead or asks you to coordinate a task using AGY.

keli-wen/agy-staff · 46 tokens

researcher

Delegate a deep research or survey task to Google's Antigravity CLI (agy staffer, fast Gemini). Use when the user says /agy:researcher, "ask agy to research", "have the agy staffer survey X", or wants a second, independent deep-dive on a topic or codebase without spending the host model's quota.

keli-wen/agy-staff · 75 tokens