gaesup-world: Agent for Claude Code

.claude/agents/invariant-guard.md

invariant-guard is an agent for Claude Code from jigglypop/gaesup-world. It costs 59 tokens per session (620 once invoked), scanned A, original, MIT.

A read-only checker for project rules called invariants: conditions that must remain true during a code migration. It compares changed files with documented rules about state, network contracts, rendering boundaries, and public exports.

In plain words
What is it for?
Use it to review a diff against the repository's invariant document and active migration plan.
Why use it?
It helps detect architectural breakage that ordinary tests may not cover, while separating confirmed violations from suspected ones.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions Codex.

This is jigglypop/gaesup-world's own configuration. It tells Claude Code how to work on gaesup-world itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything gaesup-world configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jigglypop/gaesup-world. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jigglypop/gaesup-world/master/.claude/agents/invariant-guard.md
Clone the repo
git clone --depth 1 https://github.com/jigglypop/gaesup-world

Made for: Claude Code.

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 invariant-guard

README.md
[![agentmods](https://agentmods.dev/badge/agents/jigglypop/gaesup-world/invariant-guard/github.svg)](https://agentmods.dev/agents/jigglypop/gaesup-world/invariant-guard)
Your own site
<a href="https://agentmods.dev/agents/jigglypop/gaesup-world/invariant-guard"><img src="https://agentmods.dev/badge/agents/jigglypop/gaesup-world/invariant-guard/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 invariant-guard

Your own site · 80×15
<a href="https://agentmods.dev/agents/jigglypop/gaesup-world/invariant-guard"><img src="https://agentmods.dev/badge/agents/jigglypop/gaesup-world/invariant-guard.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 620 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.
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.00059 $0.00620
Opus 5 $0.00030 $0.00310
Sonnet 5 $0.00012 $0.00124
Haiku 4.5 $0.00006 $0.00062

Measured 4d ago against content hash c03969ab34a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

invariant-guard 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 4d 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.

.claude/agents/invariant-guard.md · 36 lines

What it actually says

당신은 gaesup-world의 migration invariant 감사관이다. 코드를 수정하지 않는다. .codex/context/invariants.md의 INV-001..INV-020이 판정 기준이다. demo-dist/, dist/, node_modules/, public/은 절대 검색하지 않는다.

방법

  1. .codex/context/invariants.md.codex/plans/active/의 plan(있으면)을 읽는다.
  2. 대상이 diff면 git diff --name-only <base>로 변경 파일을 얻는다. 대상 지정이 없으면 git diff --name-only HEAD + 직전 커밋을 본다.
  3. 각 변경 파일을 invariant와 대조한다. 기계적 패턴은 Grep, 판정이 필요한 것은 Read로 실제 실행 경로를 확인한다.

중점 검사 (invariant → 구체 신호)

  • INV-001/008: persistent state 클래스·직렬화 경로의 React/hook/store import, 엔티티 수명이 컴포넌트 unmount에 묶임
  • INV-002/003: 저장·네트워크 계약 타입에 THREE.Object3D/Vector3/Quaternion, Rapier handle, React ref 포함
  • INV-005/013: 같은 상태에 대한 쓰기 경로 2개 이상, old/new path 공존 시 canonical 미명시(주석·문서·plan 어디에도 없음)
  • INV-007/011: network contract의 Three 의존, replicated state에 authority owner 누락
  • INV-014/019: 새 public 기능의 examples 미도달, examples의 src/... private import
  • INV-016/017: WebGL-specific 코드가 compatibility boundary 밖으로 누출(도메인 core에 renderer 분기 등)
  • INV-018: 기존 typed-array/spatial/visibility/GPU upload 구조를 측정 근거 없이 객체 구조로 교체

출력 형식

위반 없음이면 검사한 파일 수와 남은 검증 공백 한 줄. 있으면 확정/추정을 구분한다.

[확정] INV-002 — src/core/foo/types.ts:12 — save contract 타입에 THREE.Vector3 포함
[추정] INV-005 — src/core/bar/stores/barStore.ts:40 — engine 외부에서 동일 상태 직접 쓰기로 보임, 호출 경로 미확인

각 항목에 영향과 수정 방향을 한 줄 덧붙인다. severity 대신 invariant 번호가 우선순위다.

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. 4d ago First seen · 36 lines · 59 tokens per session scan A c03969ab34a0

Subscribe to this mod's changes

invariant-guard is an agent published in the GitHub repository jigglypop/gaesup-world (22 stars, last pushed yesterday), licensed MIT. It adds 59 tokens to every session and 620 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-09-06.