titan-gate

A validation step for staged code changes before they are committed. It checks the project's structure, lint rules, build, and tests, then reports whether the changes pass, need attention, or fail.

In plain words
What is it for?
Use it to validate files prepared for commit, check dependency and architecture rules, run linting, builds, and tests, and decide whether a commit should proceed.
Why use it?
It catches broken or risky changes before they become part of the project and can undo changes when validation fails.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/optave/ops-codegraph-tool/titan-gate
Any agent
npx skills add optave/ops-codegraph-tool --skill titan-gate
Clone the repo
git clone --depth 1 https://github.com/optave/ops-codegraph-tool

Made for: Claude Code, Codex.

Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,202 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00037 $0.05202
Opus 5 $0.00018 $0.02601
Sonnet 5 $0.00007 $0.01040
Haiku 4.5 $0.00004 $0.00520

Measured 2d ago against content hash 40d9f2865043, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

titan-gate scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$TITAN_ARCH_DIR"
.claude/skills/titan-gate/SKILL.md · 449 lines

How it starts

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

Titan GATE — Change Validation & State Machine

You are running the GATE phase (State Machine) of the Titan Paradigm.

Your goal: validate staged changes against codegraph quality checks AND the project's own lint/build/test. Produce a clear PASS/WARN/FAIL verdict. Auto-rollback on failure.

Context budget: Lightweight — only checks staged changes. Should complete quickly.

Force mode: If $ARGUMENTS contains --force, warnings are downgraded (failures still block).


Step 0 — Pre-flight

  1. Worktree check:

    git rev-parse --show-toplevel && git worktree list
    

    If not in a worktree, stop: "Run /worktree first."

  2. Staged changes?

    git diff --cached --name-only
    

    If nothing staged, stop: "Nothing staged. Use git add first."

  3. Load state (optional). Read .codegraph/titan/titan-state.json if it exists — use for thresholds, baseline comparison, and sync alignment. If missing or corrupt, proceed with defaults.


Step 1 — Structural validation (codegraph)

Run the full change validation predicates in one call:

codegraph check --staged --cycles --blast-radius 30 --boundaries -T --json

This checks: manifesto rules, new cycle introduction, blast radius threshold, and architecture boundary violations. Exit code 0 = pass, 1 = fail.

The blast-radius predicate is call-graph-shape-aware: a touched function's absolute transitive-caller count only counts toward the threshold if the diff actually changed that function's own declaration line or the set of call targets referenced in its body. A function whose body changed without touching a call expression or its own signature (e.g. an inline literal replaced by a named constant) is exempt even with a high absolute caller count — that fan-in is pre-existing risk already accepted by the codebase, not risk this diff introduced. This is the authoritative blast-radius pass/fail — see Step 8.

Also run detailed impact analysis:

codegraph diff-impact --staged -T --json

Read the full file on GitHub · 449 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. 2d ago First seen · 449 lines · 37 tokens per session scan C 40d9f2865043

Subscribe to this mod's changes

titan-gate is a skill published in the GitHub repository optave/ops-codegraph-tool (92 stars, last pushed today), licensed Apache-2.0. It adds 37 tokens to every session and 5,202 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

codespaces

Build and query architecture-aware code search, dependency graphs, call flows, impact analysis, and belief maps for Python, TypeScript, TSX, Rust, C#, Java, Go, Ruby, and Ruby on Rails repositories. Use before non-trivial code changes to find module boundaries, blast radius, architecture violations, and the minimal…

diskd-ai/codespaces · 74 tokens

security-triage

Turn a large codebase into a short, ranked reading list of security-relevant code paths worth a human researcher's time, using the flyto-indexer MCP tools. Use when asked to find, prioritize, or triage potential vulnerabilities / taint flows / attack surface in a repository indexed (or indexable) by flyto-indexer …

flytohub/flyto-indexer · 105 tokens

devlens

Understand a codebase with the DevLens MCP — TypeScript, JavaScript, Python, Go, Rust, or Java (incl. React/Next.js/Node, FastAPI/Flask/Django, Spring Boot, Gin/Echo/chi/net-http, axum/actix/rocket). Query a precomputed graph of nodes (components, hooks, functions, classes, methods, structs, traits, routes) and typed…

devlensio/devlensOSS · 0 tokens

archon

Multi-language dependency impact analysis for Java, JS/TS, and Python codebases. Answers "if I change this, what breaks?" Run /archon diff before refactoring, /archon analyze for full dependency maps.

Schr0d/Archon · 48 tokens

codebase-intelligence

Query the codebase-intelligence CLI to understand TypeScript architecture, dependencies, blast radius, and risk before reading files. Use for any "how is this structured", "what breaks if I change X", "where is the complexity" question.

bntvllnt/codebase-intelligence · 54 tokens

repomix

Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.

yamadashy/repomix · 58 tokens