Skip to content
Development
Skill

/immune

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

From plugin
armory
33998 skills2 agents1 command

Claude Code

$ npx -y skills add Mathews-Tom/armory --skill immune --agent claude-code

SKILL.md

immune.SKILL.md
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
  status: active
  classification: tooling-wrapper
  source: https://github.com/contactjccoaching-wq/immune
  category: review
  tags: [memory, error-detection, antibodies, adaptive]
  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):**

{
  "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:

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

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

<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"

Read more
@mathews-tom
Ships witharmory

Curated, production-grade skills, agents, hooks, rules, commands, utilities, and presets for AI coding agents. No magic, no demos — battle-tested workflows built for developers who use AI seriously.

33998 skills2 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
339
Star history of Mathews-Tom/armory on GitHub, a chart by star-history.com

Other skills on armory.

doc-condenser

doc-condenser

**DEPRECATED** — Modern Claude models condense and summarize technical documentation natively with comparable quality. The output…

@mathews-tom@mathews-tomInstall Skill
opus-4-7-migration

opus-4-7-migration

DEPRECATED: The Opus 4.7 migration scanner is retired from the active skill catalog. Retained for archival reference only; not…

@mathews-tom@mathews-tomInstall Skill
regex-builder

regex-builder

**DEPRECATED** — Modern Claude models produce accurate, well-explained regex patterns with edge-case test suites natively,…

@mathews-tom@mathews-tomInstall Skill
sequential-thinking

sequential-thinking

**DEPRECATED** — Opus 4.7 uses adaptive thinking (optional at each step) and Sonnet 4.6 handles structured chain-of-thought…

@mathews-tom@mathews-tomInstall Skill
adr-writer

adr-writer

Generates Architecture Decision Records capturing context, rationale, alternatives, and consequences in numbered status-tracked…

@mathews-tom@mathews-tomInstall Skill
agent-builder

agent-builder

Build AI agents and automate Claude Code programmatically via the Claude Agent SDK and headless CLI mode. Covers Python SDK,…

@mathews-tom@mathews-tomInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about immune.

Which coding agents can use immune?
immune installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.