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
31181 skills2 agents1 command
Install
$ npx -y skills add Mathews-Tom/armory --skill immune --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/immune

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

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

Get the whole plugin

Other skills on armory.