Agent skill

Immune

by Mathews-Tom in Mathews-Tom/armory

Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning.

MITAuto-check passedDevelopment

Install Immune

skills CLI
$ npx skills add Mathews-Tom/armory --skill immune -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Mathews-Tom/armory immune --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Mathews-Tom/armory.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/immune .claude/skills/immune && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
immune
GitHub stars
328
Token cost
~3.2k tokens
SKILL.md length
1,240 words
Files
7 (incl. scripts)
Skills in repo
80
Repo updated
First seen
Licence
MIT

At a glance

Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning.

  • Works in 5 steps: Cheatsheet Injection (positive patterns) → Load & Classify Antibodies (Hot/Cold) → Scan → …
  • : scan for errors
  • SKILL.md covers Input Parsing, Task-Conditioned Retrieval…, Execution and Error Handling
  • Runs Python scripts from its folder

What it does

Immune is an agent skill from Mathews-Tom/armory. Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning. Triggers on: "scan for errors", "immune scan", "check output quality", "antibody scan". NOT for PR review (use pr-review) or repo audits (use repo-sentinel).

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including scripts (for example `agents/immune-scan.md`, `cheatsheet_memory.json` and `config.yaml`).

It sits in Development, covering Pull requests. The repository describes itself as: Curated, production-grade skills for AI coding agents. Battle-tested workflows for developers who use AI seriously. The licence is MIT.

When your agent uses it

  • : scan for errors
  • Check output quality

Example prompts

  • “scan for errors”
  • “immune scan”
  • “check output quality”
  • “/immune”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Cheatsheet Injection (positive patterns)
  2. Load & Classify Antibodies (Hot/Cold)
  3. Scan
  4. Update Immune Memory (with COLD deduplication)
  5. Output

What it can do on your machine

Read from SKILL.md and the folder at commit 4594fb7. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Immune loads about 3.2k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 1,240 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from Mathews-Tom/armory at commit 4594fb7, republished under its MIT licence (© Mathews-Tom). 1,240 words, ~3,196 tokens.

Download SKILL.mdSave it as .claude/skills/immune/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.
name
immune
description
Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning. Triggers on: "scan for errors", "immune scan", "check output quality", "antibody scan". NOT for PR review (use pr-review) or repo audits (use repo-sentinel).
metadata.version
1.0.1
metadata.status
active
metadata.classification
tooling-wrapper
metadata.source
https://github.com/contactjccoaching-wq/immune
metadata.category
review
metadata.tags
memory, error-detection, antibodies, adaptive
metadata.difficulty
intermediate

Immune System v3 — Hybrid Cheatsheet + Immune

You operate a hybrid adaptive system with two complementary memories:

  • Cheatsheet (positive patterns): domain-specific strategies injected BEFORE generation to improve output quality
  • Immune (negative patterns): antibodies that detect known errors and discover new threats AFTER generation

Both memories use Hot/Cold tiering to keep context lean.

Input Parsing

The user invokes with content to scan. Parse these parameters:

  • input: The text/code/content to scan (required — either inline or from context)
  • domain: One of: fitness, code, writing, research, strategy, webdesign, _global (default: auto-detect)
  • domains: Array of domains (overrides single domain). Example: domains=fitness,code
  • constraints: Any specific requirements the output should satisfy (optional)
  • mode: full (cheatsheet + scan, default) | scan-only (skip cheatsheet) | cheatsheet-only (return cheatsheet, no scan)
<examples>
<example>
/immune Check this function for common pitfalls
→ domains=["code"] (auto-detected), mode=full
</example>
<example>
/immune domain=fitness Vérifie ce programme de musculation
→ domains=["fitness"] (explicit)
</example>
<example>
/immune domains=fitness,code Check this workout generator API
→ domains=["fitness", "code"] (multi-domain)
</example>
<example>
/immune
→ scans the most recent output in the conversation
</example>
</examples>

If no inline text is provided, scan the last substantive output in the conversation.

Domain auto-detection: Read config.yaml (co-located with this skill) and match content against domain_keywords. If no strong match, use ["_global"]. If single domain string provided, wrap in array: domains = [domain].

Task-Conditioned Retrieval (v3.1.0+)

Antibodies and cheatsheet strategies may carry an optional triggers field for per-task filtering. This implements the read phase of the Memento-Skills reflective loop (arXiv 2603.18743) — entries are ranked by lexical overlap between the current task and their historical contexts.

Schema (additive, optional):

json
{
  "id": "AB-042",
  "domains": ["code"],
  "pattern": "SQL injection via string concatenation",
  "severity": "critical",
  "correction": "Use parameterized queries",
  "triggers": {
    "task_signatures": ["code query review sql", "audit code sql"],
    "domains": ["code"]
  }
}

Back-compat: entries without triggers behave as always-on (the v3.0.0 behavior). The task_conditioned_retrieval: true flag in config.yaml enables the filter. When disabled, all entries load regardless of task.

Ranking helper: scripts/retrieve.py implements the scoring logic. Callers (including the scanner agent, the skill-librarian in P2, and the skill-router in P3) invoke retrieve(prompt, entries, active_domains, historical_success) to obtain the ranked subset before tier classification. Scoring uses Jaccard similarity over normalized task signatures from scripts/task_signature.py, multiplied by an optional per-entry success rate derived from evals/history.jsonl.

During load (Phase 0 cheatsheet, Phase 1 antibodies), after the domain filter and before Hot/Cold tier classification, apply the retrieve step:

  1. Compute task_signature(prompt) for the current task.
  2. Pass entries through retrieve(...) with the active domains set.
  3. Feed only the returned subset into the tier classification below.

Entries filtered out at retrieval never reach Hot/Cold — this is what keeps the scan context lean and task-focused.

Execution

Step 0 — Cheatsheet Injection (positive patterns)

Skip this step if mode == "scan-only".

0a. Load cheatsheet: Read cheatsheet_memory.json (co-located with this skill).

0b. Filter by domains: Keep strategies where ANY of the strategy's domains overlaps with the detected domains, OR strategy has "_global" in its domains.

0c. Classify into tiers (same logic as antibodies): A strategy is HOT if ANY of:

  • effectiveness >= 0.7
  • seen_count >= 3
  • last_seen less than 30 days ago

Everything else is COLD.

0d. Cap HOT strategies: Sort by effectiveness descending, then seen_count descending. Keep max 15 (from config.yaml → cheatsheet.max_hot).

0e. Build cheatsheet block: Format HOT strategies as XML:

xml
<cheatsheet domain="{domains}">
  <strategy id="{id}" effectiveness="{effectiveness}">
    {pattern}
    Example: {example}
  </strategy>
  ...
</cheatsheet>

If there are COLD strategies, add a one-liner:

xml
<cheatsheet_cold>Also consider: {comma-separated COLD pattern keywords}</cheatsheet_cold>

If mode == "cheatsheet-only", output the cheatsheet block and stop here.

Log:

[IMMUNE] Cheatsheet: {n_hot} HOT + {n_cold} COLD strategies (domains: {domains})

0f. Present cheatsheet to user: If running standalone (/immune), show the cheatsheet as context the user should apply to their next generation. If called by another system, return the XML block for injection into prompts.

Step 1 — Load & Classify Antibodies (Hot/Cold)

Read immune_memory.json and config.yaml (co-located with this skill).

1a. Filter by domains: Keep antibodies where ANY of the antibody's domains overlaps with detected domains, OR antibody has "_global" in its domains.

Backwards compatibility: If an antibody has "domain" (string) instead of "domains" (array), treat it as domains = [domain].

1b. Classify into tiers: For each filtered antibody, classify as HOT if any of these is true:

  • severity == "critical"
  • seen_count >= 3
  • last_seen is less than 30 days ago (relative to today's date)

Everything else is COLD.

1c. Cap HOT antibodies: Sort HOT by: severity (critical > warning > info), then seen_count descending. Keep max 15 (from config.yaml → tiers.hot.max_per_scan). If more than 15 qualify as HOT, overflow goes to COLD.

1d. Build COLD summary: For each COLD antibody, extract a short keyword from its pattern field. Join as comma-separated list. Example: "SQL transactions, épicondylite, debug flags, tautologies"

Log:

[IMMUNE] Tier split: {n_hot} HOT + {n_cold} COLD / {total} total (domains: {domains})
Step 2 — Scan

Spawn the immune-scan agent (Haiku) with the following XML-structured prompt:

xml
<scan_request>
  <domains>{detected_domains as JSON array}</domains>
  <task>{task description or "Scan the following content for errors and threats"}</task>
  <constraints>{constraints or "none"}</constraints>

  <content>
{the input text/code/content to scan}
  </content>

  <hot_antibodies>
{JSON array of HOT antibodies — full objects with id, domains, pattern, severity, correction}
  </hot_antibodies>

  <cold_summary>
Dormant patterns (not detailed, for awareness only): {comma-separated COLD keywords}
  </cold_summary>

  <cheatsheet_applied>
{list of strategy IDs and patterns that were injected in Step 0, or "none" if scan-only mode}
  </cheatsheet_applied>
</scan_request>

Log: [IMMUNE] Scanning... ({n_hot} active antibodies) Wait for result.

If corrections applied: Log: [IMMUNE] Match {antibody_id}: {original} → {corrected} If new threats detected: Log: [IMMUNE] New threat: {pattern} If new strategies detected: Log: [IMMUNE] New strategy: {pattern}

Show full SKILL.md (486 more words)Show less
Step 3 — Update Immune Memory (with COLD deduplication)

Read current immune_memory.json.

3a. Matched HOT antibodies: For each antibody matched by the scanner, increment seen_count and update last_seen to today.

3b. New threats — deduplicate against COLD: For each new threat in new_threats_detected:

  1. Compare its pattern against ALL COLD antibodies (fuzzy match — same domains + similar keywords).
  2. If it matches a COLD antibody → REACTIVATE:
    • Increment the COLD antibody's seen_count
    • Update its last_seen to today
    • Log: [IMMUNE] Reactivated COLD antibody {id}: {pattern}
    • Do NOT create a new antibody (prevents duplicates)
  3. If no COLD match AND auto_add_threats is true → CREATE new antibody:
    • id: "AB-{next_number}"
    • domains: from the threat's recommended_antibody.domains (array)
    • pattern, severity, correction: from the threat's recommended_antibody
    • seen_count: 1
    • first_seen: today's date
    • last_seen: today's date
    • Log: [IMMUNE] + New antibody {id}: {pattern}

3c. Update stats:

  • Increment stats.outputs_checked
  • Increment stats.issues_caught by number of corrections + new threats
  • Update stats.antibodies_total to current antibody count

Write back to immune_memory.json.

Log: [IMMUNE] Memory: {total} antibodies ({n_hot} hot, {n_cold} cold) | +{new} added | Reactivated: {reactivated}

Step 3b — Update Cheatsheet Memory (positive patterns)

Skip if mode == "scan-only" or no new_strategies_detected in scan result.

Read current cheatsheet_memory.json.

3b-i. Deduplicate: For each new strategy in new_strategies_detected:

  1. Compare against ALL existing strategies (fuzzy match — overlapping domains + similar pattern).
  2. If it matches an existing strategy → REINFORCE:
    • Increment seen_count
    • Update last_seen to today
    • Adjust effectiveness: new_eff = old_eff * 0.8 + reported_eff * 0.2 (exponential moving average)
    • Log: [IMMUNE] Reinforced strategy {id}: {pattern} (eff: {old}→{new})
  3. If no match AND auto_add_strategies is true → CREATE new strategy:
    • id: "{prefix}-{next_number}" (prefix from config.yaml → cheatsheet.id_prefix.{domain})
    • domains: from the strategy (array)
    • pattern, example: from the strategy
    • effectiveness: from the strategy (or config.yaml → cheatsheet.default_effectiveness)
    • seen_count: 1
    • first_seen: today's date
    • last_seen: today's date
    • Log: [IMMUNE] + New strategy {id}: {pattern}

3b-ii. Prune low-effectiveness: If any strategy has effectiveness < config.cheatsheet.min_effectiveness AND seen_count >= 5:

  • Remove it
  • Log: [IMMUNE] - Pruned strategy {id}: {pattern} (eff: {eff})

3b-iii. Update stats:

  • Increment stats.outputs_assisted
  • Increment stats.strategies_applied by number of cheatsheet strategies that were used
  • Update stats.strategies_total to current count

Write back to cheatsheet_memory.json.

Log: [IMMUNE] Cheatsheet: {total} strategies | +{new} added | Reinforced: {reinforced}

Step 4 — Output

If clean:

───
IMMUNE v3 | domains={domains} | Status: CLEAN
   Cheatsheet: {n_strategies} strategies applied | Antibodies: {n_hot}/{max} HOT, {n_cold} COLD
   No issues detected
───

If corrections or threats found:

───
IMMUNE v3 | domains={domains} | Status: {CORRECTED|FLAGGED}

Corrections Applied:
  [AB-XXX] {pattern} → {correction}

New Threats Detected:
  [{severity}] {pattern} — {suggested_correction}

Reactivated:
  [AB-XXX] {pattern} (was COLD, now HOT)

New Strategies Learned:
  [CS-XXX] {pattern} (eff: {effectiveness})

───
Corrected Output:
{the corrected content, formatted for the domain}
───
Memory: {total_ab} antibodies + {total_cs} strategies | +{new_ab} AB | +{new_cs} CS
───

Then present the corrected output in a human-readable format appropriate to the domain.

Error Handling

  • If immune_memory.json does not exist: create it with {"version": 3, "antibodies": [], "stats": {"outputs_checked": 0, "issues_caught": 0, "antibodies_total": 0}}
  • If cheatsheet_memory.json does not exist: create it with {"version": 3, "strategies": [], "stats": {"outputs_assisted": 0, "strategies_applied": 0, "strategies_total": 0}}
  • If immune_memory.json has "version": 2: auto-migrate by converting each antibody's "domain" to "domains": ["domain_value"] and set version to 3. Write back immediately.
  • If the agent returns invalid JSON: retry once. If still invalid, report the raw output with a warning.
  • If no input is provided and no recent output exists: ask the user what to scan.
  • If all antibodies are COLD (none qualify as HOT): still send the scan with empty hot_antibodies array and full cold_summary. Haiku can still detect new threats via Phase 2.

© Mathews-Tom, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 6 other files (scripts) in skills/immune of Mathews-Tom/armory.

  • SKILL.md
  • agents/immune-scan.md
  • cheatsheet_memory.json
  • config.yaml
  • evals/cases.yaml
  • immune_memory.json
  • scripts/retrieve.py

Open the folder on GitHubat commit 4594fb7

Compare with similar skills

Immune next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Immune compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Immune this skillMathews-Tom/armory328—~3.2kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Check PRonyx-dot-app/onyx32k2 repos~2.3kAutomated safety check: PassMIT
PR Design DocOpenHands/OpenHands90k—~2.4kAutomated safety check: PassMIT
WooCommerce Code Reviewwoocommerce/woocommerce11k3 repos~1.1kAutomated safety check: PassCustom licence

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Check PR

    onyx-dot-app/onyx

    Checks a GitHub, GitLab, or Perforce (p4) pull request (or merge request, or shelved changelist) for unresolved review comments, failing status checks, and incomplete PR descriptions.

    32k GitHub starsUsed in 2 repos~2.3k tokens
    DevelopmentAuto-check passed
  • PR Design Doc

    OpenHands/OpenHands

    For a non-trivial pull request, write a self-contained HTML design doc under the temporary .pr/ directory and link a visibility-appropriate preview in the PR description, so maintainers grasp the…

    90k GitHub stars~2.4k tokensUpdated today
    DevelopmentAuto-check passed
  • WooCommerce Code Review

    woocommerce/woocommerce

    Reviews WooCommerce code changes against the project's standards, flagging backend PHP architecture, naming, documentation, data integrity and testing violations.

    11k GitHub starsUsed in 3 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Record PR Demo

    payloadcms/payload

    A skill your agent uses when a Payload pull request needs a concise visual walkthrough for reviewers.

    45k GitHub stars~1k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from Mathews-Tom/armory

All 80 skills in this repo
  • Architecture Reviewer

    Mathews-Tom/armory

    Architecture reviews across 7 dimensions (structural, scalability, enterprise readiness, performance, security, ops, data) with scored reports.

    328 GitHub stars~4.6k tokensUpdated 3 days ago
    Auto-check passed
  • Concept To Image

    Mathews-Tom/armory

    Turn concepts into static HTML visuals exported as PNG or SVG files via HTML/CSS/SVG.

    328 GitHub stars~2.6k tokensUpdated 3 days ago
    Auto-check passed
  • Watch

    Mathews-Tom/armory

    A skill your agent uses when analyzing an existing video URL or local recording: "watch this video", "analyze youtube video", "summarize this video", "youtube transcript", "find this moment", "what…

    328 GitHub stars~2.8k tokensUpdated 3 days ago
    Auto-check passed
  • Code Refiner

    Mathews-Tom/armory

    Deep code simplification and refactoring preserving behavior across Python, Go, TypeScript, Rust.

    328 GitHub stars~3.1k tokensUpdated 3 days ago
    Auto-check passed
  • Concept To Video

    Mathews-Tom/armory

    Turn concepts into animated explainer videos using Manim (Python) with MP4/GIF output, audio overlay, multi-scene composition.

    328 GitHub stars~4.9k tokensUpdated 3 days ago
    Auto-check passed
  • Decision Map

    Mathews-Tom/armory

    Maps the unresolved architecture, policy, and scope decisions that must be answered before planning can start: one durable decision ticket per question on the issue tracker, typed and blocker-linked…

    328 GitHub stars~2.7k tokensUpdated 3 days ago
    Auto-check passed

Categories

Questions about Immune

What does Immune do?

Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning. Immune is an agent skill from Mathews-Tom/armory. Hybrid adaptive memory: Cheatsheet (positive patterns pre-generation) and Immune (negative patterns post-generation) with Hot/Cold tiered auto-learning.

When should I use Immune?

Immune fits situations like: : scan for errors; check output quality.

How do I install Immune in Claude Code?

Run `npx skills add Mathews-Tom/armory --skill immune -a claude-code`. Or copy the skill folder (skills/immune in Mathews-Tom/armory) into .claude/skills/immune in your project. Claude Code loads it when a task matches its description.

How do I install Immune in Codex?

Run `npx skills add Mathews-Tom/armory --skill immune -a codex`. Or copy the skill folder (skills/immune in Mathews-Tom/armory) into .agents/skills/immune in your project. Codex loads it when a task matches its description.

Can I use Immune in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Mathews-Tom/armory --skill immune -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/immune, .gemini/skills/immune, .github/skills/immune and .opencode/skills/immune in your project.

What does Immune need to run?

Going by SKILL.md and its folder, Immune needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Immune access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Immune safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Immune use?

Immune is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Immune use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Immune?

Skills that share tags, products or a category with Immune: Finishing a Development Branch (obra/superpowers, 297k stars), PR Babysitter (openinterpreter/openinterpreter, 69k stars), Check PR (onyx-dot-app/onyx, 32k stars) and PR Design Doc (OpenHands/OpenHands, 90k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Immune?

Mathews-Tom (a GitHub user) maintains it in Mathews-Tom/armory, which has 328 GitHub stars. The repository holds 80 skills in this directory. The repository was last updated on October 6, 2026.

Source: Mathews-Tom/armory on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.