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 skills add XRenSiu/claude-code-forge --skill invariant-extractgit clone --depth 1 https://github.com/XRenSiu/claude-code-forgeWrote 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.
[](https://agentmods.dev/skills/xrensiu/claude-code-forge/invariant-extract)<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/invariant-extract"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/invariant-extract/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.
<a href="https://agentmods.dev/skills/xrensiu/claude-code-forge/invariant-extract"><img src="https://agentmods.dev/badge/skills/xrensiu/claude-code-forge/invariant-extract.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00264 | $0.05097 |
| Opus 5.5 | $0.00106 | $0.02039 |
| Sonnet 5.5 | $0.00053 | $0.01019 |
| Haiku 4.5 | $0.00026 | $0.00510 |
Grade A, and why
invariant-extract 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.
How it starts
The opening of the file, as written. The whole thing — 263 lines — stays where its author put it; the contents beside it link to each section on GitHub.
invariant-extract
Recover a Territory's □ resident invariants — the rules every Run under it must
hold, distinct from a single Run's done_when (◊). This skill describes the world
those invariants live in, the criteria that tell a real one from a fake, the primitives
that make extraction mechanical where it can be, and the gates a candidate must clear
before it lands. It does not prescribe a step order — the engine sequences the work;
what follows are the gaps to fill and the gates that must hold, in any order.
术语映射(在 AI-DLC 里怎么读这份文件)
本 skill 引自 qanat 仓库,正文保留其领域词汇;在 AI-DLC 里按下表读。Territory 与 Run 两行是承重的:
按字面读 dos.yaml 的 Run(一次 issue → PR 的交付)会把"这个插件自己被改"的那些失败全部投影为 ∅,
溯因通道当场掏空。
| 原文 | AI-DLC 里的对应物 |
|---|---|
| Territory(领地) | 一块有单一责任的区域:一个 dos.yaml 的 bounded_contexts.current_context,或一个插件 / 一个环 / 一个 skill 族。"插件即领地"是合法读法——它有 name、有 kpi、有 scope |
| Territory.name / kpi | 该区域的一句话责任 + 它的直接度量。插件领地:README 的一句话定位 + 它守的东西(每步产物可检或被人签的门挡住) |
| Run(一次执行) | 该领地的任一次被调用,不只是交付。对插件领地有两类:① 交付 Run = .aidlc/<slug>/ 一个 slug;② dogfood Run = 用这套 skill 改这套 skill 自己的一次。□ 要活得过两类,这是 --cross-territory 之外最容易漏的宽度 |
| 失败记忆 failure.memory | 见下面「接线」的清单:ledger.md 的 fail / deviation 行、escape-defects.md、G3 记录、dogfood 的 skill-issues.md。不含 gate.json 的 fix_list(那是登记的缺口,见下) |
| obstacle_ref | 上面任一条的稳定 id:ledger:fail#3、trace 事件 id(ev-0005)、skill-issues.md 的 I-nn、逃逸缺陷编号 |
| R001 / R002 / R00x | dos.yaml rules 段的 id(AI-DLC:R001 单生产者、R002 单契约 schema …)。qanat 原文里 R001=评估者隔离、R002=闸门资产只能人签,在本插件里不要这样读——那两条在 AI-DLC 是「信息隔离」与「G2/G3 人签」,不是编号 |
| 立法收件箱 / 立法者签字 | assets/change_proposal.md 变更提案 → G2(lock_done_when.py sign);账本 ledger.md 记 propose |
| MemoryAsset | 归档目录 specs/<slug>/ 里的测试集 / rubric;failure_memory 见上 |
| daemon / 运行时 | 本地测试与 CI;/ai-dlc 的 acceptance 阶段 |
The gap (why the engine can't just read them off the code)
A composite of three atoms: Judgment (what counts as a real □), Control (the propose-and-sign gate, role separation), Capability (the mechanical scan + the exit verifier). The Knowledge it needs (KAOS, Model Spec) it routes to, below.
What ships with it
20 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/cross_territory_promotion_template.md 1.7 KB
- assets/decisions_template.md 2.9 KB
- assets/dos_amendment_template.md 3.3 KB
- assets/invariant_card.yaml 8.4 KB
- eval/fixtures/card_altitude_promoted.yaml 2.3 KB
- eval/fixtures/card_bad_noprov.yaml 2.2 KB
- eval/fixtures/card_bare_count.yaml 2.1 KB
- eval/fixtures/card_diamond_leak.yaml 2.2 KB
- eval/fixtures/card_gap_no_dest.yaml 2.2 KB
- eval/fixtures/card_good.yaml 2.1 KB
- eval/fixtures/card_low_conf_carded.yaml 2.2 KB
- eval/fixtures/card_near_dup.yaml 2.2 KB
- eval/fixtures/card_no_aspect.yaml 2.2 KB
- eval/fixtures/card_self_dup.yaml 2.2 KB
- eval/gate.json 3.5 KB
- eval/report.md 2.1 KB
- references/abduction.md 5.4 KB
- references/anti_patterns.md 3.6 KB
- references/survival-test.md 6.8 KB
- scripts/verify_card.py 16 KB runs code
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.
- 1mo ago Changed · +15 lines 56682728a778
- 1mo ago Changed · +3 lines 14e248decb08
- 1mo ago Changed · +52 lines 1eaf74e0777e
- 2mo ago First seen · 193 lines · 264 tokens per session scan A 8294016cd087
invariant-extract is a skill published in the GitHub repository XRenSiu/claude-code-forge (2 stars, last pushed 1mo ago), licensed MIT. It adds 264 tokens to every session and 5,097 once invoked, about $0.0011 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-31.
Other skills, from other repositories
systematic-debugging
Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.
log-error-digest
Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…
cwv-optimizer
Diagnose and fix Core Web Vitals issues on AEM Edge Delivery Services pages. Goes deeper than generic CWV advice by understanding EDS-specific performance patterns including the 100KB LCP budget, E-L-D loading phases, block rendering behavior, and third-party script impact. Produces specific fixes for LCP, CLS, and…
incident-response-incident-response
Coordinate production incident triage, mitigation, investigation, recovery, and follow-up. Use when responding to outages or other incidents that require structured operational coordination.
ci-fixer
CI failures - read error, minimal fix, verify.
diagnosing-missing-recordings
Diagnoses why a session recording is missing or was not captured. Use when a user asks why a session has no replay, why recordings aren't appearing, or wants to troubleshoot session replay capture issues for a specific session ID or across their project. Covers SDK diagnostic signals, project settings, sampling…